PDA

View Full Version : Dumping NES ROM from GBA Cartridge


The 9th Sage
07-06-2004, 04:38 AM
This is going to sound strange, but...

You know how several NES games were released on GBA cartridges recently, right? Well, at least with Zelda, I've heard that Nintendo changed the graphics so that they looked better scaled down (heard this on the Pocket Heaven forums, so the person probably knows what they are talking about).

My question is thus....how can I dump the NES ROM from the cartridge? I saw the offset that the NES ROM started at in the GBA cartridge on the Pocket Heaven forums, but I can't find that thread anymore. Can any supply me with this info?

<P ID="signature">http://www.xanga.com/ZeldaDDhttp://www.angelfire.com/realm2/zdd2/images/Spenchi_Xanga.txt</a></P>

mFC
07-06-2004, 05:38 AM
not to sound like a jerk, but shouldnt this be in another part of zmd?

Chris

<P ID="signature"><center>http://www.zophar.net/personal/mfc/wooty.jpg</center></P>

Lobster Cowboy
07-06-2004, 06:02 AM
are the games rewritten for GBA, or are they emulated?

<P ID="signature"><img src=http://www.lobsterstudios.com/images/lobsterranx.jpg>
</img></P>

Disch
07-06-2004, 08:02 AM
Break out a hex editor and search the GBA ROM for like the first 16 bytes after the header and all the graphics of the NES ROM. If that doesn't work, you could try searching for the cartridge name in the GBA ROM (it's ZELDA all caps in the NES ROM... so find that and you found the end of the PRG).

OR... if you're just looking for graphics... open the ROM in TLP or YY-Chr, set it to NES graphics mode and just look for the graphics. The start of the graphics signaled the start of the ROM iirc.

<P ID="signature"></P>

Disch
07-06-2004, 08:04 AM
> are the games rewritten for GBA, or are they emulated?

