• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Pyxal's Complete FireRed Upgrade Guidebook

993
Posts
4
Years
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:

Second Method:
Spoiler:

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.
    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.
    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.
    offset-1-to-offset-2.png


  • Copy this data and paste it at Offset 1 in ROM 1.
    offset-1-in-rom-1.png


  • At 0x148 place a pointer to Offset 1.
    pointer-0x148.png


  • ROM 2 has no more use so feel free to delete it.
  • [a id]adds1[/a id][a id]adds2[/a id]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:
[a id]confuz[/a id]

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:
image0.jpg
[a id]ilazy[/a id]


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 (pyxal).


Additional Tutorials

Graphics manipulation (in CFRU):
Spoiler:


Scripting (in CFRU):
Spoiler:


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:


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.
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.
736651762504827000-1.gif
 
Last edited:

embers

IonGlue
1
Posts
13
Years
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.
 
993
Posts
4
Years
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".
 
3
Posts
6
Years
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?
 
993
Posts
4
Years
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.

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.
 
12
Posts
8
Years
  • Age 39
  • Seen Jul 10, 2023
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?
 
993
Posts
4
Years
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:
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".
 
11
Posts
10
Years
  • Age 32
  • Seen Oct 5, 2023
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!
 
993
Posts
4
Years
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 Changes In DPE.rar?dl=0
 
853
Posts
3
Years
  • Age 33
  • Seen Nov 9, 2023
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.
 

Attachments

  • Screenshot (617).png
    Screenshot (617).png
    43.9 KB · Views: 69
  • Screenshot (618).png
    Screenshot (618).png
    43.2 KB · Views: 47
  • Screenshot (619).png
    Screenshot (619).png
    17.9 KB · Views: 35
  • Screenshot (620).png
    Screenshot (620).png
    21.5 KB · Views: 37
  • Screenshot (621).png
    Screenshot (621).png
    36.1 KB · Views: 34
7
Posts
3
Years
  • Age 21
  • Seen May 31, 2021
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?
 
391
Posts
3
Years
  • Age 19
  • Seen Nov 24, 2023
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
 
2
Posts
4
Years
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.
 
853
Posts
3
Years
  • Age 33
  • Seen Nov 9, 2023
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, 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.
 
Last edited:
36
Posts
8
Years
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.
 
853
Posts
3
Years
  • Age 33
  • Seen Nov 9, 2023
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.
 
36
Posts
8
Years
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
 
40
Posts
6
Years
^ 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
 
Back
Top