PDA

View Full Version : Research: Fire Red Overworld Unknown Byte


Reisen
April 28th, 2013, 02:13 PM
I have been doing some research on the Unknown Values for Overworld Strings in Fire Red.

This thread may also serve as a somewhat sketchy Advanced Tutorial for OW Palette modification.

For reference on adding new OWs: [Other] Adding New Overworlds into FireRed for Dummies
For reference on adding new OW Palettes: [Other] New palettes in Fire Red for OW's!

In the game, the first byte after the two FF bytes coincides with the ID of the Palette used by the overworld. However, editing this byte by itself does not seem to affect the game. I have tested and confirmed this. Instead, the first byte of the four OAM data bytes appear to dictate which palette is used by the OW.

The byte conversion originally appears to be [Palette ID]+[0xF].
(Refer to the latter section of the post)

Following this pattern, Palette 0x20 should be called with byte 0x2F.

However, when that is put into practice:
http://i1274.photobucket.com/albums/y422/encryptedredux/OWR6_zpsc9960bde.png

We get this:
http://i1274.photobucket.com/albums/y422/encryptedredux/OWR7_zpseac846b8.png

That Axew seems a bit black, does it not?


After experimentation, I found that Palette 0x20 is called with byte 0x2A:
http://i1274.photobucket.com/albums/y422/encryptedredux/OWR8_zps2979d8f1.png

And we get this:
http://i1274.photobucket.com/albums/y422/encryptedredux/OWR9_zps6835daa7.png

Much better.


But now, we must play a game of Psychiatrist, and deduce how this unknown byte actually points to the Palette of our desire.

Consider the following strings from the original Fire Red:

Palette 0x0 is called with byte 0x10.
http://i1274.photobucket.com/albums/y422/encryptedredux/OWR1_zps7ce82e81.png

Palette 0x3 is called with byte 0x12.
http://i1274.photobucket.com/albums/y422/encryptedredux/OWR2_zpsc8b18dec.png

Palette 0x4 is called with byte 0x13.
http://i1274.photobucket.com/albums/y422/encryptedredux/OWR3_zpsaa4f85c9.png


However, as I insert my own palettes and new tables, the pattern becomes increasingly elusive.

Palette 0x21 is called with byte 0x22.
http://i1274.photobucket.com/albums/y422/encryptedredux/OWR4_zps66bf6c59.png

Palette 0x23 is called with byte 0x30.
http://i1274.photobucket.com/albums/y422/encryptedredux/OWR5_zps84abaa74.png


Furthermore, as I add more sprites and palettes, I must constantly change the bytes, as they seem to point to different palettes each time.

If anyone has a revelation about this, please contribute to this research.

GoGoJJTech
April 29th, 2013, 04:00 PM
At first I added a new pallet but it came up like so:
http://i40.tinypic.com/4vizdh.png

I used pallet 0x20 or 32 in dec. so I changed the unknown to 23 and it worked.
http://i41.tinypic.com/2iuz4lz.png

But when I exited a battle it became the hero's pallet so at least that's a start!

Aryan143
May 1st, 2013, 03:36 AM
Oh god. If you have posted it a few days back, my old project wouldn't have been cancelled. Anyways, thanks for sharing this information.

Reisen
May 1st, 2013, 03:42 AM
Oh god. If you have posted it a few days back, my old project wouldn't have been cancelled. Anyways, thanks for sharing this information.

You're welcome, I guess. Sorry about your hack...

Also, I seem to have found a pattern in the bytes, most likely pointing to an encryption.

Spherical Ice
May 5th, 2013, 07:35 AM
You're welcome, I guess. Sorry about your hack...

Also, I seem to have found a pattern in the bytes, most likely pointing to an encryption.
Don't leave us hanging mang! I need this too, so if you have a pattern it would help to post it, even if it's not right.

karatekid552
June 24th, 2013, 08:05 AM
The second byte's lower half, that you have highlighted in Blue, was found by JPAN to control which palette slot the palette was put into. This allowed for fixing the problems that come into play when two different OWs are using the same slot but different palettes. The most often example is the player's palette being changed to match the palette of another on screen OW because of this.

However, the upper half of the byte is a still a mystery.

So, if you made it XY, then X is the mystery and Y is the palette slot.

Have you learned anything more about this encryption you were researching?


Edit: Knizz has found a routine that uses the first byte in Y. He doesn't know what it does yet, but he has found something that uses it.

GoGoJJTech
July 1st, 2013, 03:07 PM
As soon as I step into the grass an OW pal changes color to this.
http://i1321.photobucket.com/albums/u544/Gogojjtech/stuff_zpsa203b4f6.png

Just an FYI, pal 2D is the pal for grass, so changing an OW pal to it makes that happen when interacting with grass.

GoGoJJTech
August 28th, 2013, 09:53 AM
Sorry for double posting, but when using the Bag, Trainer card, Option, Pokemon, or Pokedex selections, all the new palettes get reverted to the original ones from the game until you encounter other OWs. I think it's a bug with the actual hacked engine, but either way, it's a glitch.

