Fan Games Hub General discussions about all things fan games. Topics relating to both ROM hacks and custom games are welcome here. Posting links to ROMs is illegal and is not tolerated anywhere on the forum.

Reply
 
Thread Tools
  #1    
Old November 20th, 2010 (6:29 AM).
Darthatron's Avatar
Darthatron Darthatron is offline
巨大なトロール。
  • Silver Tier
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 25
Gender: Male
Nature: Modest
Posts: 1,152
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?
__________________
あなた は しきしゃ です
わたし は ばか です
Reply With Quote

Relevant Advertising!

  #2    
Old November 21st, 2010 (12:10 AM).
colcolstyles's Avatar
colcolstyles colcolstyles is offline
Yours truly
  • Crystal Tier
 
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
Posts: 1,584
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
Reply With Quote
  #3    
Old November 21st, 2010 (7:49 AM).
Darthatron's Avatar
Darthatron Darthatron is offline
巨大なトロール。
  • Silver Tier
 
Join Date: Jan 2006
Location: Melbourne, Australia
Age: 25
Gender: Male
Nature: Modest
Posts: 1,152
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??
__________________
あなた は しきしゃ です
わたし は ばか です
Reply With Quote
  #4    
Old November 24th, 2010 (12:19 PM).
Full Metal's Avatar
Full Metal Full Metal is offline
C(++) Developer.
  • Silver Tier
 
Join Date: Jan 2008
Location: In my mind.
Age: 21
Gender: Male
Nature: Timid
Posts: 806
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.
Reply With Quote
  #5    
Old November 24th, 2010 (11:13 PM).
ZodiacDaGreat's Avatar
ZodiacDaGreat ZodiacDaGreat is offline
Working on a Mobile System
     
    Join Date: Feb 2007
    Location: South Pacific
    Age: 24
    Gender: Male
    Nature: Relaxed
    Posts: 429
    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
    __________________
    Reply With Quote
      #6    
    Old November 27th, 2010 (7:42 PM).
    Darthatron's Avatar
    Darthatron Darthatron is offline
    巨大なトロール。
    • Silver Tier
     
    Join Date: Jan 2006
    Location: Melbourne, Australia
    Age: 25
    Gender: Male
    Nature: Modest
    Posts: 1,152
    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.
    __________________
    あなた は しきしゃ です
    わたし は ばか です
    Reply With Quote
      #7    
    Old November 28th, 2010 (12:36 AM).
    Prof. 9 Prof. 9 is offline
       
      Join Date: Jun 2006
      Location: Netherlands
      Gender: Male
      Posts: 151
      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.
      Reply With Quote
      Reply
      Quick Reply

      Sponsored Links
      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

      Forum Jump


      All times are GMT -8. The time now is 11:31 PM.