I thought they were emulated. Seems a lot more likely considering the games are like near-exact replicas (or at least that's what I've heard, haven't played them myself).

<P ID="signature"></P>

Ugly Joe
07-06-2004, 02:04 PM
> are the games rewritten for GBA, or are they emulated?
>
I was wondering this too. He said the graphics were redone to look better scaled, which makes sense to me. PocketNES, for example, can't do fullscreen without messing up the graphics (or by doing some 'screen-scroll' thing that is technically very impressive, but not very useful to me), so I guess they'd have to tweak the sprites a bit to make it work fullscreen.

<P ID="signature"></P>

The 9th Sage
07-06-2004, 04:11 PM
> I thought they were emulated. Seems a lot more likely
> considering the games are like near-exact replicas (or at
> least that's what I've heard, haven't played them myself).

From what I understand, they are emulated, but Nintendo tweaked the graphics to look nicer scaled (since the GBA's vertical resolution is roughly half that of the NES's native resolution, there is a certain process used that scales the vertical part of the image down so it can all fit on the screen at once. PocketNES uses basically the same idea, except Loopy though of it first. *grins* Anyway, sometimes it can make graphics look a little strange depending on the game, hence the tweaked graphics. I want the NES ROM from it so I can run it in PocketNES. lol)


<P ID="signature">http://www.xanga.com/ZeldaDDhttp://www.angelfire.com/realm2/zdd2/images/Spenchi_Xanga.txt</a></P>

The 9th Sage
07-06-2004, 04:12 PM
> not to sound like a jerk, but shouldnt this be in another
> part of zm

I wasn't really sure. Technically I don't think that it's ROM Hacking (since I'm not really hacking, just trying to dump the ROM), but if someone wants to move it, go right ahead, I have no problem with that.


<P ID="signature">http://www.xanga.com/ZeldaDDhttp://www.angelfire.com/realm2/zdd2/images/Spenchi_Xanga.txt</a></P>

The 9th Sage
07-06-2004, 04:17 PM
> Break out a hex editor and search the GBA ROM for like the
> first 16 bytes after the header and all the graphics of the
> NES ROM. If that doesn't work, you could try searching for
> the cartridge name in the GBA ROM (it's ZELDA all caps in
> the NES ROM... so find that and you found the end of the
> PRG).

That's a good idea. NES ROMs do have a header at the beginning of the file don't they? I'm less familiar with this as far as NES goes than I am with say SNES. I'll give it my best shot though. *breaks out his back-up CD in search of hex editors he knows that he's downloaded in the past*

<P ID="signature">http://www.xanga.com/ZeldaDDhttp://www.angelfire.com/realm2/zdd2/images/Spenchi_Xanga.txt</a></P>

hcs
07-06-2004, 05:39 PM
> That's a good idea. NES ROMs do have a header at the
> beginning of the file don't they?

I don't think that this will be in the GBA version, the iNES header is an emulator format, not part of the ROM itself, and I highly doubt that Nintendo would use it in their own products. The iNES header pretty much just tells the emulator the structure of the PCB. What he meant was that the data after the iNES header (the beginning of the ROM proper) would likely be the same. The ZELDA string at the end might work, too... SMB games similarly have their name in the code. Deadly Towers has a message from the programmers in it...

<P ID="signature">-http://hcs.freeshell.org/index.cgihcs</a></P><P ID="edit"><FONT class="small">Edited by hcs on 07/06/04 01:41 PM.</FONT></P>

The 9th Sage
07-06-2004, 07:57 PM
> I don't think that this will be in the GBA version, the iNES
> header is an emulator format, not part of the ROM itself,
> and I highly doubt that Nintendo would use it in their own
> products.
What he meant was that
> the data after the iNES header (the beginning of the ROM
> proper) would likely be the same. The ZELDA string at the
> end might work, too... SMB games similarly have their name
> in the code. Deadly Towers has a message from the
> programmers in it...

In all likelihood this does too then, because as I uderstand it this is basically like an official hack of Zelda 1, which is just wonderfully ironic.
<img src=smilies/magbiggrin.gif>

Ok, now that I remember that the iNES header isn't actually a part of the NES...er...spec so to speak, I'll figure this out eventually. lol My Flash Linker isn't co-operating though, I think my printer cable is going bad. It decided it doesn't want to back ANYTHING up, including games that I have backed up before using it (and all of those were good dumps I might add).

When I figure it out I'll let everyone know. I should post an IPS patch so no one else has to go through this. lol

*edit*
This is proof positive that the FlashAdvance Pro Linker hardware was designed by Satan. I fixed my problem by turning the power switch to OFF. Interestingly, while I know it's a valid dump, it doesn't work on VisualBoy Advance. I get an error screen stating "Game Pak error , turn off the power" or something like that.

<P ID="signature">http://www.xanga.com/ZeldaDDhttp://www.angelfire.com/realm2/zdd2/images/Spenchi_Xanga.txt</a></P><P ID="edit"><FONT class="small">Edited by The 9th Sage on 07/06/04 04:36 PM.</FONT></P>

Disch
07-06-2004, 09:21 PM
> Ok, now that I remember that the iNES header isn't actually
> a part of the NES...er...spec so to speak

Yeah. If it's just a dump of the ROM, then the iNES header wouldn't be included in the GBA version (and possibly, the PRG banks are ordered differently, although that's rather unlikely).

Then again... the emulation scene isn't exactly new to Nintendo... so they might have very well just taken a ROM with the iNES header and slapped it on the cart. I guess you'll find out once you find the NES ROM image on that GBA ROM.

> Interestingly, while I
> know it's a valid dump, it doesn't work on VisualBoy
> Advance. I get an error screen stating "Game Pak error ,
> turn off the power" or something like that.

Yeah... I heard VBA doesn't run the classic NES series. I remember people complaining about it.

<P ID="signature"></P>

phonymike
07-06-2004, 10:56 PM
You won't find the nes rom in the gba rom cause it's under some sort of compression. But when the emu runs, the rom gets extracted to 0x2000000 in RAM. You can use VBA to save this ram data (0x20000 bytes,) and then add a 16 byte header to the beginning of the file. This method also worked with metroid zero mission, but I thought the nes rom started a little later in ram. Just dump the RAM (a total of 0x40000 bytes) and compare it to an nes rom you already have.

p.s. if anyone wants my resource data files *wink*wink* just pm me.

<P ID="signature">immortality (http://www.alexchiu.com/affiliates/clickthru.cgi?id=phonymike)</P>

The 9th Sage
07-08-2004, 01:38 AM
> You won't find the nes rom in the gba rom cause it's under
> some sort of compression.

I was wondering if that was the case...I couldn't find any references/indications of there being a NES ROM in there, although I knew there HAD to be one in there. Thanks, I was wondering if something weird like that was happening..

>But when the emu runs, the rom
> gets extracted to 0x2000000 in RAM. You can use VBA to save
> this ram data (0x20000 bytes,) and then add a 16 byte header
> to the beginning of the file.

Aw, you're a life saver.

>This method also worked with
> metroid zero mission, but I thought the nes rom started a
> little later in ram. Just dump the RAM (a total of 0x40000
> bytes) and compare it to an nes rom you already have.

Are there any changes to THAT ROM, or is it a 'vanilla' Metroid ROM? Anyway, thank you so much, you've saved me a LOT of time. :)


<P ID="signature">http://www.xanga.com/ZeldaDDhttp://www.angelfire.com/realm2/zdd2/images/Spenchi_Xanga.txt</a></P>

The 9th Sage
07-08-2004, 01:41 AM
> Yeah... I heard VBA doesn't run the classic NES series. I
> remember people complaining about it.

It won't run off of my Flashcart either. Copy Protection perhaps?


<P ID="signature">http://www.xanga.com/ZeldaDDhttp://www.angelfire.com/realm2/zdd2/images/Spenchi_Xanga.txt</a></P>

Alevice
07-08-2004, 01:57 AM
> Are there any changes to THAT ROM, or is it a 'vanilla'
> Metroid ROM? Anyway, thank you so much, you've saved me a
> LOT of time. :)
>
Progress is recorded to saveram rather than password. I dont think they even fixed resolution, given how squished the game looks

<P ID="signature">_-|-_</P>

The 9th Sage
07-08-2004, 02:02 AM
> Progress is recorded to saveram rather than password. I dont
> think they even fixed resolution, given how squished the
> game looks

Really? I thought the saving the progress bit was hardcoded into the emulator, not a part of the ROM. I'd like to get my hands on that then, too. Good thing I happen to have my Metroid Zero Mission cartridge right here. :)


<P ID="signature">http://www.xanga.com/ZeldaDDhttp://www.angelfire.com/realm2/zdd2/images/Spenchi_Xanga.txt</a></P>

The 9th Sage
07-08-2004, 02:26 AM
I must be doing something stupid, I can't see NES graphics at all in the memory dump. I did what you said, I think. Starting at address 0x20000, copy 0x40000 bytes.

<P ID="signature">http://www.xanga.com/ZeldaDDhttp://www.angelfire.com/realm2/zdd2/images/Spenchi_Xanga.txt</a></P>

cipher
07-08-2004, 12:32 PM
> I must be doing something stupid, I can't see NES graphics
> at all in the memory dump. I did what you said, I think.
> Starting at address 0x20000, copy 0x40000 bytes.
>

Offset 0x2000000, dump 0x20000. Yay zeros.

<P ID="signature">-----
ciphz0r</P>

The 9th Sage
07-08-2004, 03:06 PM
> Offset 0x2000000, dump 0x20000. Yay zeros.

That was it. I'm such an idiot. Please excuse my stupidity with this stuff. As much as I DO know, there's way more that I don't. <img src=smilies/banghead.gif> But anyway, thanks everyone. I know I can slap an iNES header (copied from the original Zelda ROM) on there myself, I did it succesfully last night to the memory dump containing no NES data. >_<

<P ID="signature">http://www.xanga.com/ZeldaDDhttp://www.angelfire.com/realm2/zdd2/images/Spenchi_Xanga.txt</a></P>

phonymike
07-08-2004, 11:56 PM
The graphics from the zero mission rom were altered to look better. Plus it does save to sram, they pry made a slight change to the NES code (or used the fds version?) and maybe the emu has special code to save also since the nes code would have to communicate to the emu to access gba sram.

<P ID="signature">immortality (http://www.alexchiu.com/affiliates/clickthru.cgi?id=phonymike)</P>

phonymike
07-08-2004, 11:59 PM
I forget what game it was, but the hardware in the cart uses is not sram. So the game makes some sram writes which would work on a flash cart, but not on a real cart. It was a simple loop that copied like a thousand bytes to sram area (wouldn't do anything on a real cart) and checks it. Would be simple to bypass this. Since flash cards today seem to have a universal battery backed up memory, you can't tell the cart to 'only emulate flash,' so it's a way to tell all flash cards apart from a flash or eprom save type cartridge (besides accessing many different cart protocols to detect exactly what type of flash card it is.)

<P ID="signature">immortality (http://www.alexchiu.com/affiliates/clickthru.cgi?id=phonymike)</P>

The 9th Sage
07-09-2004, 02:10 AM
> and maybe
> the emu has special code to save also since the nes code
> would have to communicate to the emu to access gba sram.

I think it does, judging by how it appears to work, and how that window pops up like that...it looks like part of the emulator's interface.


<P ID="signature">http://www.xanga.com/ZeldaDDhttp://www.angelfire.com/realm2/zdd2/images/Spenchi_Xanga.txt</a></P>