I was curious about the Sprite Attribute Table (OAM). In an emulator like BGB, the OAM is stored as four bytes in RAM. (Y pos., X pos, pattern number, and flag.)
I am new to Z80, so I wanted to modify the OAM of pokemon blue. What would a string for something like this be in hex in ROM:
60 Y position
62 X position
00 attribute
tile 01
I know that the tiles are in a different location. I just need to change the y position to 30. And change the others too. So hex is the best. What should I look for in hex, could someone give me an example for the above, so that I could do the rest? Thanks.
P.S. This is for my version of Pokemon Green in English.
It depends on what you mean. What did you want to change, and how does the game go about writing to Sprite RAM. Usually games have a engine built up that handles how they put characters and such on the screen.
OAM is stored at RAM from 0xFE00 - 0xFE9F. There are 40 blocks composed of four bytes each for OAM. The game loads the four bytes in this order:
1. X Loc
2. Y Loc
3. Tile no.
4. Attribute
I am trying to change the Title screen where Ash holds the pokeball and various Pokemon are displayed to match that of Green. Basically I need to change the X and Y Loc. Any info on what to look for in hex?
I already know what byte I need to change, I just need an example of what to look for in ROM hex....
Only ash is stored as an OAM sprite.
Trace the data from OAM back to its source. Put a breakpoint to find when these values are written to OAM, then examine the code to find where it's coming from ROM.
There is a byte of RAM that controls which Pokemon character is shown on the title screen. It changes in some sort of pattern. Just find out how it determines this and you can change it. Just by poking RAM I could make it show Pokemon it never would like Mewtwo, Mew, Zapados, etc. So you don't need to look at OAM at all. You just need to find where it alters that byte. And to find that byte, just do a memory search, every time the character on the screen changes you know that byte has changed. You'll find it pretty quick.
@Mottzilla
There is already a tool to modify the pokemon on the title screen, it's called Red/Blue Titlescreen Editor, by Swampert Tools. Anyways, the titlescreen can hold a total of 17 pokemon. The data in ROM for this is 0x4588.
I am specifically talking about Ash, which is stored as an OAM, and has an X axis of 30 in pokemon green. Compare him in the American/Japanese versions in that same titlescreen.
You want to alter the trainer sprite? As suggested then you may need to trace back from writes to OAM to the source of the data for the writes.
I think this is a case of learning to walk before you can run.