karatekid552
August 28th, 2013, 01:43 PM
Sorry for double posting, but when using the Bag, Trainer card, Option, Pokemon, or Pokedex selections, all the new palettes get reverted to the original ones from the game until you encounter other OWs. I think it's a bug with the actual hacked engine, but either way, it's a glitch.

Gogojjtech: This will solve that issue: http://www.romhackersonline.com/showthread.php?t=14286-REAL-Runtime-Player-Customization-PKMN-GBA

knizz
September 23rd, 2013, 06:46 AM
Some OW:

083A3BB0 FF FF 00 11 02 11 00 02 10 00 20 00 10 01 00 00
083A3BC0 10 37 3A 08 9C 37 3A 08 70 34 3A 08 A0 00 3A 08
083A3BD0 FC 1C 23 08


Afaik the highlighed value is looked up in this table to get the pointer to the palette:


083A5158 28 D8 36 08 03 11 00 00 48 D8 36 08 04 11 00 00
083A5168 68 D8 36 08 05 11 00 00 88 D8 36 08 06 11 00 00
083A5178 A8 D8 36 08 07 11 00 00 C8 D8 36 08 08 11 00 00
083A5188 E8 D8 36 08 09 11 00 00 08 D9 36 08 0A 11 00 00
083A5198 68 B9 35 08 00 11 00 00 68 E9 35 08 01 11 00 00
083A51A8 88 E9 35 08 02 11 00 00 08 80 39 08 0B 11 00 00
083A51B8 28 80 39 08 0C 11 00 00 68 B9 35 08 10 11 00 00
083A51C8 68 E9 35 08 11 11 00 00 A8 4E 39 08 13 11 00 00
083A51D8 E8 5A 39 08 15 11 00 00 C8 52 39 08 14 11 00 00
083A51E8 00 00 00 00 00 00 00 00 01 11 01 11 01 11 01 11


I didn't test it. I hope that helps

karatekid552
September 23rd, 2013, 10:07 AM
Some OW:

083A3BB0 FF FF 00 11 02 11 00 02 10 00 20 00 10 01 00 00
083A3BC0 10 37 3A 08 9C 37 3A 08 70 34 3A 08 A0 00 3A 08
083A3BD0 FC 1C 23 08


Afaik the highlighed value is looked up in this table to get the pointer to the palette:


083A5158 28 D8 36 08 03 11 00 00 48 D8 36 08 04 11 00 00
083A5168 68 D8 36 08 05 11 00 00 88 D8 36 08 06 11 00 00
083A5178 A8 D8 36 08 07 11 00 00 C8 D8 36 08 08 11 00 00
083A5188 E8 D8 36 08 09 11 00 00 08 D9 36 08 0A 11 00 00
083A5198 68 B9 35 08 00 11 00 00 68 E9 35 08 01 11 00 00
083A51A8 88 E9 35 08 02 11 00 00 08 80 39 08 0B 11 00 00
083A51B8 28 80 39 08 0C 11 00 00 68 B9 35 08 10 11 00 00
083A51C8 68 E9 35 08 11 11 00 00 A8 4E 39 08 13 11 00 00
083A51D8 E8 5A 39 08 15 11 00 00 C8 52 39 08 14 11 00 00
083A51E8 00 00 00 00 00 00 00 00 01 11 01 11 01 11 01 11


I didn't test it. I hope that helps

That was already known. It is a different byte being discussed here.



Edit: since I last visited this thread, I have learned that the game does this on the palette slot byte:

Byte AND 0xF -> Palette Slot

The upper half is completely disregarded.

Cheve_X
January 8th, 2014, 08:07 PM
Well, idk if this its relevant, but I make some little investigation and the OW inserted by me only overwrite the palette 0xA or 0x0 just in some cases, with the anothers, just uses whathever it was load before (Even if there its nothing, just black)

So I star to look how can I make than my OW overwrite the palete there... I don't know how, but if we can do this we can use all the pals...


(MEABE, relevant) I was chequing out some things, and I figured out than when using the 0 pal slot (Hero's one) sometimes It get replaced, sometimes not... So I try to see why... I try with two diferents Ows (Than I Insert) one replace it, and the another not, when I go to the data, the only differece was the pal number and the sprites pointer... So I try changing the pal number and it works, now both replace the pal (using the 20, btw) but when I try with both using the 23, nothing happens, the new ows use the heros pal, what makes me think that game dosn't load them...

Hope This Help!

pengoy
April 10th, 2014, 11:31 AM
sooo... anybody figured out how those UNKNOWNs are calculated? im having problems with this glitch.

i followed this tutorial and manage to create 4 new palettes. successfully put it in OWE and it worked fine. but ingame, whenever i placed i place a sprite w/ new palette... it gets bugged.

i have been trying to do the [pal # + 0xf] and it wont work.