It is currently Fri Oct 20, 2017 7:13 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Tue Apr 02, 2013 5:59 pm 
Offline
User avatar

Joined: Wed Apr 04, 2012 4:15 pm
Posts: 353
Location: United States of America (USA)
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.


Top
 Profile  
 
PostPosted: Thu Apr 04, 2013 9:44 am 
Offline
User avatar

Joined: Wed Dec 06, 2006 8:18 pm
Posts: 2801
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.


Top
 Profile  
 
PostPosted: Thu Apr 04, 2013 11:34 am 
Offline
User avatar

Joined: Wed Apr 04, 2012 4:15 pm
Posts: 353
Location: United States of America (USA)
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.


Top
 Profile  
 
PostPosted: Thu Apr 04, 2013 12:33 pm 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
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.


Top
 Profile  
 
PostPosted: Fri Apr 05, 2013 11:39 am 
Offline
User avatar

Joined: Wed Dec 06, 2006 8:18 pm
Posts: 2801
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.


Top
 Profile  
 
PostPosted: Fri Apr 05, 2013 6:17 pm 
Offline
User avatar

Joined: Wed Apr 04, 2012 4:15 pm
Posts: 353
Location: United States of America (USA)
@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.


Top
 Profile  
 
PostPosted: Sat Apr 06, 2013 10:29 am 
Offline
User avatar

Joined: Wed Dec 06, 2006 8:18 pm
Posts: 2801
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.


Top
 Profile  
 
PostPosted: Sat Apr 06, 2013 1:33 pm 
Offline

Joined: Sat Aug 28, 2010 9:01 am
Posts: 190
I think this is a case of learning to walk before you can run.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group