PDA

View Full Version : [Tutorial] New palettes in Fire Red for OW's!


Quickster
March 4th, 2012, 10:06 AM
Creating new Overworld palettes in Fire Red!
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 (http://www.pokecommunity.com/showthread.php?t=194241)
Hex Editor – I will be using Translhextion.
Free Space Finder
Overworld Editor: Rebirth Edition
Nameless Sprite Editor (I will be using classic)
Lunar IPS (http://www.romhacking.net/utilities/240/)
(For HackMew's Tools, I suggest downloading PGE (http://www.pokecommunity.com/showthread.php?t=265635))

I also suggest having a backup of your rom.

Step 1-Applying the hacked engine.
If you’re reading this, I hope you know how to do this. If not, click here http://www.pokecommunity.com/showthread.php?t=73966 and look at the alternate method of working with patches.

Step 2 – Understanding the data.
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
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.
http://i41.tinypic.com/a495xf.png
I will be using 0x800000.

Step 4 – Editing Palette
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.
http://i39.tinypic.com/24zkk7b.png
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
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.
http://i44.tinypic.com/33ymbyh.png

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.
http://i44.tinypic.com/1zr1jkg.png

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.
http://i40.tinypic.com/2py9ens.png
Save.

Success!

Step 6 – Editing the sprites.
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.
http://i42.tinypic.com/wjiafq.png

Save!

Now open your Overworld Editor Rebirth sprites.ini file. Go down to the English Fire red and change the SpritePaletteHeader pointer to 1A2400.
http://i40.tinypic.com/ev3x8k.png
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.
http://i44.tinypic.com/fnafpg.png


Step 7 – Fixing a glitch!
Follow these instructions to make it work.


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.
http://i43.tinypic.com/15vuwp.png



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!

Hackrex
March 6th, 2012, 06:54 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.

Crimson5M
March 10th, 2012, 01:59 PM
Hmm...I'm thinking this could maybe be abused by giving extra palettes to small tiles B]
Anyway, good tutorial, I'll try it when I get the time. :)

itari
March 10th, 2012, 03:29 PM
This tutorial is actually quite useful. Thanks for sharing the information!

Quickster
March 10th, 2012, 07:35 PM
Hmm...I'm thinking this could maybe be abused by giving extra palettes to small tiles B]

Ooh, that actually sounds quite interesting.

Anyway, good tutorial, I'll try it when I get the time. :)

This tutorial is actually quite useful. Thanks for sharing the information!

Thanks!

Also, I guess I should say everyone should keep in mind the sixteen palette slots restriction in mind.

Hackrex
March 11th, 2012, 01:09 AM
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.

~Anbuja
March 11th, 2012, 03:05 AM
Nice tutorial.
I will try this out without applieing JPANS engines too.

Cheve_X
March 11th, 2012, 07:59 AM
Hi! Great Tutorial! Its a very useful Thing!

Now, the Hardware supports (16*16) *2 In Total, But, For Minisprites use one Part (16*16) and it have some Palets of Tiles Too.

For Better Understand of Wath i means, Open Any .gba Rom with VBA and Go to "Tools > Pallete Viewer" The Right Part Its Used By Ow's ^^

Sorry for My English x'D

Have a Nice Day :P

Hackrex
March 12th, 2012, 09:29 AM
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....

dark-96
March 19th, 2012, 06:37 PM
this best tutorial on Fire Red,and on emerald such it is possible to make?

Quickster
March 20th, 2012, 03:01 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.

dark-96
March 20th, 2012, 07:02 PM
This tut. remains the best

Noririn
April 16th, 2012, 12:02 PM
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?

solrecon111
November 22nd, 2012, 06:47 AM
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.

itman
November 22nd, 2012, 07:24 AM
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.

solrecon111
November 22nd, 2012, 02:54 PM
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.

Thank you.

Sudeki
November 22nd, 2012, 07:45 PM
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
FFFF001102110002100020001001000010373A089C373A0870343A08A0003A08FC1C2308and is broken down like this (courtesy of GBChacker's post):

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.

Quickster
November 23rd, 2012, 11:22 AM
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
FFFF001102110002100020001001000010373A089C373A0870343A08A0003A08FC1C2308and is broken down like this (courtesy of GBChacker's post):

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.

solrecon111
November 23rd, 2012, 12:54 PM
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 uphttps://lh6.googleusercontent.com/-D1HQ9za3FNY/UK_iF70C5AI/AAAAAAAAALs/YZ9mUEvabDY/s903/asdfjkl%3B.png

Spherical Ice
March 27th, 2013, 10:04 AM
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?

itman
March 27th, 2013, 02:13 PM
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.

FF FF 04 11 FF 11 00 02 20 00 20 00 1[S-HIGHLIGHT]3[/S-HIGHLIGHT] 02 00 00 18 37 3A 08 F0 37 3A 08 68 33 3A 08 00 28 90 08 FC 1C 23 08

In that case, it takes up slot number 4 (since 0 is one, etc...).
To make sure it's taking up the right palette, in VBA check: Tools>Palette Viewer.

Spherical Ice
March 27th, 2013, 03:07 PM
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)

theRiolvile
April 5th, 2013, 06:59 AM
I want to put DP overworld sprites but i don't know how it show when I reseized it show only the upper part

Quickster
April 7th, 2013, 05:02 PM
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.

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.

Shadowraze
April 18th, 2013, 11:25 PM
Just a question but can this be used to have individual palletes for each OW?

Quickster
April 19th, 2013, 12:10 PM
Just a question but can this be used to have individual palletes for each OW?

By individual palettes for each OW, do you mean for every 200 something OWs? Im sure that is a possibility, but you couldnt have more than, at least how I understand it, 15 in the same area as they are limited with the palette slot and the game can only load that many palettes at once.

Shadowraze
April 19th, 2013, 02:57 PM
By individual palettes for each OW, do you mean for every 200 something OWs? Im sure that is a possibility, but you couldnt have more than, at least how I understand it, 15 in the same area as they are limited with the palette slot and the game can only load that many palettes at once.

ughhh...

Ok, I'll just have to try to have every OW to have their own pallete and see how it goes.

Aryan143
April 23rd, 2013, 02:43 AM
I have a problem with this tutorial. The OW looks good in OW Editor Rebirth but the palette is screwed up in A-Map and game.

Quickster
April 23rd, 2013, 08:48 AM
I have a problem with this tutorial. The OW looks good in OW Editor Rebirth but the palette is screwed up in A-Map and game.

How so? And are you still editing the players OW?

Aryan143
April 23rd, 2013, 06:39 PM
How so? And are you still editing the players OW?

No I edited the Rival's OW. And also, I noticed one thing- the palette was screwed up in VBA but in No$Gba, it worked fine.

Quickster
April 24th, 2013, 06:41 PM
No I edited the Rival's OW. And also, I noticed one thing- the palette was screwed up in VBA but in No$Gba, it worked fine.

Hm, thats actually really weird. Im not sure what can cause that. Is it never normal in VBA?

Aryan143
April 25th, 2013, 02:00 AM
Hm, thats actually really weird. Im not sure what can cause that. Is it never normal in VBA?

Yes, it never shows up correctly in VBA.

Quickster
April 27th, 2013, 01:42 PM
Yes, it never shows up correctly in VBA.

What version of VBA are you using? Maybe try using version 1.72? I dont know if it makes a differenece, but thats what I use.

~Anbuja
May 18th, 2013, 04:47 AM
Could you please elaborate this part:

starting at 0x0805E5E0, place 70 88 09 07 09 0f 00 29 01 d0 05 e0,
then at 0x0805e5f8 place 03 e0

Some screenshots how it looks before and how after would be very nice, Im just going to these offsets and adding those numbers but nothing really changes ingame.
Am I supposed to touch the oam loading numbers in the sprite offset or something?

EDIT: Ive kind of fixed this while sacrificing the mist >.>
Which I dont want todo D:
Youd maybe want to include which oam code should be in instead of the default ones to make them work, Im really confused here D:

anbuja

MrDollSteak
July 31st, 2013, 07:05 PM
I've noticed that changing the bytes fixes the sprites the first time you enter the map.
However if you open up a menu say the Pokemon screen and close it. When you return
to the map the sprites will glitch. I believe this is connected to the level script command 0x5
load on entering map and on menu close. I was wondering if anyone has experienced or fixed
this.

EDIT: This seems to be related to the actual palette slot that the sprite has! Depending
on the palette slot it looks discoloured in a different way.

It seems that setting the Palette slot to 1A, 1B and 1C allow the sprite to retain its colours
as long as there aren't conflicting ones on the map. So if you have three unique palette sprites
use those three. I imagine others work too, but those three are the ones I can definitely
attest to.

SpadeEdge16
August 20th, 2013, 09:07 AM
So i have a quick question. When it says put the offset before 00000000 ff110000, does that mean each time you add a new pallet it goes before that space in the hex ditor? Or does it mean that each time you add a new pallet, you can place the next offset after those numbers, and then end it with 00000000 ff110000?

GoGoJJTech
August 20th, 2013, 09:42 AM
You END the chain with those bytes. When the game reads those bytes, it stops looking for palettes.

SpadeEdge16
August 20th, 2013, 10:13 AM
You END the chain with those bytes. When the game reads those bytes, it stops looking for palettes.

Meaning if I'm inserting multiple pallets, I put that one time only at the end of all of the pallet offsets?

Quickster
August 21st, 2013, 06:14 AM
Meaning if I'm inserting multiple pallets, I put that one time only at the end of all of the pallet offsets?

Yes, after the last palette you insert, you add that code. And only the last palette.