- 52
- Posts
- 15
- Years
- Seen Apr 26, 2025
Hello!
While trying to make my own hack, I ran out of trainer slots. (Yes, all 743 trainer slots. That's a lot.)
So I started looking for an answer to that here. But my searches turned up empty. Not one to be deterred, I kept working at it until I found my solution. And after rigorous testing to make sure it worked, I have decided to share how I did it.
DISCLAIMERS
1.While this is for FireRed, it can absolutely be done in Emerald, the offsets will be different, however.
2.As always, BACKUP BACKUP BACKUP. Do not complain to me I screwed up your ROM.
3. Every number I will be mentioning is in hex unless otherwise specified. so if I say 0x50, I don't mean 50. I mean 80.
Step One
So first thing's first, you're going to need a hex editor. (I personally like HxD, but to each their own)
You're also going to need Free Space Finder.
Navigate to 0x823EAC8
This is where the Trainer Table starts. It is 0x7418 bytes in length. So you're going to want to select it all.
If you don't end at 0x8245EE0, you've selected the wrong amount.
Now we are going to move the table. So open up Free Space Finder. Here's where we have to do a bit of math.
So the table is the exact size of 29,720 bytes. (<---This isn't hex)
Each trainer requires 40 more bytes. (Again not hex.)
So to figure out how much space you need, we need to do the following:
29720 + (# of new trainers * 40) = Free Space Needed
For my own hack, I added 257 trainers just to make it an even 1000. So...
29720 + (257 * 40) = 40,000
So in Free Space Finder, I would enter 40,000.
The offset it gives you is important, write it down, we'll need it.
Now copy the old trainer table to the new offset FSF has given you.
(At this stage, you can replace all the values at the original trainer table location with FFs to free up space, as this is a lot of space we're taking up already and you won't need the old table anyway.)
Step Two
Now, at the end of the new table, is just a bunch of FFs. This WOULD be fine, if it were not for the fact that at the end of each trainer's 0x28 bytes long section is an offset pointing to a place in the ROM. So if you opened up a trainer editor and it tried to look for FF FF FF FF, it would produce an error because that is outside the ROM area. So these all have to be changed to 00.
I created 257 trainers, so 257 * 0x28 (<--- Doing hex again) is 10,280 bytes. Converting THAT to hex, is 0x2828. So I need to select 0x2828 of the FF, and change them to 00.
Step Three
Now you have to go to 0x800FC00.
This is the offset that points to the location of the trainer table.
The value should be C8 EA 23 08. Which means it's still pointing to 0x823EAC8, the original trainer table.
We are going to change it to the starting location of our new trainer table.
For example, I placed mine at 0x8855DC0, so I enter C0 5D 85 08.
Step Four
The next step (Props to SBird for pointing this out) is to change where the trainer flags start so as not to overlap with existing game flags.
Now if you want to have over 1,000 trainers, then you will have to tweak the table SBird left in the comments below to your needs. (The values need to change, not the offsets)
You will also need to expand the number of 'safe flags'. There is a tutorial on doing so HERE, I recommend doing this first before continuing.
Now that we've taken care of that, and if you're doing 1,000 like myself, the steps are as follows:
At 0x8080382, replace A0 21 with 80 21.
At 0x80800BA, replace A0 22 D2 00 with 80 22 52 01.
At 0x8080428, replace A0 21 with 80 21.
At 0x8080440, replace A0 21 with 80 21.
At 0x8080454, replace A0 21 C9 04 with 80 21 49 05.
You can now save and close your Hex Editor.
Step Five
The last step is to go to your trainer editor's folder. There should be an .ini file. I use Hopeless Trainer Editor, but this should apply to A-Trainer as well.
Inside should be a line with "NumberOfTrainers". (It may be called something else in A-Trainer)
Change the value to the amount of trainers + the amount you added. So for me, it was 1000. (<---Not Hex!)
And that should be it!
You should be able to open your trainer editor and have new trainers at the end of the list.
While trying to make my own hack, I ran out of trainer slots. (Yes, all 743 trainer slots. That's a lot.)
So I started looking for an answer to that here. But my searches turned up empty. Not one to be deterred, I kept working at it until I found my solution. And after rigorous testing to make sure it worked, I have decided to share how I did it.
DISCLAIMERS
1.While this is for FireRed, it can absolutely be done in Emerald, the offsets will be different, however.
2.As always, BACKUP BACKUP BACKUP. Do not complain to me I screwed up your ROM.
3. Every number I will be mentioning is in hex unless otherwise specified. so if I say 0x50, I don't mean 50. I mean 80.
Step One
So first thing's first, you're going to need a hex editor. (I personally like HxD, but to each their own)
You're also going to need Free Space Finder.
Navigate to 0x823EAC8
This is where the Trainer Table starts. It is 0x7418 bytes in length. So you're going to want to select it all.
If you don't end at 0x8245EE0, you've selected the wrong amount.
Now we are going to move the table. So open up Free Space Finder. Here's where we have to do a bit of math.
So the table is the exact size of 29,720 bytes. (<---This isn't hex)
Each trainer requires 40 more bytes. (Again not hex.)
So to figure out how much space you need, we need to do the following:
29720 + (# of new trainers * 40) = Free Space Needed
For my own hack, I added 257 trainers just to make it an even 1000. So...
29720 + (257 * 40) = 40,000
So in Free Space Finder, I would enter 40,000.
The offset it gives you is important, write it down, we'll need it.
Now copy the old trainer table to the new offset FSF has given you.
(At this stage, you can replace all the values at the original trainer table location with FFs to free up space, as this is a lot of space we're taking up already and you won't need the old table anyway.)
Step Two
Now, at the end of the new table, is just a bunch of FFs. This WOULD be fine, if it were not for the fact that at the end of each trainer's 0x28 bytes long section is an offset pointing to a place in the ROM. So if you opened up a trainer editor and it tried to look for FF FF FF FF, it would produce an error because that is outside the ROM area. So these all have to be changed to 00.
I created 257 trainers, so 257 * 0x28 (<--- Doing hex again) is 10,280 bytes. Converting THAT to hex, is 0x2828. So I need to select 0x2828 of the FF, and change them to 00.
Step Three
Now you have to go to 0x800FC00.
This is the offset that points to the location of the trainer table.
The value should be C8 EA 23 08. Which means it's still pointing to 0x823EAC8, the original trainer table.
We are going to change it to the starting location of our new trainer table.
For example, I placed mine at 0x8855DC0, so I enter C0 5D 85 08.
Step Four
The next step (Props to SBird for pointing this out) is to change where the trainer flags start so as not to overlap with existing game flags.
Now if you want to have over 1,000 trainers, then you will have to tweak the table SBird left in the comments below to your needs. (The values need to change, not the offsets)
You will also need to expand the number of 'safe flags'. There is a tutorial on doing so HERE, I recommend doing this first before continuing.
Now that we've taken care of that, and if you're doing 1,000 like myself, the steps are as follows:
At 0x8080382, replace A0 21 with 80 21.
At 0x80800BA, replace A0 22 D2 00 with 80 22 52 01.
At 0x8080428, replace A0 21 with 80 21.
At 0x8080440, replace A0 21 with 80 21.
At 0x8080454, replace A0 21 C9 04 with 80 21 49 05.
You can now save and close your Hex Editor.
Step Five
The last step is to go to your trainer editor's folder. There should be an .ini file. I use Hopeless Trainer Editor, but this should apply to A-Trainer as well.
Inside should be a line with "NumberOfTrainers". (It may be called something else in A-Trainer)
Change the value to the amount of trainers + the amount you added. So for me, it was 1000. (<---Not Hex!)
And that should be it!
You should be able to open your trainer editor and have new trainers at the end of the list.
Last edited: