This is my first tutorial, and I want to make it as simple as possible and easy to follow. Thanks to JPAN for his hacked engine and metapod23 for his overworld tutorial which helped me understand everything better.
Tools needed for this tutorial:
Pokemon Fire Red Rom (Unmodified and modified) Pokemon Fire Red Hacked Engine
Hex Editor – I will be using Translhextion.
Free Space Finder
Overworld Editor: Rebirth Edition
Nameless Sprite Editor (I will be using classic) Lunar IPS
(For HackMew's Tools, I suggest downloading PGE)
As JPAN states in his guide, a palette pointer consists of PPPPPPPP nn110000, with P = palette pointer and n = palette number. For example, if I wanted to write a pointer to a palette located at 0x800000 with a palette number of 32, I would use this.
00008008 20110000
When typing pointers, you need to break the original address into three blocks of two and rearrange them like so. 80 00 00 -> 00 00 80 80. You had the 80 because it is located within the rom.
20 is actually 32 in hex, so make sure you convert. I would use the calculator that came with your computer.
Step 3 – Finding the free space needed
Spoiler:
In the JPAN rom, the palette table is located at 0x1A2400, giving you room for 256 pointers, so that should be enough.
Each palette takes up 64 bytes. So multiply 64 by the number of palettes you will be inserting.
EX. 64 * 12 = 768
You would need 768 bytes of free space to insert 12 new palettes. But for simplicity, I will be adding 1 so I need 64 bytes of free space.
I will be using 0x800000.
Step 4 – Editing Palette
Spoiler:
Now my way is a sort of a hassle, so if anyone knows an easier way, please tell me.
Open your unmodified rom in NSE. Then edit a palette to your liking.
I just edit the palette of the hero, as it is the first sprite. Once you’re done we can finally move into Hex! Take note that the palette offset is at $H35B968 or x35B968.
Step 5 – Hex editing
Spoiler:
Remember that offset we found for free space, well were going to use it! Open you modified rom into a hex editor and navigate to 0x1A2400.
Go to the end of the table and insert your pointer before the 00000000 FF110000 as shown. I just rewrote the ending afterwards. Make sure your table ends with that or else in will NOT work at all.
Save.
Now open your unmodified rom in a hex editor. Navigate to the palette offset and copy 64 bytes.
Go back to your hex editor with the modified rom and navigate to 0x800000 and paste the data.
Save.
Success!
Step 6 – Editing the sprites.
Spoiler:
Say you wanted to edit the male hero from Ruby’s sprite. See what he sprite offsett is in NSE and write it down. 0x3A3C64
Go to that address in the modified rom. The palette number is the third byte over. So change that to a 20.
Save!
Now open your Overworld Editor Rebirth sprites.ini file. Go down to the English Fire red and change the SpritePaletteHeader pointer to 1A2400.
Save.
Open the rom in Overworld Editor Rebirth and go to Ruby hero sprite. As you can see, the palette number is now 32. Edit away. Im just inserting the male Fire Red hero since it will look nice.
Step 7 – Fixing a glitch!
Spoiler:
Follow these instructions to make it work.
Quote:
That is a problem I didn't encounter until mentioned, as I always tested with OW palette 0 and A (no reason why, though, just happened). As such, I didn't know about the "forced load" on start that only happens once per map. This should fix it.
Using a hex editor, replace the following values
starting at 0x0805E5E0, place 70 88 09 07 09 0f 00 29 01 d0 05 e0,
then at 0x0805e5f8 place 03 e0
Also, another "problem" arises from the mist weather. palette slot 0x1, 0x6 to 0x9 and 0xb are reserved for the mist weather effect. If you don't plan on using it on your hack, and need the extra palettes, you can use them after disabling the effect.
at 0x0805f680 place 22 e0 (for palette slots 0x6-0x9 + 0xb),
at 0x0805f60c place 20 e0 (for palette slot 0x1, the player mist slot).
If you wish to have the player enter misty areas, do not apply the last one.
As a side note, the offset you should use is whatever the offset is but drop the 0x08. Sorry for the confusion. For example; 0x5E5E0.
And now you are done! Here is the finished product.
If you have any questions, have suggestions about thread cleanliness, or this tutorial is unclear, be sure to say something! I hope I was able to help!
__________________
I laugh looking at this.
But sometimes I want to come back to it...
Last edited by Quickster; February 9th, 2013 at 04:01 AM.
yeah, it works without any problems. Good tutorial. It´s extrem easy to understand it.
Currently I have inserted 70 new palettes and the rom is working without any problems.
Also, I guess I should say everyone should keep in mind the sixteen palette slots restriction in mind.
Well this is a problem because you can´t have the OWs in the same Map. You can see that sometimes it load the right palette and sometimes the wrong. So I have to search how I can fix it. If there is a person who no how I can fix it please send me a PM.
I don´t know if the slots which loads the palettes can be expand or is there a hardware limit. I think there is a limit and this limit is 16. So you can´t load more palettes at the same time.
Nice tutorial.
I will try this out without applieing JPANS engines too.
Well I tried this and it doesn´t work. I have made some mistakes. But you have to do the same things as you can see in JPANS engine. I mean you have to do the same things with the pointers, etc. All things JPAN have done in his engine with the OWs data and palettes, you must do, too.
@Cheve_X: Yes, I know it. But how can I use the palettes on the left side, which aren´t from any tileset? Or how can I use the last three slots on the right side. I have had a look on this with the VBA. I saw that there are only used 13 from 16 palettes. So it must be easier to use this last 3 palettes than using the last palettes from the tilesets. But how can I hack this? How can I use this "free slots"?
Sorry for bad English!
Maybe there you can find a solution for insert the palettes without any problems. http://nocash.emubase.de/gbatek.htm
It´s a problem to load more than 16 palettes for the sprites. And how I understand it after read it is it impossible because of the hardware....
__________________
Temporarily not available
Last edited by Hackrex; March 18th, 2012 at 06:36 PM.
this best tutorial on Fire Red,and on emerald such it is possible to make?
Well Im sure it is, but I dont know how pesonally. If JPAN didnt do anything other than repoint the table in Fire Red, than it could be that simple. But I dont know what else he did.
He did just repoint it, I tried repointing the table without the hacked engine and this method works.
The orginal palette table is located at 0x3A5158 in FireRed and the pointers to the table that you need to change are at 0x5F4D8, 0x5F570 and 0x5F5C8 for those whom it may interest.
I would like to know the sprite offsets for the Fly sprites.
Well it seems they're not part of the OW sprite table... I'd like to know how I can repoint their palettes though. :\
Seems I didn't need to. Do they just use the current hero OW palette loaded into the RAM?
Last edited by Noririn; April 16th, 2012 at 11:09 PM.
Quickster, this is an amazing tutorial but one thing I can't seem to do is actual apply it in to Advance Map. It would just appear as the original palette. I would use the emerald male hero as an example. Everything works, it shows up in Overworld Editor rebirth as the new palette but when I put it in advanced map it would show up as palette 0x06 and not 0x32. In NSE it doesn't work either that it can't load the new palette.
Quickster, this is an amazing tutorial but one thing I can't seem to do is actual apply it in to Advance Map. It would just appear as the original palette. I would use the emerald male hero as an example. Everything works, it shows up in Overworld Editor rebirth as the new palette but when I put it in advanced map it would show up as palette 0x06 and not 0x32. In NSE it doesn't work either that it can't load the new palette.
You have to change the INI in NSE or OWE for it to show the new palettes (to the new palette table that JPAN made in his patch). Also, it won't show in A-map, but it will show in game. You have to change the OW's palette number in a hex editor though, to change it in the first place.
Also, it won't show in A-map, but it will show in game. You have to change the OW's palette number in a hex editor though, to change it in the first place.
I know you probably don't want to say how but where could I find out how to do that, like point me to a certain forum here or somewhere else.
I know you probably don't want to say how but where could I find out how to do that, like point me to a certain forum here or somewhere else.
Thank you.
Open up NSE Classic, go to the sprite you want to change the palette number of. Make sure "Advanced" mode is on.
Then you want to find the "Sprite Offset:" Go to that offset in your hex editor.
Ripped from Metapod 23's thread
Here is what the hero's first overworld data looks like
and is broken down like this (courtesy of GBChacker's post):
Code:
FFFF = Starter Byte
00 = Palette Number
11 02 11 = Sprite validation.
0200 = This is equal to the second 4 numbers in the Frame Data Pointer; this is the size of each frame
0010 = Width
0020 = Height
0110 and 0000 = oam data. Do not modify!
1@ 10373A08 = Points to @3.
2@ 9C373A08 = Void pointer\ unsure.
3@ 70343A08 = A pointer to @5 lol.
4@ A0003A08 = Sprite Pointer
5@ FC1C2308 = Pointer to pointers which point to code that loads the sprite through the ewram into the sprite block of the vram and its data into the oam.
I bolded the parts you are interested in. Do not forget to put the number in hex and not decimal.
Open up NSE Classic, go to the sprite you want to change the palette number of. Make sure "Advanced" mode is on.
Then you want to find the "Sprite Offset:" Go to that offset in your hex editor.
Ripped from Metapod 23's thread
Here is what the hero's first overworld data looks like
and is broken down like this (courtesy of GBChacker's post):
Code:
FFFF = Starter Byte
00 = Palette Number
11 02 11 = Sprite validation.
0200 = This is equal to the second 4 numbers in the Frame Data Pointer; this is the size of each frame
0010 = Width
0020 = Height
0110 and 0000 = oam data. Do not modify!
1@ 10373A08 = Points to @3.
2@ 9C373A08 = Void pointer\ unsure.
3@ 70343A08 = A pointer to @5 lol.
4@ A0003A08 = Sprite Pointer
5@ FC1C2308 = Pointer to pointers which point to code that loads the sprite through the ewram into the sprite block of the vram and its data into the oam.
I bolded the parts you are interested in. Do not forget to put the number in hex and not decimal.
Thank you for explaining that. I didnt go into as much depth, but I explained the basics of how to do it under Step 6.
For some reason it works with the hero of fire red but it wont work with the hero from emerald. in the picture i didnt edit the fire red hero's palette but as you can see the emerald hero is messed up
Is there a fix to the bug where if you go to another screen (most menus in the bag, battles, etc.) and then return to the map the palette reverts to one of the original palettes?
Is there a fix to the bug where if you go to another screen (most menus in the bag, battles, etc.) and then return to the map the palette reverts to one of the original palettes?
As long as the hero palette is located in the first slot (slot 0), and no other palette overwrites that slot, that should never happen.
In your hex editor, this number is what palette slot the palette takes up.
Oh, it's not the overworld for the player but a separate overworld, and the slot that is stays in gets rewritten with the original palette in that slot everytime the map is loaded (exiting menus etc)
Oh, it's not the overworld for the player but a separate overworld, and the slot that is stays in gets rewritten with the original palette in that slot everytime the map is loaded (exiting menus etc)
I know this reply is a bit late, but I tried looking into it some. I found that when you have the palette slot set as A-F, the palette refreshes fine, and, as far as I can tell, nothing is messed up.. Ill see if I can find anything else on the matter.
Quote:
Originally Posted by theRiolvile
I want to put DP overworld sprites but i don't know how it show when I reseized it show only the upper part
I dont remember much about resizing, so Ill look into this a bit more also.