MrDollSteak
Formerly known as 11bayerf1
- 858
- Posts
- 16
- Years
- Age 30
- Hong Kong
- Seen Aug 19, 2023
Move Hacking has come along way recently, especially in the past year.
Karatekid552 and I had at some point started researching Particle effects and the
02 commands. It was also then that Karatekid552 located the Particle and Palette
table. We both believe that the table could be extended, however until now neither
of us had tried. I have since, extended the table and added a new custom particle
and palette entry, and fixed glitches relating to it through ASM.
Just to reiterate all the offsets are for FireRed and Emerald.
Tools Needed:
General Information on the structure of the table:
STEP 1:
STEP 2:
STEP 3:
STEP 4:
STEP 5:
STEP 6:
IMPORTANT EDIT!
There is one more thing to fix, and that is the Shiny Pokemon entry animation!
Otherwise, if a Shiny Pokemon is sent out into battle the game will freeze.
STEP 7:
And there you have it! Custom particles.
I'd once again like to thank Karatekid552 for getting the ball rolling, and for his documentation.
Also credits to HidoranBlaze for finding the relevant Emerald offsets.
Karatekid552 and I had at some point started researching Particle effects and the
02 commands. It was also then that Karatekid552 located the Particle and Palette
table. We both believe that the table could be extended, however until now neither
of us had tried. I have since, extended the table and added a new custom particle
and palette entry, and fixed glitches relating to it through ASM.
Just to reiterate all the offsets are for FireRed and Emerald.
Tools Needed:
Spoiler:
A Hex Editor (I recommend HxD, it's free and amazing)
unLZ-GBA (preferably the hacked one)
Windows Calculator, or any other Calculator that can do sums in Hex.
unLZ-GBA (preferably the hacked one)
Windows Calculator, or any other Calculator that can do sums in Hex.
General Information on the structure of the table:
Spoiler:
The table begins at 0x83ACC08 and ends at 0x83ADE18. This table contains both
the particle and palette information.
The actual particle information goes from 3ACC08 to 3AD50F.
Each particle entry is made up of 8 bytes in this format:
XX YY ZZ 08 (pointer to the particle image at ZZ YY XX) XX YY (size of the particle YY XX) XX 28 (the index, the second byte of which will be 27 or 28, for expansion purposes it will be 28)
The palette information goes from 3AD510 to 3ADE18
Each palette entry is made up of 8 bytes in this format:
XX YY ZZ 08 (pointer to the palette at ZZ YY XX) XX 28 (the corresponding particle index) 00 00 (padding)
the particle and palette information.
The actual particle information goes from 3ACC08 to 3AD50F.
Each particle entry is made up of 8 bytes in this format:
XX YY ZZ 08 (pointer to the particle image at ZZ YY XX) XX YY (size of the particle YY XX) XX 28 (the index, the second byte of which will be 27 or 28, for expansion purposes it will be 28)
The palette information goes from 3AD510 to 3ADE18
Each palette entry is made up of 8 bytes in this format:
XX YY ZZ 08 (pointer to the palette at ZZ YY XX) XX 28 (the corresponding particle index) 00 00 (padding)
STEP 1:
Spoiler:
Using your Hex Editor, goto offset 0x83ACC08 in Fire Red or 0x8524B44 in Emerald and select 1210 blocks (hex).
![[PokeCommunity.com] Adding New Custom Particles [PokeCommunity.com] Adding New Custom Particles](https://i.imgur.com/G9LJZ37.png)
STEP 2:
Spoiler:
Copy the selected area, then find a good free space area to paste it to. Make sure you use Ctrl B (Paste Overwrite) otherwise the Rom will stop working. For this tutorial I'll be using the offset 960000, though you can realistically place it anywhere you want with realistically about 1300 bytes of free space.
![[PokeCommunity.com] Adding New Custom Particles [PokeCommunity.com] Adding New Custom Particles](https://i.imgur.com/AWNp2cA.png)
![[PokeCommunity.com] Adding New Custom Particles [PokeCommunity.com] Adding New Custom Particles](https://i.imgur.com/mRcGvgv.png)
STEP 3:
Spoiler:
Now you'll have to change all the pointers to the original offset for those of your current offset. A pointer is laid out in the structure XX YY ZZ 08, wherein XX YY ZZ 08 would point to ZZ YY XX 08. Using the original offset 3ACC08 for Fire Red, the pointer would be 08 CC 3A 08. For the new offset 960000, our pointer would be 00 00 96 08. Navigate to the start of the rom and click Ctrl r (replace). Search for 08 CC 3A 08 in Fire Red or 44 4B 52 08 in Emerald and replace with 00 00 96 08 and click replace all (make sure hex values is selected). There should only be two instances of this pointer located in the 0x8072000 area for Fire Red (this is where the loading routine is located).
![[PokeCommunity.com] Adding New Custom Particles [PokeCommunity.com] Adding New Custom Particles](https://i.imgur.com/DiZYm5M.png)
STEP 4:
Spoiler:
This is the part in which we add new particles. You will need to make the majority of these yourselves, as I make them I'll be sharing them with the community. For the purposes of this tutorial I've attached the image for Wood particles.
Open up unLZ-GBA. Import your image (make sure it's indexed), and click write to rom. Make sure only 'Export Image' is selected. Type in your desired offset into the image box, for the purposes of this tutorial I'll be using 940000, and click OK.
After doing that navigate to that offset in your Hex Editor and scroll through until you reach free space again, make a note of that offset.
Return to unLZ and once again click write to rom, this time however make sure only 'Export Palette' is selected, then type the offset you just got into the palette box.
Open up unLZ-GBA. Import your image (make sure it's indexed), and click write to rom. Make sure only 'Export Image' is selected. Type in your desired offset into the image box, for the purposes of this tutorial I'll be using 940000, and click OK.
![[PokeCommunity.com] Adding New Custom Particles [PokeCommunity.com] Adding New Custom Particles](https://i.imgur.com/nkbxT6e.png)
After doing that navigate to that offset in your Hex Editor and scroll through until you reach free space again, make a note of that offset.
![[PokeCommunity.com] Adding New Custom Particles [PokeCommunity.com] Adding New Custom Particles](https://i.imgur.com/ifsdWMm.png)
Return to unLZ and once again click write to rom, this time however make sure only 'Export Palette' is selected, then type the offset you just got into the palette box.
![[PokeCommunity.com] Adding New Custom Particles [PokeCommunity.com] Adding New Custom Particles](https://i.imgur.com/orO5kuc.png)
STEP 5:
Spoiler:
Now that the particles are in the rom, we have to add them to the table. Unlike other expanded tables, the particle and palette information are part of the same table. As such we can't just add the entries to the end of the table. What we have to do first is navigate to the start of the palette information, now at 960908, and then select the rest of the table, this can be done easily by just selecting 1000 bytes (hex).
Now copy the data and paste it 8 bytes after where it originally was, in this case that would be 960910.
Now at 960908 we have to add our particle entry. As mentioned before the data is set up as a pointer, the size and then the index. First write the pointer to your image, in this case 00 00 94 08.
The size is equal to half the area of the image. eg. Our image is 32x192, which is equal to 1800 in hex. As such, our size would be half of 1800, which is 0C00, so we'd write 00 0C. Finally we'd choose our index number. The last used one in the rom is 30 28, as such anything up from there is available to be used.
Now we just need to add our palette information. This is thankfully easier, just navigate to the end of the table, this can be done easily by searching for FF bytes. If using the offsets of this tutorial it should now be 961218. As mentioned before the palette information is listed in this structure, pointer to the offset of the palette, index number, filler bytes. First write the pointer to your palette, in this A8 04 94 08, follow it up with the same index number you used for the particle in this case 31 28, and then add 00 00.
Congratulations! You've set up your first particle.
Note: For future entries, you will have to repeat the procedure, by constantly moving the palette part of the table back to allow space for entries. It is not particularly convenient, but it's not too difficult either.
![[PokeCommunity.com] Adding New Custom Particles [PokeCommunity.com] Adding New Custom Particles](https://i.imgur.com/2ZWtPwc.png)
Now copy the data and paste it 8 bytes after where it originally was, in this case that would be 960910.
![[PokeCommunity.com] Adding New Custom Particles [PokeCommunity.com] Adding New Custom Particles](https://i.imgur.com/2JvfsyG.png)
Now at 960908 we have to add our particle entry. As mentioned before the data is set up as a pointer, the size and then the index. First write the pointer to your image, in this case 00 00 94 08.
The size is equal to half the area of the image. eg. Our image is 32x192, which is equal to 1800 in hex. As such, our size would be half of 1800, which is 0C00, so we'd write 00 0C. Finally we'd choose our index number. The last used one in the rom is 30 28, as such anything up from there is available to be used.
![[PokeCommunity.com] Adding New Custom Particles [PokeCommunity.com] Adding New Custom Particles](https://i.imgur.com/8Dnof3p.png)
Now we just need to add our palette information. This is thankfully easier, just navigate to the end of the table, this can be done easily by searching for FF bytes. If using the offsets of this tutorial it should now be 961218. As mentioned before the palette information is listed in this structure, pointer to the offset of the palette, index number, filler bytes. First write the pointer to your palette, in this A8 04 94 08, follow it up with the same index number you used for the particle in this case 31 28, and then add 00 00.
![[PokeCommunity.com] Adding New Custom Particles [PokeCommunity.com] Adding New Custom Particles](https://i.imgur.com/7cmpAzL.png)
Congratulations! You've set up your first particle.
Note: For future entries, you will have to repeat the procedure, by constantly moving the palette part of the table back to allow space for entries. It is not particularly convenient, but it's not too difficult either.
STEP 6:
Spoiler:
You may now think, great I have fully working new particles. Well that's not entirely true, first we have to alter the loading routine. If you do not, the moves will just freeze, or the rom will restart, as they will not be able to load the proper information. Luckily its easily fixed by changing a few pointers.
Navigate to the offset 0x80728B7 in Fire Red or 0x80A3D74 in Emerald, you should see two pointers. These are the pointers used in the particle loading routine and the palette loading routine respectively. The reason for this being, that the loading routine takes these offsets and then adds a variable number dependent upon the particle being used in the routine to this offset to reach the relevant area of the table.
We'll have to change these two pointers, so they now properly go to the 960000 area. As such we're going to have to start doing some calculations, so open up Windows Calculator (or an alternative) and access programming mode (alt+3). Subtract the offset of the first pointer (399388) from the original start of the table (3ACC08). You should get the number 13880.
Now substract that number from the offset in which you repointed the table to, and you'll have the offset to change the first pointer at 728B7 to. If using this tutorial, you should get the offset 94C780, and as such, the pointer 80 C7 94 08. Then change the pointer.
The palette pointer is done in more or less the same way. Because we already know the variable number (13880) that is added to both pointers, we can simply substract 13880 from the current start of the palette information, which if you've been using the same offsets will be located at 960910. You should get the offset 94D090, and as such the pointer 90 D0 94 08. Then change the pointer.
Something key to note though. Is that for every new particle you add to the table, you will have to add a value of 0x8 to the palette loading pointer. Eg. If you added an extra particle to the one already added, it would become 98 D0 94 08. You will not need to do this for the particle loading pointer.
Navigate to the offset 0x80728B7 in Fire Red or 0x80A3D74 in Emerald, you should see two pointers. These are the pointers used in the particle loading routine and the palette loading routine respectively. The reason for this being, that the loading routine takes these offsets and then adds a variable number dependent upon the particle being used in the routine to this offset to reach the relevant area of the table.
![[PokeCommunity.com] Adding New Custom Particles [PokeCommunity.com] Adding New Custom Particles](https://i.imgur.com/nExDskZ.png)
We'll have to change these two pointers, so they now properly go to the 960000 area. As such we're going to have to start doing some calculations, so open up Windows Calculator (or an alternative) and access programming mode (alt+3). Subtract the offset of the first pointer (399388) from the original start of the table (3ACC08). You should get the number 13880.
![[PokeCommunity.com] Adding New Custom Particles [PokeCommunity.com] Adding New Custom Particles](https://i.imgur.com/wCgIuB9.png)
Now substract that number from the offset in which you repointed the table to, and you'll have the offset to change the first pointer at 728B7 to. If using this tutorial, you should get the offset 94C780, and as such, the pointer 80 C7 94 08. Then change the pointer.
![[PokeCommunity.com] Adding New Custom Particles [PokeCommunity.com] Adding New Custom Particles](https://i.imgur.com/CB6ocTF.png)
![[PokeCommunity.com] Adding New Custom Particles [PokeCommunity.com] Adding New Custom Particles](https://i.imgur.com/HCrKqMt.png)
The palette pointer is done in more or less the same way. Because we already know the variable number (13880) that is added to both pointers, we can simply substract 13880 from the current start of the palette information, which if you've been using the same offsets will be located at 960910. You should get the offset 94D090, and as such the pointer 90 D0 94 08. Then change the pointer.
Something key to note though. Is that for every new particle you add to the table, you will have to add a value of 0x8 to the palette loading pointer. Eg. If you added an extra particle to the one already added, it would become 98 D0 94 08. You will not need to do this for the particle loading pointer.
![[PokeCommunity.com] Adding New Custom Particles [PokeCommunity.com] Adding New Custom Particles](https://i.imgur.com/8dHCErt.png)
IMPORTANT EDIT!
There is one more thing to fix, and that is the Shiny Pokemon entry animation!
Otherwise, if a Shiny Pokemon is sent out into battle the game will freeze.
STEP 7:
Spoiler:
Navigate in your hex editor to 0x80F17E8 in Fire Red or 0x8172FB8 in Emerald, you should see two pointers.
Change the first pointer from what it is to the pointer to the new offset of
the F9 27 particle, which if you followed this tutorial is 960748, for those who
did not use the same offsets, you can easily find it by searching for this string
38 87 D2 08 C0 00 F9 27.
The second pointer is the palette, so just change the pointer to the new offset
of the F9 27 palette. Because each time you extend the table the palette will
change, you'll have to add 8 to this pointer everytime you add a new particle.
To find it search for this string BC 87 D2 08 F9 27 00 00.
Change the first pointer from what it is to the pointer to the new offset of
the F9 27 particle, which if you followed this tutorial is 960748, for those who
did not use the same offsets, you can easily find it by searching for this string
38 87 D2 08 C0 00 F9 27.
The second pointer is the palette, so just change the pointer to the new offset
of the F9 27 palette. Because each time you extend the table the palette will
change, you'll have to add 8 to this pointer everytime you add a new particle.
To find it search for this string BC 87 D2 08 F9 27 00 00.
And there you have it! Custom particles.
![[PokeCommunity.com] Adding New Custom Particles [PokeCommunity.com] Adding New Custom Particles](https://i.imgur.com/Nb61CPT.png)
![[PokeCommunity.com] Adding New Custom Particles [PokeCommunity.com] Adding New Custom Particles](https://i.imgur.com/sVpGzes.png)
I'd once again like to thank Karatekid552 for getting the ball rolling, and for his documentation.
Also credits to HidoranBlaze for finding the relevant Emerald offsets.
Last edited: