The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary Hack Tutorials (https://www.pokecommunity.com/forumdisplay.php?f=66)
-   -   Pyxal's Complete FireRed Upgrade Guidebook (https://www.pokecommunity.com/showthread.php?t=443233)

Pyxal December 15th, 2020 10:45 PM

Pyxal's Complete FireRed Upgrade Guidebook
 
https://i.ibb.co/pPBYQDt/736651762504827000-1.gif
Pyxal's Complete FireRed Upgrade Guidebook
This Guidebook has been made with the original documentation as it's source. Certain aspects are different from the official documents, but the results and outcomes are same. However, this is not a replacement for the official Complete FireRed Upgrade documentation. Bear in mind that this simplifies things and adds on to the actual documentation, but both will have to be read thoroughly to understand the Complete FireRed Upgrade. The Guidebook mainly focuses on stuff not yet included in the Complete FireRed Upgrade documentation, resources (including graphics and certain scripts), and ways to manipulate the Complete FireRed Upgrade to the users liking. The documentation, on the other hand, focuses on explaining every aspect of the Complete FireRed Upgrade, and how to utilize it at it's maximum potential. I would, however, recommend to read this BEFORE accessing the documentation. Be cautious reading this Guidebook since it may confuse you. If you are a beginner, you should indulge in simpler ROM hacking targets, and come back to the Complete FireRed Upgrade later. This guidebook has been named "Pyxal's Complete FireRed Upgrade Guidebook" since it is not an official guidebook (Skeli has no part in it's writing, except for all the knowledge [everything] he has shared, haha); this has simply been named with my initials since it is not OFFICIALLY related to the Complete FireRed Upgrade.


Introduction
This guidebook has been written in the hopes that more people look into the Complete FireRed Upgrade, one the best engines yet for any Gen III game. Though this guidebook DOES simplify things, you'll need to read this and the official Complete FireRed Upgrade documentation to fully understand how the Complete FireRed Upgrade works. However, I do urge to read this BEFORE reading the documentation. If the guidebook causes any confusion, don't hesitate to ask!

The Complete FireRed Upgrade, as the name says, is indeed a complete upgrade of Pokémon FireRed. To know what the Complete FireRed Upgrade actually does, I'll go ahead and quote ghoulslash (a co-creator of the Complete FireRed Upgrade) here: "This project is a massive engine upgrade for Pokémon FireRed. It includes an updated battle engine on par with the current generation's, including every single attack, ability, item, AI, and more. In fact, this is the only game engine in Gen III with every single move animation! In addition, it includes several game improvement features such as Expanded PC Boxes, a DexNav, dynamic overworld palettes, character customization, TM/HM expansion, a Battle Frontier, and many others. Most of the engine features are easily configurable to the user by simply commenting and uncommenting lines. An extensive documentation has been written to fully explain what this engine is capable of and how to use all of the features contained within. In addition, most table data is untouched or is loaded directly from the rom, allowing this engine to be smoothly implemented for (most) existing hacks!".


Preface
First and foremost, you should know that the first time you successfully get a ROM with the CFRU and DPE compiled in it, it will be referred to as a test drive. Why? Since the utilization of CFRU is a little more complex than that. The CFRU is only ever applied to a ROM once. This means that whenever you make an edit in your ROM, whether it be big or small, you'll always insert the CFRU after you've made that respective edit. The ROM in which you make all your edits, whether it be inserting new music, editing maps or adding scripts, is referred to as the base ROM or the BPRE0 ROM. Whenever you want to edit maps, scripts, items, trainer data, it should be done on the BPRE0 ROM. Whenever you want to test something reliant on CFRU, run the make script (explained below) and it takes about two seconds with minimal changes. Test whatever you need to on the test.gba ROM. After you've successfully inserted both the CFRU and DPE for the first time, you can move to the "Utilizing the DPE & CFRU" safely. That section will completely explain as to how the CFRU/DPE work, and how you use both of them correctly.

Setting up the DPE/CFRU
There are two methods for setting up the Dynamic Pokémon Expansion/Complete FireRed Upgrade. I personally recommend the second method, but it is entirely up to you. In the first method, you'll have to download the DPE/CFRU again and again whenever they are updated by the original creator, not to mention you'll have to match any files you've edited from the old one to the new one. The second method makes pulling any update from the original DPE/CFRU repositories much easier; all you'll need is one command. DO NOT switch in between methods! This will likely cause more confusion. Pick one method of setting up the DPE/CFRU and stick with it! Though if you have set up the DPE/CFRU in the past with the first method, you MAY switch over to the second method ONLY IF you've successfully done the first method PREVIOUSLY.

First Method:
Spoiler:
Please note that these steps apply to DPE as well!

The things you are required to have are:
  • DevKitPro [dl]
  • Python (3.7.6) [dl]
  • A vanilla FireRed [1636 - Pokémon Fire Red (U)(Squirrels)]

When learning to insert the CFRU for the first time, use a vanilla ROM. Now, the main event:
  • Download and install DevKitPro (get it here). Run the setup, click next and check "download and install/install from downloaded files". I recommend installing it somewhere as simple as C:\devkitPro (installing it at the desktop did not work for me). For the sake of this tutorial, I've installed DevKitPro in C:\devkitPro:



  • Now it's time to add devkitARM's (included with DevKitPro) bin folder to your path. Here's how to do that:
    Go in "This PC"/Left Click "Properties"/"Advanced System Settings" (on the left side)/A window will open; look at bottom of that window; "Environmental Variables"/In the "System variables" box (the 2nd box) scroll down until you see "Path" (the one highlighted in blue):



  • Double click "Path"/Follow the image below to add it to your path there (doesn't matter what the rest look like; keep eyes on the highlighted one; click "New" to add):



  • RESTART YOUR COMPUTER! Come to the next step after doing that.

  • Download the latest Python 3.7 (3.7.6) (download here). DO NOT DOWNLOAD PYTHON 3.8! After downloading and before proceeding to install, make sure that the add to path checkbox is ticked, otherwise you'll have to add the Python path in the environment variables manually.

  • Download the CFRU master folder from the GitHub page (Click 'Code', then 'Download Zip').



  • Get your ROM, rename it to "BPRE0" and place it the main (master) folder.



  • To decide the offsets where you want to insert the code: In 'scripts/make.py' change "OFFSET_TO_PUT=0x900000" to the location you want to insert the data (as said above).



  • Run PowerShell or Command Prompt from the main (master) folder. PowerShell is default set in Windows 10, so it's better to use that. To open, press Shift/Right Click/Select "Open PowerShell window here":



  • In the Power Shell or Command Prompt window (your choice), type python scripts//make.py; hit Enter.



  • This should show up (it marks that the CFRU is being applied successfully):



  • You should get two resultant files: test.gba and offsets. You've successfully applied the CFRU to your ROM. The test drive is complete! Let's move to Utilizing the DPE & CFRU.


Second Method:
Spoiler:
Please note that these steps apply to DPE as well!

With this method, we can easily pull any updates from the original CFRU repository, have our own CFRU fork repository, and push any updates made by us to our repository. Not to mention, if you later on decide to move onto decompilation and disassembly, you won't need to bother with all the initial steps. In this method, we'll be using WSL.
Following are the things you'll need:
  • DevKitPro [dl]
  • Python (3.7.6) [dl]
  • Ubuntu 18.04 LTS [explained in steps below]
  • Personal GitHub account [explained in steps below]
  • A vanilla FireRed [1636 - Pokémon Fire Red (U)(Squirrels)]

1) Setting up DevKit and Python:
  • Download and install DevKitPro (get it here). Run the setup, click next and check "download and install/install from downloaded files". I recommend installing it somewhere as simple as C:\devkitPro (installing it at the desktop did not work for me). For the sake of this tutorial, I've installed DevKitPro in C:\devkitPro:



  • Now it's time to add devkitARM's (included with DevKitPro) bin folder to your path. Here's how to do that:
    Go in "This PC"/Left Click "Properties"/"Advanced System Settings" (on the left side)/A window will open; look at bottom of that window; "Environmental Variables"/In the "System variables" box (the 2nd box) scroll down until you see "Path" (the one highlighted in blue):


  • Double click "Path"/Follow the image below to add it to your path there (doesn't matter what the rest look like; keep eyes on the highlighted one; click "New" to add):



  • RESTART YOUR COMPUTER! Come to the next step after doing that.

  • Download the latest Python 3.7 (3.7.6) (download here). DO NOT DOWNLOAD PYTHON 3.8! After downloading and before proceeding to install, make sure that the add to path checkbox is ticked, otherwise you'll have to add the Python path in the environment variables manually.

2) Cloning the CFRU:
  • Open the Windows Command Prompt as Administrator (look up "Command Prompt on your Start Menu, Right Click -> Run as Administrator).
    Once you've done that, execute the following command:
    Code:

    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all


    When the process finishes, you'll have to restart your PC by pressing "Y" to finish the process, so keep that in mind.

  • Go to the Microsoft Store and search "Ubuntu 18.04 LTS". Go to its page in the store and click the blue "Get" button.

  • The installation is as straightforward as any other program's. Open it, hit Install and wait until it's done. Launch Ubuntu when the installation finishes, so it can start its own setup. When Ubuntu opens, we'll be greeted by a command line window telling us that Ubuntu is: "Installing, this may take a few minutes...". Once we're ready to proceed, we'll be asked to introduce a username (in lowercase letters) and a password. Don't worry if you can't see the password as you're typing it, it's a security measure.

  • After that, the installation will be completed and we can safely close the window of Ubuntu. Why is that? Because from here on, we'll run Ubuntu by typing "wsl" on the Run window (Win Key + R). By running WSL this way, we'll be taken directly to the Windows Filesystem instead of Ubuntu's. More specifically, WSL will always open pointing to the C:\Users\USER folder. We can also run Ubuntu from the context menu by pressing "Shift" and right clicking on "Open Linux shell here". This allows you the open the Linux shell in any folder.

  • The very first thing you generally do after installing a distribution of Linux, is to update its list of packages. To do this, we'll use the following command:
    Code:

    sudo apt update


    Once we hit Enter, we will see that Ubuntu will retrieve different lists of packages from multiple sources. This is done so it can find the latest versions of each package and library you need.

  • Now that we updated our list of packages, let's update all the packages in our installation of WSL/Ubuntu.
    To do this, we'll use the following command:
    Code:

    sudo apt upgrade


    We'll hit the "y" key to tell WSL/Ubuntu that we want to update everything, and then the process will begin. Keep in mind that this'll probably take a long time. There's nothing to be done about it. Endure it. At some point during the process, you'll be asked to confirm whether you want WSL to restart automatically during package updates. We'll select "Yes" and press Enter. The process will then proceed. Once it's done, we move on.

  • To clone the CFRU, we'll first have to make a fork. To make a fork, we need an account:
    • Let's head on to GitHub, click the "Sign Up" button in the top right corner, and create an account as you normally would. Once you have activated your account, GitHub will automatically take you to the page where you can create a repository. But we won't make a repo just yet.
    • Let's link our GitHub account. It's pretty simple. Go back to your shell/terminal and execute the following commands (type USERNAME and EMAIL between the quotation marks):
      Code:

      git config --global user.name "Insert your GitHub account's username here"


      Code:

      git config --global user.email "Insert your GitHub account's email here"


      Note: If you're using WSL and you get the following error: "error: could not lock config file /path/.gitconfig: No suck file or directory.", don't panic. I had it happen to me as well. To fix it, I just had to set my GitHub account's name and email on a per-folder basis, meaning that each time I clone Pokeemerald, I'd have to use these commands within the project's folder on WSL, but without the --global parameter.
      I'm not completely sure if it's the best way to go about it, but it's a solution that works.

  • Let's head back to https://github.com/Skeli789/Complete-Fire-Red-Upgrade. Click on the top right "Fork" button:
    https://i.ibb.co/YyH1Fpc/2.png
    It'll take a few seconds, but you'll be greeted with a page similar to the original CFRU page. Remember that this your copy (fork), and not the original CFRU page.

  • Now, on our computer, let's head to our desired location where we want to clone our forked CFRU folder. For the tutorials sake, I'll clone our CFRU fork in C:\Users\USER (if you closed the shell/terminal, reopen it by either the context menu or by typing "wsl" on the Run window [Win Key + R]).

  • When we are in our desired location, let's make a dedicated folder to use for our CFRU project here. You know, to keep things clean.
    Code:

    mkdir CFRU



  • Good, let's move to this new folder by using:
    Code:

    cd CFRU



  • Now, we'll clone our CFRU fork on our computer by running this command:
    Code:

    git clone https://github.com/USERNAME/NAME_OF_YOUR_REPOSITORY


    So, for example, for me, it'll be:
    Code:

    git clone https://github.com/TheRealSpacewalker/Complete-Fire-Red-Upgrade


    It'll take a while, but after it's done, we should have folder called "Complete-Fire-Red-Upgrade" in the folder "CFRU" we made.

3) Linking our project with GitHub:
  • Let's move in our newly cloned Complete-Fire-Red-Upgrade folder now by:
    Code:

    cd Complete-Fire-Red-Upgrade



  • The first thing we'll do, is to fix or rather adjust the repositories that our project is tracking. Right now, if we use git remote -v, we'll see something like this:
    https://i.ibb.co/gPTFw3H/1.png
    This is telling us that the only repository we're tracking is Skeli's, and the "keyword" we use to interact with it is called "origin". So, what should we do? Let's set a new URL for origin (the URL to our GitHub Repository). We'll do this by using:
    Code:

    git remote set-url origin https://github.com/USERNAME/NAME_OF_YOUR_REPOSITORY


    The result should be something like this:
    https://i.ibb.co/884xTMF/3.png
    With this, we're telling to our local copy of the CFRU that the new home for our project will be the URL we just set origin to.

  • But now, what happens when/if we want to pull any updates from the original CFRU repo? To address that, we'll track the original repository via git remote. That way we'll have our own home for our project in GitHub, and we'll also be able to pull stuff from CFRU at will. We'll do this by using:
    Code:

    EXAMPLE: git remote add keyword link_to_the_repository


    "keyword" will be the word of our choice that will act as the shortcut to Skeli's CFRU Repository.
    "link_to_the_repository" will be the URL to it.

    In other words, something like:
    Code:

    git remote add cfru https://github.com/Skeli789/Complete-Fire-Red-Upgrade


    That way, we could do
    git pull cfru master
    and stuff like that whenever we wanted (the master is the branch; the CFRU repo has only one branch).

    And just like that, we're basically done here. The test drive is complete! Let's move to Utilizing the DPE & CFRU.


Utilizing the DPE & CFRU
suggested addons | ;-; | that's all for now

With your "test drive", you can chuck the test.gba ROM in the bin. Or you don't have to; I don't know, depends on you. Now let's set up your BPRE0 ROM.
  • Add the Dynamic Pokémon Expansion (and other suggested add-ons) to your rom. This will be referred to as ROM 1.

  • Add the CFRU to a vanilla FireRed ROM at the same offset (I recommend CFRU at x160000; DPE at x180000) you plan on adding it to your hack. This will be referred to as ROM 2.

  • Open the generated file offsets.ini and search for gMoveNames.
    https://i.ibb.co/kqyLjjV/gmovename.png
    Record the offset that you find there. This will be referred to as Offset 1.

  • Assuming your moves list ends with the Z-Moves, search for Z_Move_1 in offsets.ini.
    https://i.ibb.co/DLh8KJW/zmovenames.png
    Record the offset that you find there. This will be referred to as Offset 2.

  • Open ROM 2 in a hex editor and select all data from Offset 1 up to but not including Offset 2.
    https://i.ibb.co/jyvQzgx/offset-1-to-offset-2.png

  • Copy this data and paste it at Offset 1 in ROM 1.
    https://i.ibb.co/yn383kD/offset-1-in-rom-1.png

  • At 0x148 place a pointer to Offset 1.
    https://i.ibb.co/NCj2PzQ/pointer-0x148.png

  • ROM 2 has no more use so feel free to delete it.
  • Treat ROM 1 as your base rom for the CFRU. It is recommended to do all scripting, mapping, and trainer editing in ROM 1. When you’re ready to test, run the command python scripts//make.py and test on the generated test.gba (it’ll take only a second to recompile if no changes have been made to the CFRU). This test.gba also makes a great location to test scripts to make sure they work properly before finalizing them.

Spoiler: Recommended Add-On's:
The following are a list of recommended add-ons created by other users of the PokéCommunity that for some reason or another, were chosen to be left out from this engine. If you choose to apply any of these, they should be applied prior to applying (or "inserting") the engine

General:
Music:


Spoiler: ;-;
The steps mentioned above are the same as the "Recommended Insertion Steps" for the CFRU documentation. For any clarification regarding the "Recommended Insertion Steps", Skeli's DM might help clear the issue:



That's all for now! The ROM is your canvas. I wanted to expand and explain many aspects of both DPE and CFRU, and I might do so in the next tutorial update; stay tuned.


Usable Resources
Coming soon! I'll make an entire resource depot from resources I've found in these two years of hacking. If you want to contribute, please DM me on Discord (Astrophel#8460).


Additional Tutorials

Graphics manipulation (in CFRU):
Spoiler:
For now, please look at the #cfru-tutorials channel on the Unbound server (https://discord.com/invite/k34Jm4T)!


Scripting (in CFRU):
Spoiler:
For now, please look at the #cfru-tutorials channel on the Unbound server (https://discord.com/invite/k34Jm4T)!


Avoid 12-character attack names:



Notes
  • As I've said above before and before, do not edit the "test" GBA ROM you get.
  • Read the documentation at least ONCE from start to finish.
  • If you've expanded the OverWorld table, in "src/character_customization.c" change "(NPCPtr*) 0x839FDB0" to the address your OW table takes.
  • If you've inserted new Battle BG's and have time enabled at the same time, the custom inserted backgrounds will not have anything wrong with them, since it is dynamic based for all battle backgrounds.


Links and Information
  • The official CFRU page on PokéCommunity: https://www.pokecommunity.com/showthread.php?t=425447
  • Older tutorial (CSS):
    Spoiler:
    [B][SIZE="5"]Introduction[/SIZE][/B]
    The [B][URL="https://github.com/Skeli789/Complete-Fire-Red-Upgrade"]Complete FireRed Upgrade[/URL][/B], as the name says, is indeed a complete upgrade of Pokémon FireRed. It even consists of features which none other base has for Gen III yet, a few of them being Dynamax, a complete set of move animations, an immensely improved AI system, you get the gist. In my opinion, there isn't a better base for Gen III.

    I'll go ahead and quote ghoulslash here: "This project is a massive engine upgrade for Pokémon FireRed. It includes an updated battle engine on par with the current generation's, including every single attack, ability, item, AI, and more. In fact, this is the only game engine in Gen III with every single move animation! In addition, it includes several game improvement features such as Expanded PC Boxes, a DexNav, dynamic overworld palettes, character customization, TM/HM expansion, a Battle Frontier, and many others. Most of the engine features are easily configurable to the user by simply commenting and uncommenting lines. An extensive documentation has been written to fully explain what this engine is capable of and how to use all of the features contained within. In addition, most table data is untouched or is loaded directly from the rom, allowing this engine to be smoothly implemented for (most) existing hacks!"

    As ghoulslash said, this engine updates if not every, 95.00% of all the aspects of vanilla FireRed. I bring this tutorial in hopes that other people can recognize and use this engine.

    There are two methods for setting up the Complete FireRed Upgrade. I personally recommend the second method, but it is entirely up to you. The second method makes pulling any update from the original CFRU repository much easier. In the first method, you'll have to download the CFRU again and again whenever it is updated, not to mention you'll have to match any files you've edited from the old one to the new one, whereas in the second method, all you'll need is one command.

    [B][SIZE="5"]Setting up the CFRU (first method)[/SIZE][/B]
    [SPOILER]Setting up the CFRU may seem like a hassle, but practice makes perfect. The things you are required to have are:[LIST][*]DevKitPro [URL="https://github.com/devkitPro/installer/releases/tag/v3.0.3"][dl][/URL][*]Python (3.7.6) [URL="https://www.python.org/downloads/release/python-376/"][dl][/URL][*]A vanilla FireRed [1636 - Pokemon Fire Red (U)(Squirrels)][/LIST]That's about it. Python and DevKit are two essential things for the CFRU to work, so they are a must. How do we utilize them? For simplification, this segment will be broken into two parts:

    [B][SIZE="3"]1) Initial ROM steps:[/SIZE][/B]
    Please note that I would recommend to skip to the step below (Compiling the CFRU) to understand as in how to insert it in a ROM, and come to this step (Initial ROM steps) after learning how to properly insert it in a ROM. When learning to insert the CFRU for the first time, use a [URL="https://www.merriam-webster.com/dictionary/vanilla"][B]vanilla ROM[/B][/URL].

    [B][COLOR="Red"]It is NOT recommended to edit a ROM which has the CFRU inserted in it.[/COLOR][/B] The CFRU can ideally be applied to a ROM only once. This means that all the editing, whether it be spriting, scripting, mapping or graphics modification, is done prior to applying the CFRU. This is to avoid having issues and bugs in your ROM, since the CFRU is an extremely heavy insertion that may cause oddities in your ROM if the ROM is edited after the CFRU being inserted. I would suggest again to first of all learn how to insert the CFRU in a vanilla ROM, and come back to "Initial ROM steps" later.

    With that warning out of the way, you can add any of the following relevant additions (this isn't necessary of course. You can simply skip these additions, do your own mapping, scripting, graphics editing etc, and compile the CFRU as told in the next step).
    The following are a list recommended add-ons created by other users of the PokéCommunity that for some reason or another, were chosen to be left out from this engine. If you choose to apply any of these, they should be applied prior to applying the engine.

    [B][SIZE="2"]General:[/SIZE][/B][LIST][*][URL="https://github.com/Skeli789/Dynamic-Pokemon-Expansion"]Dynamic Pokémon Expansion[/URL]
    HIGHLY RECOMMENDED. Same steps as below, please view them!

    [*][URL="https://www.pokecommunity.com/showthread.php?t=378934"]Sideways Stairs[/URL]
    HIGHLY RECOMMENDED.

    [*][URL="https://www.pokecommunity.com/showthread.php?t=399121"]Black & White Pokémon Summary Screen[/URL]
    HIGHLY RECOMMENDED. For proper space for attack descriptions.

    [*][URL="https://www.pokecommunity.com/showthread.php?t=438646"]Complete FireRed Decapitalization Patch[/URL]
    HIGHLY RECOMMENDED. If you want decapitalization.

    [*][URL="https://www.dropbox.com/s/i0zq8fegdeyjmf0/Item%20Data.rar?dl=0"]Item Data till Gen VIII[/URL]
    HIGHLY RECOMMENDED. Please follow the INSTRUCTIONS.txt file!

    [*][URL="https://www.pokecommunity.com/showthread.php?p=9547750"]Overworld Form Change[/URL]
    Only Arceus, Silvally, Genesect, & Giratina are included in the CFRU.

    [*][URL="https://www.pokecommunity.com/showthread.php?t=414022"]DS-Style Pokémon Selection Screen[/URL]
    Note that the standard 'BPRE Basic Patch' is not compatible with the CFRU. The other two should be fine.

    [*][URL="https://www.pokecommunity.com/showpost.php?p=9043890&postcount=816"]Nature Coloured Stats[/URL]
    See BW Summary Screen Patch if using the Black & White Pokémon Summary Screen

    [*][URL="https://www.pokecommunity.com/showpost.php?p=10192478&postcount=1513"]IV Rankings[/URL]
    See BW Summary Screen Patch if using the Black & White Pokémon Summary Screen[/LIST]
    [B][SIZE="2"]Music:[/SIZE][/B][LIST][*][URL="https://www.pokecommunity.com/showthread.php?t=342914"]HGSS Kanto Reloaded Music Patch[/URL]

    [*][URL="https://www.pokecommunity.com/showthread.php?t=308411"]HGSS Johto Music Patch[/URL]

    [*][URL="https://www.pokecommunity.com/showthread.php?t=402253"]BW/BW2 Music Patch[/URL]
    Change four bytes at x4A32A0 to A0 FA 03 02 after patching.

    [*][URL="https://www.pokecommunity.com/showthread.php?t=332272"]All-Instrument Patch[/URL]
    Make sure to change insert offset of engine to avoid overwriting.

    [*][URL="https://www.pokecommunity.com/showthread.php?t=375275"]Squeetz’ Music Rom Base[/URL]

    Additionally, most of this stuff is already included in [B][URL="https://www.pokecommunity.com/showthread.php?t=409672"]Leon's base[/URL][/B]; you can check that as well.[/LIST]
    After adding any of the above stuff, or none at all, follow the [B]"Recommended Insertion Steps" in the documentation provided with the CFRU[/B] (at the first step, it'll be told to insert the DPE [same insertion method as CFRU] to your ROM. The insertion method is explained in the next step). Once that's done, you're free to map, script, and whatever else you can think of (should be compatible with CFRU). When you're ready to test what you've done so far, insert the CFRU into your ROM. For any clarification regarding the "Recommended Insertion Steps" in the documentation, have a look at the spoiler tag below.
    [SPOILER][CENTER][IMG]https://i.ibb.co/TYWZ2sB/image0.jpg[/IMG][/CENTER][/SPOILER]

    [B][SIZE="3"]2) Compiling the CFRU:[/SIZE][/B]
    Please note that these steps apply to DPE as well.

    If you've added any of the above things, some changes may need to be made. Any of those changes are mentioned directly and others are provided in the download.

    Before applying the CFRU you can change the offset in where you insert it. This can be found in CFRU master folder/scripts/open "make.py" in a text editor/OFFSET_TO_PUT = 0x900000/Change the "900000" however you like (must be in the ROM). It's better to expand your ROM to 32 MB before inserting the CFRU + DPE. I'd recommend the CFRU at x1600000 DPE at x1800000.


    [SIZE="2"]How to apply the CFRU (same steps as DPE):[/SIZE][LIST][*]Download and install DevKitPro ([URL="https://github.com/devkitPro/installer/releases/tag/v3.0.3"][B]get it here[/B][/URL]). Run the setup, click next and check "download and install/install from downloaded files". I recommend installing it somewhere as simple as C:\devkitPro (installing it at the desktop did not work for me). [B]For the sake of this tutorial, I've installed DevKitPro in C:\devkitPro[/B]:
    [CENTER][IMG]https://i.ibb.co/8rSNPnr/local-disk-c.png[/IMG][/CENTER]



    [*]Now it's time to add devkitARM's (included with DevKitPro) bin folder to your path. Here's how to do that:
    Go in "This PC"/Left Click "Properties"/"Advanced System Settings" (on the left side)/A window will open; look at bottom of that window; "Enviromental Variables"/In the "System variables" box (the 2nd box) scroll down until you see "Path" (the one highlighted in blue):
    [CENTER][IMG]https://i.ibb.co/VpG72kL/path.png[/IMG][/CENTER]



    [*]Double click "Path"/Follow the image below to add it to your path there (doesn't matter what the rest look like; keep eyes on the highlighted one; click "New" to add):
    [CENTER][IMG]https://i.ibb.co/YL7Gq26/840928042398402.png[/IMG][/CENTER]



    [*]RESTART YOUR COMPUTER! Come to the next step after doing that.

    [*]Download the latest Python 3.7 (3.7.6) ([URL="https://www.python.org/downloads/release/python-376/"][B]download here[/B][/URL]). [B]DO NOT DOWNLOAD PYTHON 3.8![/B] After downloading and before proceeding to install, make sure that the [B]add to path[/B] checkbox is ticked, otherwise you'll have to add the Python path in the environment variables manually.

    [*]Download the CFRU master folder from the [B][URL="https://github.com/Skeli789/Complete-Fire-Red-Upgrade"]GitHub page[/URL][/B] (Click 'Code', then 'Download Zip').
    [CENTER][IMG]https://i.ibb.co/88dg8RQ/cfru.png[/IMG][/CENTER]



    [*]Get your ROM, rename it to "BPRE0" and place it the main (master) folder.
    [CENTER][IMG]https://i.ibb.co/b7JYjGZ/BPRE0.png[/IMG][/CENTER]



    [*]To decide the offsets where you want to insert the code: In 'scripts/make.py' change "OFFSET_TO_PUT=0x900000" to the location you want to insert the data (as said above).
    [CENTER][IMG]https://i.ibb.co/T2Lx4Pr/scripts.png[/IMG][/CENTER]



    [*]Run PowerShell or Command Prompt from the main (master) folder. PowerShell is default set in Windows 10, so it's better to use that. To open, press Shift/Right Click/Select "Open PowerShell window here":
    [CENTER][IMG]https://i.ibb.co/KKsZdw6/powershel.png[/IMG][/CENTER]



    [*]In the Power Shell or Command Prompt window (your choice), type python scripts//make.py; hit Enter.
    [CENTER][IMG]https://i.ibb.co/YQThMjt/make.png[/IMG][/CENTER]



    [*]This should show up (it marks that the CFRU is being applied successfully):
    [CENTER][IMG]https://i.ibb.co/M56gxMF/success.png[/IMG][/CENTER]



    [*]You should get two resultant files: test.gba and offsets. You've successfully applied the CFRU to your ROM.[/LIST][/SPOILER]

    [B][SIZE="5"]Setting up the CFRU (second method)[/SIZE][/B]
    [SPOILER]With this method, we can easily pull any updates from the original CFRU repository, have our own CFRU fork repository, and push any updates made by us to our repository. This may seem confusing at first, but after awhile, it'll be easy as pie. In this method, we'll be using [URL="https://www.google.com/search?q=what+is+wsl+in+windows+10&oq=what+is+wsl&aqs=chrome.1.69i57j0l9.3561j0j7&sourceid=chrome&ie=UTF-8"][B]WSL[/B][/URL].
    Following are the things you'll need:[LIST][*]DevKitPro [URL="https://github.com/devkitPro/installer/releases/tag/v3.0.3"][dl][/URL][*]Python (3.7.6) [URL="https://www.python.org/downloads/release/python-376/"][dl][/URL][*]Ubuntu 18.04 LTS [SIZE="1"][explained in steps below][/SIZE][*]Personal GitHub account [SIZE="1"][explained in steps below][/SIZE][*]A vanilla FireRed [1636 - Pokemon Fire Red (U)(Squirrels)][/LIST]
    [B][SIZE="3"]1) Setting up DevKit and Python:[/SIZE][/B][LIST][*]Download and install DevKitPro ([URL="https://github.com/devkitPro/installer/releases/tag/v3.0.3"][B]get it here[/B][/URL]). Run the setup, click next and check "download and install/install from downloaded files". I recommend installing it somewhere as simple as C:\devkitPro (installing it at the desktop did not work for me). [B]For the sake of this tutorial, I've installed DevKitPro in C:\devkitPro[/B]:
    [CENTER][IMG]https://i.ibb.co/8rSNPnr/local-disk-c.png[/IMG][/CENTER]



    [*]Now it's time to add devkitARM's (included with DevKitPro) bin folder to your path. Here's how to do that:
    Go in "This PC"/Left Click "Properties"/"Advanced System Settings" (on the left side)/A window will open; look at bottom of that window; "Enviromental Variables"/In the "System variables" box (the 2nd box) scroll down until you see "Path" (the one highlighted in blue):
    [CENTER][IMG]https://i.ibb.co/VpG72kL/path.png[/IMG][/CENTER]


    [*]Double click "Path"/Follow the image below to add it to your path there (doesn't matter what the rest look like; keep eyes on the highlighted one; click "New" to add):
    [CENTER][IMG]https://i.ibb.co/YL7Gq26/840928042398402.png[/IMG][/CENTER]



    [*]RESTART YOUR COMPUTER! Come to the next step after doing that.

    [*]Download the latest Python 3.7 (3.7.6) ([URL="https://www.python.org/downloads/release/python-376/"][B]download here[/B][/URL]). [B]DO NOT DOWNLOAD PYTHON 3.8![/B] After downloading and before proceeding to install, make sure that the [B]add to path[/B] checkbox is ticked, otherwise you'll have to add the Python path in the environment variables manually.[/LIST]
    [B][SIZE="3"]2) Cloning the CFRU:[/SIZE][/B][LIST][*]Open the Windows Command Prompt as Administrator (look up "Command Prompt on your Start Menu, Right Click -> Run as Administrator).
    Once you've done that, execute the following command:
    [code]dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all[/code]
    When the process finishes, you'll have to restart your PC by pressing "Y" to finish the process, so keep that in mind.

    [*]Go to the Microsoft Store and search "Ubuntu 18.04 LTS". Go to its page in the store and click the blue "Get" button.

    [*]The installation is as straightforward as any other program's. Open it, hit Install and wait until it's done. Launch Ubuntu when the installation finishes, so it can start its own setup. When Ubuntu opens, we'll be greeted by a command line window telling us that Ubuntu is: "Installing, this may take a few minutes...". Once we're ready to proceed, we'll be asked to introduce a username (in lowercase letters) and a password. Don't worry if you can't see the password as you're typing it, it's a security measure.

    [*]After that, the installation will be completed and we can safely close the window of Ubuntu. Why is that? Because from here on, we'll run Ubuntu by typing "wsl" on the Run window (Win Key + R). By running WSL this way, we'll be taken directly to the Windows Filesystem instead of Ubuntu's. More specifically, WSL will always open pointing to the C:\Users\USER folder. We can also run Ubuntu from the context menu by pressing "Shift" and right clicking on "Open Linux shell here". This allows you the open the Linux shell in any folder.

    [*]The very first thing you generally do after installing a distribution of Linux, is to update its list of packages. To do this, we'll use the following command:
    [code]sudo apt update[/code]
    Once we hit Enter, we will see that Ubuntu will retrieve different lists of packages from multiple sources. This is done so it can find the latest versions of each package and library you need.

    [*]Now that we updated our list of packages, let's update all the packages in our installation of WSL/Ubuntu.
    To do this, we'll use the following command:
    [code]sudo apt upgrade[/code]
    We'll hit the "y" key to tell WSL/Ubuntu that we want to update everything, and then the process will begin. Keep in mind that this'll probably take a long time. There's nothing to be done about it. Endure it. At some point during the process, you'll be asked to confirm whether you want WSL to restart automatically during package updates. We'll select "Yes" and press Enter. The process will then proceed. Once it's done, we move on.

    [*]To clone the CFRU, we'll first have to make a fork. To make a fork, we need an account:[LIST][*]Let's head on to [B][URL="https://github.com/"]GitHub[/URL][/B], click the "Sign Up" button in the top right corner, and create an account as you normally would. Once you have activated your account, GitHub will automatically take you to the page where you can create a repository. But we won't make a repo just yet.[*]Let's link our GitHub account. It's pretty simple. Go back to your shell/terminal and execute the following commands (type USERNAME and EMAIL between the quotation marks):
    [code]git config --global user.name "Insert your GitHub account's username here"[/code]
    [code]git config --global user.email "Insert your GitHub account's email here"[/code]
    Note: If you're using WSL and you get the following error: "error: could not lock config file /path/.gitconfig: No suck file or directory.", don't panic. I had it happen to me as well. To fix it, I just had to set my GitHub account's name and email on a per-folder basis, meaning that each time I clone Pokeemerald, I'd have to use these commands within the project's folder on WSL, but without the --global parameter.
    I'm not completely sure if it's the best way to go about it, but it's a solution that works.[/LIST]
    [*]Let's head back to [B][url]https://github.com/Skeli789/Complete-Fire-Red-Upgrade[/url][/B]. Click on the top right "Fork" button:
    [IMG]https://i.ibb.co/YyH1Fpc/2.png[/IMG]
    It'll take a few seconds, but you'll be greeted with a page similar to the original CFRU page. Remember that this your copy (fork), and not the original CFRU page.

    [*]Now, on our computer, let's head to our desired location where we want to clone our forked CFRU folder. For the tutorials sake, I'll clone our CFRU fork in C:\Users\USER (if you closed the shell/terminal, reopen it by either the context menu or by typing "wsl" on the Run window [Win Key + R]).

    [*]When we are in our desired location, let's make a dedicated folder to use for our CFRU project here. You know, to keep things clean.
    [code]mkdir CFRU[/code]


    [*]Good, let's move to this new folder by using:
    [code]cd CFRU[/code]


    [*]Now, we'll clone our CFRU fork on our computer by running this command:
    [code]git clone https://github.com/USERNAME/NAME_OF_YOUR_REPOSITORY[/code]
    So, for example, for me, it'll be:
    [code]git clone https://github.com/TheRealSpacewalker/Complete-Fire-Red-Upgrade[/code]
    It'll take a while, but after it's done, we should have folder called "Complete-Fire-Red-Upgrade" in the folder "CFRU" we made.[/LIST]
    [B][SIZE="3"]3) Linking our project with GitHub:[/SIZE][/B][LIST][*]Let's move in our newly cloned Complete-Fire-Red-Upgrade folder now by:
    [code]cd Complete-Fire-Red-Upgrade[/code]


    [*]The first thing we'll do, is to fix or rather adjust the repositories that our project is tracking. Right now, if we use git remote -v, we'll see something like this:
    [IMG]https://i.ibb.co/gPTFw3H/1.png[/IMG]
    This is telling us that the only repository we're tracking is Skeli's, and the "keyword" we use to interact with it is called "origin". So, what should we do? Let's set a new URL for origin (the URL to our GitHub Repository). We'll do this by using:
    [code]git remote set-url origin https://github.com/USERNAME/NAME_OF_YOUR_REPOSITORY[/code]
    The result should be something like this:
    [IMG]https://i.ibb.co/884xTMF/3.png[/IMG]
    With this, we're telling to our local copy of the CFRU that the new home for our project will be the URL we just set origin to.

    [*]But now, what happens when/if we want to pull any updates from the original CFRU repo? To address that, we'll track the original repository via git remote. That way we'll have our own home for our project in GitHub, and we'll also be able to pull stuff from CFRU at will. We'll do this by using:
    [code]EXAMPLE: git remote add keyword link_to_the_repository[/code]

    "keyword" will be the word of our choice that will act as the shortcut to Skeli's CFRU Repository.
    "link_to_the_repository" will be the URL to it.

    In other words, something like:
    [code]git remote add cfru https://github.com/Skeli789/Complete-Fire-Red-Upgrade[/code]
    That way, we could do [icode]git pull cfru master[/icode] and stuff like that whenever we wanted (the master is the branch; the CFRU repo has only one branch).

    And just like that, we're basically done here.[/LIST]
    [B][SIZE="3"][COLOR="Red"][INCOMPLETE][/COLOR] 4) Using the CFRU with your ROM:[/SIZE][/B]
    The CFRU can ideally be applied to a ROM only once. This means that all the editing, whether it be spriting, scripting, mapping or graphics modification, is done prior to applying the CFRU. This is to avoid having issues and bugs in your ROM, since the CFRU is an extremely heavy insertion that may cause oddities in your ROM if the ROM is edited after the CFRU being inserted. [B][COLOR="Red"]It is NOT recommended to edit a ROM which has the CFRU inserted in it.[/COLOR][/B]

    With that warning out of the way, you can add any of the following relevant additions (this isn't necessary of course. You can simply skip these additions, do your own mapping, scripting, graphics editing etc, and jump straight to the next step).
    The following are a list recommended add-ons created by other users of the PokéCommunity that for some reason or another, were chosen to be left out from this engine. If you choose to apply any of these, they should be applied prior to applying the engine.

    [B][SIZE="2"]General:[/SIZE][/B][LIST][*][URL="https://github.com/Skeli789/Dynamic-Pokemon-Expansion"]Dynamic Pokémon Expansion[/URL]
    HIGHLY RECOMMENDED. Same steps as below, please view them!

    [*][URL="https://www.pokecommunity.com/showthread.php?t=378934"]Sideways Stairs[/URL]
    HIGHLY RECOMMENDED.

    [*][URL="https://www.pokecommunity.com/showthread.php?t=399121"]Black & White Pokémon Summary Screen[/URL]
    HIGHLY RECOMMENDED. For proper space for attack descriptions.

    [*][URL="https://www.pokecommunity.com/showthread.php?t=438646"]Complete FireRed Decapitalization Patch[/URL]
    HIGHLY RECOMMENDED. If you want decapitalization.

    [*][URL="https://www.dropbox.com/s/i0zq8fegdeyjmf0/Item%20Data.rar?dl=0"]Item Data till Gen VIII[/URL]
    HIGHLY RECOMMENDED. Please follow the INSTRUCTIONS.txt file!

    [*][URL="https://www.pokecommunity.com/showthread.php?p=9547750"]Overworld Form Change[/URL]
    Only Arceus, Silvally, Genesect, & Giratina are included in the CFRU.

    [*][URL="https://www.pokecommunity.com/showthread.php?t=414022"]DS-Style Pokémon Selection Screen[/URL]
    Note that the standard 'BPRE Basic Patch' is not compatible with the CFRU. The other two should be fine.

    [*][URL="https://www.pokecommunity.com/showpost.php?p=9043890&postcount=816"]Nature Coloured Stats[/URL]
    See BW Summary Screen Patch if using the Black & White Pokémon Summary Screen

    [*][URL="https://www.pokecommunity.com/showpost.php?p=10192478&postcount=1513"]IV Rankings[/URL]
    See BW Summary Screen Patch if using the Black & White Pokémon Summary Screen[/LIST]
    [B][SIZE="2"]Music:[/SIZE][/B][LIST][*][URL="https://www.pokecommunity.com/showthread.php?t=342914"]HGSS Kanto Reloaded Music Patch[/URL]

    [*][URL="https://www.pokecommunity.com/showthread.php?t=308411"]HGSS Johto Music Patch[/URL]

    [*][URL="https://www.pokecommunity.com/showthread.php?t=402253"]BW/BW2 Music Patch[/URL]
    Change four bytes at x4A32A0 to A0 FA 03 02 after patching.

    [*][URL="https://www.pokecommunity.com/showthread.php?t=332272"]All-Instrument Patch[/URL]
    Make sure to change insert offset of engine to avoid overwriting.

    [*][URL="https://www.pokecommunity.com/showthread.php?t=375275"]Squeetz’ Music Rom Base[/URL]

    Additionally, most of this stuff is already included in [B][URL="https://www.pokecommunity.com/showthread.php?t=409672"]Leon's base[/URL][/B]; you can check that as well.[/LIST][/SPOILER]

    [B][SIZE="5"]Notes[/SIZE][/B][LIST][*]As I've said above before and before, do not edit the "test" GBA ROM you get.[*]A line with "//" on the front is commented. A line without "//" in the front is uncommented. "Comment out" means not to uncomment, but to comment it, so it's out of the ROM.[*]I've not added everything in this tutorial from the Document since it would be a waste of effort. There is much regarding CFRU in it's documentation. You will have to read the entirety of it to understand on how to use the CFRU to it's full potential.[*]If you've expanded the OverWorld table, in "src/character_customization.c" change "(NPCPtr*) 0x839FDB0" to the address your OW table takes.[*]If you've inserted new Battle BG's and have time enabled at the same time, the custom inserted backgrounds will not have anything wrong with them, since it is dynamic based for all battle backgrounds.[*]With the latest update, "#define FOOTSTEP_NOISE" in src/config.h does not work, whether commented or uncommented.[*]The "BPRE" DS-Style Pokémon Selection Screen is not compatible with the CFRU; additionally, if you used any of the other patches, in "src/config.h", uncomment "#define GEN4_PLUS_SELECTION_SCREEN".[/LIST]
    [B][SIZE="5"]Optional additions[/SIZE][/B]
    Here is a list of things you can customize in CFRU if you wish. Note that a majority of CFRU's features are interlinked with other files. Additionally, many of its features are locked behind these files. Everything listed here can be edited to suit your own personal ROM needs:
    [SPOILER][LIST][*][b]asm_defines.s[/b]
    Here is a list of defines for various ASM routines inserted by CFRU. If you are to manipulate the following:
    The Move Table, Species defines, the Item Table, or created New Item Effects.

    Then you must change this file accordingly!

    [b][*]bytereplacement[/b]
    Here is a list of various hex edits the CFRU will insert upon its use. You can add any hex values you want to this table as well.

    [b][*]assembly/data/attack_anim_table.s[/b]
    If you edit the available moves, you will also need to define the new order here, and create new animations for them. Animation data could be found in these locations:

    assembly/data/anim_background_table.s
    assembly/data/anim_background_graphics_defines.s
    assembly/data/particle_graphics_defines.s
    assembly/data/particle_table.s

    You can also point new moves to existing animations by setting: goto ANIM_(Move).

    [b][*]assembly/data/attack_description_table.s[/b]
    This is the table that points each move to their respective descriptions. If you add new moves, add to this as well. (Be sure to place them between Gen 8 moves and Z moves).

    [b][*]assembly/data/item_tables.s[/b]
    These are tables for items associated with battle moves and effects. Namely Natural Gift.

    [b][*]assembly/data/move_tables.s[/b]
    This is a collection of various tables dedicated to move effects- such as ban lists, or moves defined by abilities like Iron Fist, sound based moves, and other effects. If you added moves, look into these tables.

    [b][*]assembly/data/type_tables.s[/b]
    This is a table for the location of the type icons when the type icon image table is inserted or replaced.

    [b][*]include/constants/moves.h[/b]
    Ensure that this matches what is contained in the DPE repository.

    [b][*]include/constants/pokedex.h[/b]
    Ensure that this matches what is contained in the DPE repository.

    [b][*]include/region_map_sections.h[/b]
    This is where you define each map name included in your rom.

    [b][*]include/constants/songs.h[/b]
    This is where you define each song included in your rom.

    [b][*]include/constants/species.h[/b]
    Ensure that this matches what is contained in the DPE repository.

    [b][*]include/constants/trainer_classes.h[/b]
    Defines the list of trainer classes. Feel free to replace a few.

    [b][*]include/constants/trainers.h[/b]
    Defines special Trainer IDs and the list of trainer sprite images.

    [b][*]include/constants/tutors.h[/b]
    Ensure that this matches what is contained in the DPE repository.

    [b][*]include/new/dexnav_config.hv[/b]
    Configuration for DexNav settings.

    [b][*]include/new/dns_data.h[/b]
    Configuration for DNS settings. Includes tints, setting windows to change with time of day, etc.

    [b][*]include/new/trainer_sliding_data.h[/b]
    Here is where you declare various strings and battle scripts, including sliding trainers.

    [b][*]src/catching.c[/b]
    Here is where new PokéBalls and their settings are defined. Read CFRU documentation for more info.

    [b][*]src/config.c[/b]
    Everything can be edited freely.

    [b][*]src/dynamax.c[/b]
    Allows you to customize Dynamax settings such as level ranges, egg move chances, etc.

    [b][*]src/form_change.c[/b]
    Settings for form change. Edit at your own risk!

    [b][*]src/roamer.c[/b]
    Settings for roaming Pokémon locations.

    [b][*]src/set_z_effect.c[/b]
    Settings for the species specific special Z-Crystals. Change at your own risk.

    [b][*]src/trainer_sliding.c[/b]
    Defines for trainer sliding messages. Use the Unbound values for inspiration.

    [b][*]src/Tables/back_pic_tables.c[/b]
    Defines to set up tables to switch the player's back sprite and backsprites for multi battles.

    [b][*]src/Tables/ball_graphics_tables.c[/b]
    Settings for PokéBall graphics. If you add new PokéBalls, see CFRU documentation for more details.
    [*]src/Tables/battle_frontier_trainers.c[/b]
    Set up for battle frontier trainers. Look at Unbound and the CFRU documentation for more details.

    [b][*]src/Tables/battle_moves.c[/b]
    Attack data is contained here. If you add new moves, see this file.

    [b][*]src/Tables/battle_tower_spreads.h[/b]
    Sets up EVs, IVs, ability types, items, moves, ball type, etc, for trainers in the battle tower.

    [b][*]src/Tables/class_based_pokeball_table.c[/b]
    Class based PokéBall settings are contained here.

    [b][*]src/Tables/experience_tables.c[/b]
    Allows you to change the base exp of each Pokémon.

    [b][*]src/Tables/frontier_multi_spreads.h[/b]
    Set up battle frontier multi battle partner spreads

    [b][*]src/Tables/frontier_special_trainer_spreads.h[/b]
    Set up spreads for Boss Battles in the battle frontier

    [b][*]src/Tables/frontier_trainer_names.h[/b]
    Battle frontier trainer names contained here.

    [b][*]src/Tables/item_tables.c[/b]
    Edit pickup tables, fling damage, and item effects.
    [*]src/Tables/level_up_learnsets.c[/b]
    If you defined movesets expansion in DPE, ignore this. If not, modify this.

    [b][*]src/Tables/music_tables.c[/b]
    Music for trainer spotting, class based battle music, victory themes and wild encounter themes found here.

    [b][*]src/Tables/pokemon_tables.c[/b]
    Alternate forms, alt sizes, move effects, and battle frontier ban lists, etc. found here.

    [b][*]src/Tables/raid_encounters.c[/b]
    Raid battle encounters and rewards are found here.

    [b][*]src/Tables/raid_partners.h[/b]
    Raid battle partner settings found here.

    [b][*]src/Tables/terrain_tables.c[/b]
    Battle terrain settings are found here. Includes battle backgrounds.

    [b][*]src/Tables/trainers_with_evs_table.h[/b]
    Settings for the trainers that utilize EVs and IVs are found here.

    [b][*]src/Tables/type_tables.h[/b]
    Edit the type effectiveness tables if you wish.

    [b][*]src/Tables/wild_encounter_tables.c[/b]
    Edit morning, evening, and night encounters, as well as swarm encounters.

    [b][*]strings/ability_name_table.string[/b]
    Edits the text for Ability names. Shorten to 12 characters to be able to see them in G3T.

    [b][*]strings/attack_descriptions.string[/b]
    Edit move descriptions here, if you ever wanted to.

    [b][*]strings/attack_name_table.string[/b]
    Edit what the move names will look like in game.

    [b][*]strings/frontier_trainer_names.string[/b]
    How the names defined in frontier_trainer_names.h will appear.

    [b][*]vstrings/frontier_trainer_text.string[/b]
    Text said by battle frontier trainers.

    [b][*]strings/scrolling_multichoice.string[/b]
    Defines the text for scrolling multichoice boxes if you define them. It will break compatibility with vanilla FR. Read CFRU documentation for more details.

    [*][b]strings/trainer_sliding_strings.string[/b]
    Text for trainer sliding messages that were defined is located here.[/LIST][/SPOILER]

    [B][SIZE="5"]Useful links[/SIZE][/B][LIST][*]The official CFRU page on PokéCommunity: [url]https://www.pokecommunity.com/showthread.php?t=425447[/url][*]A video tutorial for the CFRU: [url]https://www.youtube.com/watch?v=6fy04UkkhpM&t[/url][*]Pokémon manipulation in DPE: [url]https://www.dropbox.com/s/q7henr9o8yacvo4/Optional%20Changes%20In%20DPE.rar?dl=0[/url][/LIST]
    [B][SIZE="5"]Closing notes / Credits[/SIZE][/B]
    Hopefully this tutorial may have helped you understand a little bit more on how the CFRU works. This tutorial will be expanded: The coming update in this tutorial will complete the "Setting up the CFRU (second method)" segment and the tutorial will get a good deal of polishing.

    [B]Special thanks to:[/B]
    Skeli and ghoulslash - For CFRU
    Prof. Leon Dias - His ROM base helped me understand a bit more about CFRU; also for the "Optional additions" segment
    PokéMew - Snippets of DevKitPro tutorial
    Lunos - Permission to copy text from his tutorials



    [RIGHT][SIZE="1"][B]This tutorial applies to Windows users only.[/B][/SIZE]
    [SIZE="1"][B]Any specific confusion? Reach out to me on Discord: Spacewalker#8460.[/B][/SIZE]
    [SIZE="1"][B]Do not contact the authors of CFRU and DPE for the sake of this tutorial, since they have no part in this and may rightfully be confused.[/B][/SIZE][/RIGHT]


Closing notes / Credits
Hopefully this tutorial may have helped you understand a little bit more on how the CFRU works. This tutorial will be getting another update soon.

Special thanks to:
Skeli and ghoulslash - For CFRU
PokéMew - Snippets of DevKitPro tutorial
Lunos - Permission to copy text from his tutorials



This tutorial applies to Windows users only.
Any specific confusion? Reach out to me on Discord: Pyxal#4453.
Do not contact the authors of CFRU and DPE for the sake of this tutorial, since they have no part in this and may rightfully be confused.

Gavoca December 16th, 2020 1:00 AM

Great Tut

embers December 16th, 2020 11:05 AM

Just what I needed! Real good timing haha, thanks!

One thing I don't quite get is the order. If you add the CFRU as the last step, you avoid editing any shops, routes, battles, ect. to use new content after you are done with mapping, spriting, ect?

Quite new to this level of customizability and level of editing- since my last "real" attempt at rom-hacking was ~6 years ago.

Pyxal December 16th, 2020 11:34 AM

Quote:

Originally Posted by embers (Post 10246064)
Just what I needed! Real good timing haha, thanks!

One thing I don't quite get is the order. If you add the CFRU as the last step, you avoid editing any shops, routes, battles, ect. to use new content after you are done with mapping, spriting, ect?

Quite new to this level of customizability and level of editing- since my last "real" attempt at rom-hacking was ~6 years ago.

You add it as it is; if I want to use a new flag that is added by CFRU's Save Block expansion, I'll add it normally, insert the CFRU in my ROM, and test on "test.gba".

JesBlackyH January 7th, 2021 9:47 AM

First of all, thx for this tutorial!
Now does it mean that I should start my hack first by making graphics, mapping, etc and then insert the CFRU & DPE last?

And the other thing. If I want to insert the DPE, I just need to insert it and directly inject the CFRU or is there any change that needs to be done before insert CFRU?

Pyxal January 9th, 2021 3:59 AM

Quote:

Originally Posted by JesBlackyH (Post 10257862)
First of all, thx for this tutorial!
Now does it mean that I should start my hack first by making graphics, mapping, etc and then insert the CFRU & DPE last?

Nope, DPE should go with all the mapping/scripting/etc.

Quote:

Originally Posted by JesBlackyH (Post 10257862)
And the other thing. If I want to insert the DPE, I just need to insert it and directly inject the CFRU or is there any change that needs to be done before insert CFRU?

That depends on how you've edited the DPE. Vanilla DPE should work fine.

fireredlugia January 15th, 2021 9:35 AM

Do not ever edit a ROM which has the CFRU inserted in it. My question is in your red highlight, so I normally edit my rom, Pokemon Fire Red (U) (Squirrels) in this base, Map, Sprites Trainer, Scripts, to insert the CFRU in the end.
But how am I going to test the codes that are active through the setvar like dexnav, double battle pokemon en route, etc?
Couldn't you do all the maps, routines and do the script part with the CFRU inserted so that there is no error in the script?

Meister_anon~Master_o f_None January 20th, 2021 11:04 PM

Quote:

Originally Posted by Upsurge (Post 10245662)

The "Complete FireRed Upgrade" Tutorial


RESTART YOUR COMPUTER! Come to the next step after doing that.


The ONE THING missing from all the nearly 10 resources I've gone through to do this, thank-you so much.
I was about ripping my hair out

Pyxal January 21st, 2021 12:08 AM

Quote:

Originally Posted by fireredlugia (Post 10262503)
Do not ever edit a ROM which has the CFRU inserted in it. My question is in your red highlight, so I normally edit my rom, Pokemon Fire Red (U) (Squirrels) in this base, Map, Sprites Trainer, Scripts, to insert the CFRU in the end.
But how am I going to test the codes that are active through the setvar like dexnav, double battle pokemon en route, etc?
Couldn't you do all the maps, routines and do the script part with the CFRU inserted so that there is no error in the script?


As I said above:
Quote:

Originally Posted by Upsurge (Post 10245662)
You add it as it is; if I want to use a new flag that is added by CFRU's Save Block expansion, I'll add it normally, insert the CFRU in my ROM, and test on "test.gba".


DrBackHands January 27th, 2021 7:12 AM

Very nice tutorial! In the future, do you plan on adding stuff regarding the implementation of any specific features to give users a nice taste for how DPE/CFRU work in practice? For my part, I'd love a to see a step-by-step look at Pokemon manipulation via DPE since I'm struggling with that currently. Anyway, good job!

Pyxal February 5th, 2021 9:36 PM

Quote:

Originally Posted by DrBackHands (Post 10268859)
Very nice tutorial! In the future, do you plan on adding stuff regarding the implementation of any specific features to give users a nice taste for how DPE/CFRU work in practice? For my part, I'd love a to see a step-by-step look at Pokemon manipulation via DPE since I'm struggling with that currently. Anyway, good job!

Playing around with the files for some time will give anyone an extensive understanding of how both work. You can view the Optional Additions bit as well.
For PKMN manipulation, however, you can use this (credits to Leon Dias):
https://www.dropbox.com/s/q7henr9o8yacvo4/Optional%20Changes%20In%20DPE.rar?dl=0

Meister_anon~Master_o f_None February 6th, 2021 8:27 PM

5 Attachment(s)
Hey I created a tutorial for editing the dpe evolution table in hex maniac can you add that to your tutorial link list.
I've tested and it works without issue.

Just like the other things you have up, this is an edit that should be done before the cfru patch is applied.

lhw02 February 7th, 2021 3:37 AM

When you get the resultant test.gba file from DPE, do you put it into the CFRU? or do I put the BPRE0.gba file into it?

Mason Shu February 8th, 2021 8:36 PM

Quote:

Originally Posted by lhw02 (Post 10276760)
When you get the resultant test.gba file from DPE, do you put it into the CFRU? or do I put the BPRE0.gba file into it?

Put test.gba in fry and rename it to bpre0, because test.gba is the modified one

Mathv86 February 9th, 2021 3:38 PM

Hello, great tutorial, thank you very much this was a great help to me, but I have a problem because I cannot add pokemons to DPE even with the files you gave.

Meister_anon~Master_o f_None February 11th, 2021 3:47 PM

Quote:

Originally Posted by Mathv86 (Post 10279166)
Hello, great tutorial, thank you very much this was a great help to me, but I have a problem because I cannot add pokemons to DPE even with the files you gave.

You don't add pokemon to DPE it adds the pokemon. The only pokemon that can be added are the ones already listed by that program.
But you shouldn't need to add more as it adds all the way up to gen 7.

But that only puts them into the rom, [b]not[\b] in the game itself, you need to do that with advance map. or some other way.

But to see the new pokemon in advance map you need to expand it first. So open advance map in some hex editor, my preference would be hex maniac advance. Next goto the address 77DD5 (in hex press ctrl g and type 77dd5)

The two bytes there represent the max number of pokemon that program can identify. You need to change that to the reversed hex ID of the last pokemon you want in your rom, based on the ID's listed in the DPE file species.h

The very last pokemon added with dpe is Xerneas Natural form. which is 0x44D

I believe the method for reversing the hex value is known as little indian, but anyway using 0x44D as an example

you would change the bytes at the address 77DD5 to 4D 04

Pretty much you split the hex value into 2s adding a 0 in-front of any single value with out a pair. Then you reverse the order

so 0x44D then becomes 04 4D , finally we reverse it to become 4D 04. and that's what you put in at the address.


After you change that save and close, then open advance map, and go to wild pokemon, when you scroll down you should have all the pokemon that dpe added to chose from.

But remember advance map isn't the only way to add these pokemon, as they are already in the rom. You could probably do so with the C files in cfru or asm also. And if done that way you can have more control over who shows up when. Since most bases applied after dpe add day night and seasons. So you could set different encounter tables for day or night in the same location etc. if you used on of those instead of advance map.

I don't know how to do that yet so I just use advance map for now.

DoctorKoolMan March 8th, 2021 10:24 AM

Thank you very much for the tutorial!

I got it all working and even managed to mess around with a few files in the CFRU to try and understand it and see if the outcomes I expected happened in the compiled rom and they did!

A few questions I have tho. How exactly does this iteration of the DNS function. Is it off of a set start time that ticks even when the game is off - or when its on only? Does it function off the time on the system running the EMU? If there's any sort of documentation on the DNS id love to read up on it more and see if its a right fit for my hack or not. I was interested in making some of my more rare/strong Pokémon appear as overworld encounters with their hidden ability on a specific day.

My biggest concern tho is what order I should be editing my rom. I understand I am not supposed to do any editing to an already compiled rom. So how do I manage to edit trainers and pokemon data. Wouldnt applying the CFRU overwrite any of those changes I make? I know it doesnt mess with map structure or scripts. So I should do all of that work prior to applying the CFRU/DPE.

Meister_anon~Master_o f_None March 8th, 2021 12:14 PM

Quote:

Originally Posted by DoctorKoolMan (Post 10306751)
Thank you very much for the tutorial!

I got it all working and even managed to mess around with a few files in the CFRU to try and understand it and see if the outcomes I expected happened in the compiled rom and they did!

A few questions I have tho. How exactly does this iteration of the DNS function. Is it off of a set start time that ticks even when the game is off - or when its on only? Does it function off the time on the system running the EMU? If there's any sort of documentation on the DNS id love to read up on it more and see if its a right fit for my hack or not. I was interested in making some of my more rare/strong Pokémon appear as overworld encounters with their hidden ability on a specific day.

My biggest concern tho is what order I should be editing my rom. I understand I am not supposed to do any editing to an already compiled rom. So how do I manage to edit trainers and pokemon data. Wouldnt applying the CFRU overwrite any of those changes I make? I know it doesnt mess with map structure or scripts. So I should do all of that work prior to applying the CFRU/DPE.

You'll have to read the dns related C files in cfru for that. I do know that it is based on system clock, like the original handheld games.

And no applying cfru doesn't overwrite any changes you make, unless you put the place it loads the changes to in the make.py file in the scripts folder, where other data already exists.

So just check your rom for free space and put the dpe and cfru changes in places where there isn't data already.


Cfru is a C-injector so its uses methods that of both decomp (editing C files and compiling) and binary hacks (asm, and being able to directly edit with binary programs), you can make changes to your rom with the binary tools after you apply cfru, the reason I assume its recommended not to is some programs no longer work well with the expanded rom.

That said, if its just giving trainers the new pokemon, you can do that with the file created from dpe. But the best way to learn what you should and shouldn't do is just to try it yourself.
Just make a backup file before you try anything.

DoctorKoolMan March 8th, 2021 7:20 PM

Thanks for the reply!

So I can still edit a rom with the hacking tools (I know I must edit the ini) after I have DPE inserted. Just not CFRU?

Visualizing the data im working with in G3T and Hopeless Trainer Editor helps me a lot haha.

The value of CFRU seems unmatched so if I have to do all my data editing in notepad I will xD

JustIChris March 17th, 2021 12:47 PM

^ Ditto to the above question. I'm wondering if you can edit movesets etc after inserting DPE. I can't imagine making half a hack then not being able to modify stats or moves if I made a mistake on a Pokemon lol

Mason Shu March 17th, 2021 4:19 PM

Quote:

Originally Posted by JustIChris (Post 10315694)
^ Ditto to the above question. I'm wondering if you can edit movesets etc after inserting DPE. I can't imagine making half a hack then not being able to modify stats or moves if I made a mistake on a Pokemon lol

You cant, like if you open it on g3t after editing the ini, it’ll still read as glitched movesets

Pyxal March 27th, 2021 10:34 PM

Quote:

Originally Posted by DoctorKoolMan (Post 10306751)
Thank you very much for the tutorial!

I got it all working and even managed to mess around with a few files in the CFRU to try and understand it and see if the outcomes I expected happened in the compiled rom and they did!

A few questions I have tho. How exactly does this iteration of the DNS function. Is it off of a set start time that ticks even when the game is off - or when its on only? Does it function off the time on the system running the EMU? If there's any sort of documentation on the DNS id love to read up on it more and see if its a right fit for my hack or not. I was interested in making some of my more rare/strong Pokémon appear as overworld encounters with their hidden ability on a specific day.

Apologies for the late reply, but you can find a segment for DNS on page 78 in the documentation. For time-based wild encounters, have a look at page 74.


Quote:

My biggest concern tho is what order I should be editing my rom. I understand I am not supposed to do any editing to an already compiled rom. So how do I manage to edit trainers and pokemon data. Wouldnt applying the CFRU overwrite any of those changes I make? I know it doesnt mess with map structure or scripts. So I should do all of that work prior to applying the CFRU/DPE.
You can edit a ROM with the DPE, but not a ROM with the CFRU. CFRU shouldn't touch majority of the stuff you've edited, since it adds more stuff than it edits. But to clear your problems, 1) A lot of tools will be incompatible with CFRU; I suppose you could edit INI's and such, but I haven't tried it and 2) since the CFRU is an extremely heavy insertion; there are many things you can change dynamically like trainer sprites, OW sprites, scripts, region map data, every PKMN learnset, new items etc. In the end, its just a precaution/advice. You could simply insert it and make a game, but that kills the dynamic factor since you can change anything at any point if you want when following the recommended insertion steps in the doc.


Quote:

Originally Posted by JustIChris (Post 10315694)
^ Ditto to the above question. I'm wondering if you can edit movesets etc after inserting DPE. I can't imagine making half a hack then not being able to modify stats or moves if I made a mistake on a Pokemon lol

You can edit the movesets directly through DPE [src/Learnsets.c]. Also remember that you need to update src/Tables/level_up_learnsets.c in CFRU too.

Pyxal April 6th, 2021 1:28 AM

Update #1
The tutorial has been updated with another method for setting up the CFRU. It is still incomplete and needs a lot of clarification. The whole tutorial will get a rundown and polishing in the next update. For now, it's just a step upwards to start working with the CFRU. Next update will hopefully be out in a few days.

OGProfRowan April 7th, 2021 12:30 PM

Hi! Thank you for this. Just for clarification here, do we take a clean version of a FireRed ROM, apply DPE and anything else (for me, I'm considering DS Style Selection Screen + Sideways Stairs), work on the mapping, scripting, etc., and only after we are finished and ready to see/playthrough what we have, apply CFRU and play the test.gba?

Pyxal April 7th, 2021 9:45 PM

Quote:

Originally Posted by OGProfRowan (Post 10332450)
Hi! Thank you for this. Just for clarification here, do we take a clean version of a FireRed ROM, apply DPE and anything else (for me, I'm considering DS Style Selection Screen + Sideways Stairs), work on the mapping, scripting, etc., and only after we are finished and ready to see/playthrough what we have, apply CFRU and play the test.gba?

That is correct.


All times are GMT -8. The time now is 8:08 PM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.