Community

The PokéCommunity

We are still working on a better slogan!

Visit Index



Advertise here

Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development
Notices

Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!
Research & Development programs in this forum are subject to moderator approval before they are displayed.

Post Reply
Click here to go to the first staff post in this thread.  
Thread Tools
  #1    
Old November 20th, 2010, 06:29 AM
Darthatron's Avatar
Darthatron
巨大なトロール。
Community Supporter
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 23
Gender: Male
Nature: Modest

Advertise here
What method do you all use in order to locate images/tilemaps written to the VRAM in the ROM? I've tried everything I can think of, and each time it's just lead to rage-quits (but not really)... So... Help?

I attempted setting a break point on any writes to the VRAM, but it didn't work.

Discuss?
あなた は しきしゃ です
わたし は ばか です
  #2    
Old November 21st, 2010, 12:10 AM
colcolstyles's Avatar
colcolstyles
Yours truly
 
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
Moving this to R&D...

I have a general method that I use which works most of the time. I've considered writing a tutorial detailing it but ah, there's never enough free time. Anyway, first I open the ROM with VBA-H and use its logging capability to track calls of DMA3 and SWI and then search through the results for the address I'm looking for. The good thing about this is that it also catches the decompression of any data which comes in handy for a lot of graphics in particular. If I don't see the address in the log file, then I fire up VBA-SDL-H and put a breakpoint on the address of the image/tilemap in the VRAM. This allows me to see exactly what's going on when the game writes to the VRAM. If the game breaks on a SWI call, then I can check the registers (r0 usually has the source) to find where the data is located in the ROM. If the game breaks on something like "str r0, [r7, #0x00]" and r7 contains an I/O Register address ('0x0400:0XXX'), then it's probably utilizing one of the DMAs. And if it's just a "str/b/h" or "stmia" instruction, then you'll have to decompile some routines to trace where the data is being read from, which, admittedly, can be a very tedious process.

Also, some of the time (I see this more with compressed data), the game copies the image into the WRAM and from there copies it to the VRAM. I'm assuming this has something to do with with buses and all that technical, hardware stuff that I don't understand.

Brother of Vrai
  #3    
Old November 21st, 2010, 07:49 AM
Darthatron's Avatar
Darthatron
巨大なトロール。
Community Supporter
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 23
Gender: Male
Nature: Modest
I'm shocked that I never thought of that... That's a very good way of doing it, kudos. I just followed your method and found exactly what I was looking for. :D

Anyone else have different ways, for future reference??
あなた は しきしゃ です
わたし は ばか です
  #4    
Old November 24th, 2010, 12:19 PM
Full Metal's Avatar
Full Metal
C(++) Developer.
Community Supporter
 
Join Date: Jan 2008
Location: In my mind.
Age: 19
Gender: Male
Nature: Timid
Send a message via Windows Live Messenger to Full Metal
[uncompressed only]
1.finf gfx memory [use oam/tile/sprite viewer]
2. dump a few bytes and search w/ hexeditor.
:]

★ full metal.

I like to push it,
and push it,
until my luck is over.
  #5    
Old November 24th, 2010, 11:13 PM
ZodiacDaGreat's Avatar
ZodiacDaGreat
Working on a Mobile System
 
Join Date: Feb 2007
Location: South Pacific
Age: 22
Gender: Male
Nature: Relaxed
Send a message via ICQ to ZodiacDaGreat
Add onto Full Metal's way. But can also work for Compressed Look for the address using the viewers, dump like approximate size and then compressed it with a tool and then search XD
  #6    
Old November 27th, 2010, 07:42 PM
Darthatron's Avatar
Darthatron
巨大なトロール。
Community Supporter
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 23
Gender: Male
Nature: Modest
Quote:
Originally Posted by ZodiacDaGreat View Post
Add onto Full Metal's way. But can also work for Compressed Look for the address using the viewers, dump like approximate size and then compressed it with a tool and then search XD
Yeah, that's what I used to do. xD I just always assumed there was a better way.
あなた は しきしゃ です
わたし は ばか です
  #7    
Old November 28th, 2010, 12:36 AM
Prof. 9
 
Join Date: Jun 2006
Location: The Netherlands
Gender: Male
I set address=byte breakpoints and backtrace until I get a source address that's in the ROM. If the data is copied using DMA you can just peek at the DMA I/O ports and see what the source address is. Normal break-on-write breakpoints often don't work on VRAM because it's filled either through DMA or Cpu(Fast)Set.
Post Reply
Quick Reply

Sponsored Links


Advertise here
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 04:04 PM.

About Us
© 2002 - 2014 The PokéCommunity™, pokecommunity.com. Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.

Copyright
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com. PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator. Header artwork by Jordanice of deviantART.

Social Media
If you would like to stay up-to-date with us on the go, when we're down, or other such things, follow us on social media sites--most notibly Twitter, Facebook, and Google Plus--by clicking on the links provided.

Design presented by Peitharchia. Special thanks to Hiroshi Sotomura and Ausaudriel.