don't click here

Is it possible to extract roms from Virtual Console WADs yet?

Discussion in 'Technical Discussion' started by MarzSyndrome, Oct 24, 2009.

  1. MarzSyndrome

    MarzSyndrome

    Everything is going to the beat. Member
    I recently discovered that the oft-legally-troubled Revenge of Shinobi did get a VC release in the end.

    They appeared to get round the Marvel issue by painting Spiderman in all-pink (almost), judging by screenshots.


    In turn, of course, they created a new revision of the rom (1.04) in the process. I was looking around to see if a successful dump of it had been made, but Google didn't turn up anything useful.


    I seem to recall talk in the past that Virtual Console WADs were encrypted etc etc, but a WAD Unpacker tool appears to exist. Alas, I couldn't get it to extract the RoS WAD successfully. So is there much else I can do?
     
  2. Spanner

    Spanner

    The Tool Member
    3,350
    157
    43
    United Kingdom
    Sonic Hacking Contest
    Don't VC files get patched using code that is injected into a ROM? I remember something similar in a topic here before.
     
  3. Polygon Jim

    Polygon Jim

    Eternal Tech Member
    0
    0
    0
    across town from Hinchy
    All the bitches.
    It should be able to be extracted fine.

    The wad should be unpacked, leaving you with .app files, and one of them in the rom. It needs unpacked with u8tools.
     
  4. ICEknight

    ICEknight

    Researcher Researcher
    <!--quoteo(post=365416:date=Oct 24 2009, 01:35 PM:name=SOTI)--><div class='quotetop'>QUOTE (SOTI @ Oct 24 2009, 01:35 PM) <a href="index.php?act=findpost&pid=365416">[​IMG]</a></div><div class='quotemain'><!--quotec-->Don't VC files get patched using code that is injected into a ROM? I remember something similar in a topic here before.<!--QuoteEnd--></div><!--QuoteEEnd-->Well... <a href="http://forums.sonicretro.org/index.php?showtopic=9674&st=15" target="_blank">not all of them</a>. Some include the patch even if the ROM comes modified already.
     
  5. evilhamwizard

    evilhamwizard

    Researcher
    1,374
    392
    63
    Revenge of Shinobi's release is using the REV03 rom with changes being applied on run time using a patch file.

    You can follow <a href="http://forums.sonicretro.org/index.php?showtopic=16550&view=findpost&p=339320" target="_blank">this</a> link to view the actual patch file (view the entire topic if you're interested too). Since the last post in the topic, I think there were more VC games to check out. I know I'll definitely check out Sonic & Knuckles to see what they're actually doing for the lock-on stuff.
     
  6. MarzSyndrome

    MarzSyndrome

    Everything is going to the beat. Member
    Thanks, eventually worked out that I needed that little "common-key.bin" file for it to work properly.


    However! Upon eventually getting my hands on the rom after some unpacking, I play it out in Fusion only to discover none of the new changes are present. The copyright screen is still present, and Spiderman is still his usual red-and-blue self. WTF?

    I'm starting to wonder if Nintendo/Sega implemented some special wrapper that makes the new modifications within memory, rather than hard-patching the rom. I guess I'm not too far off here?

    EDIT: Ok, evilhamwizard pretty much explained it already. That'll teach me not to go posting again without refreshing the thread. =P
     
  7. MarzSyndrome

    MarzSyndrome

    Everything is going to the beat. Member
    Hmmm, looking at that patch info, I'm not quite sure how to translate that into offsets that I need to edit. I may be good at hex-editing, but I'm not *that* good. :-P
     
  8. MarzSyndrome

    MarzSyndrome

    Everything is going to the beat. Member
    BTW, after playing around with the U8 and CCF tools, I noticed I'm unable to find the NES rom in any of the NES game wads. Going through every .APP file reveals nothing resembling a rom. One google result saw someone mentioned the rom being stored in 00000001.APP, but it doesn't have a U8 header hence U8Extr can't unpack them. Anyone know any more?


    Also, when it comes to 'injecting' NeoGeo roms into wads, do they have to be converted to another format first? Because when I exracted NG WADs (and the APP) I noticed the game tends to come in a single file (game.bin), rather than a set of roms.
     
  9. JDAdams

    JDAdams

    Member
    318
    0
    16
    <!--quoteo(post=365634:date=Oct 25 2009, 06:56 AM:name=MarzSyndrome)--><div class='quotetop'>QUOTE (MarzSyndrome @ Oct 25 2009, 06:56 AM) <a href="index.php?act=findpost&pid=365634">[​IMG]</a></div><div class='quotemain'><!--quotec-->BTW, after playing around with the U8 and CCF tools, I noticed I'm unable to find the NES rom in any of the NES game wads. Going through every .APP file reveals nothing resembling a rom. One google result saw someone mentioned the rom being stored in 00000001.APP, but it doesn't have a U8 header hence U8Extr can't unpack them. Anyone know any more?


    Also, when it comes to 'injecting' NeoGeo roms into wads, do they have to be converted to another format first? Because when I exracted NG WADs (and the APP) I noticed the game tends to come in a single file (game.bin), rather than a set of roms.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Can't help you with the NG ROMs, but NES ones are indeed contained within the 00000001.app file - you just have to look for the header (the text "NES" should be the start of the ROM) and extract the correct number of bytes using a hex editor. I extracted a unique Zelda II ROM (it's modified to run correctly at 60Hz despite the EU emulator being stuck at 50Hz!) this way - in the case of the EU VC Zelda II release the ROM starts at 0x105A70 and runs to 0x1099EF.

    Some notes I made on the VC NES emulator when going through all of the emus trying to get 60Hz modes working on a PAL console or with PAL downloads. This may or may not be useful - I have similar notes on most of the systems, the NES actually being one of the ones I have lower amounts of documentation on since it's quite straightforward and indeed not possible to hack the video modes very much :-(

    Emulator is region-specific (as opposed to say the MD/Genesis emulator which is universal)
    Emulator file (00000001.app) contains ROM
    Emulator sets speed according to internal settings (PAL/NTSC) (I.e. changing the video mode will not affect anything)
    Emulator sets display mode according to internal settings (PAL/NTSC) (I.e. changing the video mode will not affect anything)
    Emulator crashes if console video mode does not match emulator video mode
    NTSC console mode/GPAL game mode=Crashes
    MPAL console mode/GPAL game mode=Crashes
    PAL console mode/GNTSC game mode=Crashes
    Video modes set as for SNES games (see below) but only used for background planes - sprites render the same regardless (I.e. changing video mode will give you a very odd result, generally sprites rendering but the background not bothering to make an appearance)
    If NTSC downloads are amended to PAL60 480i / 480p video modes, these modes become available with PAL console video mode
    If PAL downloads are amended to PAL60 480i / 480p video modes, these modes do not work correctly as emulator is still PAL
    If PAL downloads are amended to NTSC 480i / 480p video modes, these modes do not work correctly as emulator is still PAL
    If NTSC ROMs are injected into amended PAL downloads, these modes still do not work correctly as emulator is still PAL
    Therefore only NTSC downloads will work correctly at 480p, only if game and console video mode settings match and played with 480p screen mode

    00000001.app contains video mode strings
    00 NTSC 480i
    01 NTSC 240p
    02 NTSC 480p
    04 PAL 528i
    05 PAL 264p
    08 MPAL 480i
    14 PAL60 480i
    15 PAL60 240p
    16 PAL60 480p

    NTSC (non interlaced) = 240p
    PAL (non interlaced) = 288p
    PAL60 (non interlaced) = 240p

    Details (sample video mode entry for 480p - the location within the file will vary but the strings are easy to find):
    16 Wii screen mode (PAL60 480p) (does not affect emulated screen size)
    02 80 640 in hex - horiz. rez. for emulator output (portion of screen displayed - not emulated screen size)
    00 F0 240 in hex - vert. rez. for emulator (portion of screen displayed - not emulated screen size)
    00 F0 240 in hex - vert. rez. for active screen (does not affect emulated screen size)
    00 28 40 in hex - left margin in pixels
    00 Spacer
    00 Extra pixels (over NTSC) to render - 00 = 60Hz, 17 (23) = 50Hz 528i, 0B (11) = 50Hz 264p (see below)
    02 80 640 in hex - horiz. rez. for system messages
    01 E0 240 in hex - vert. rez. for system messages
    00 00 Spacer
    00 00 00 00 All zeroes = progressive, anything else = interlaced
    00 00 Spacer
    06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 06 Spacer
    00 00 15 16 15 00 00 Progressive (08080A0C0A0808 is interlaced)
    00 00 00 00 00 00 Spacer
    00 00 = 60Hz, 17 (23) = 50Hz 528i, 0B (11) = 50Hz 264p
    480i is 640x480
    528i is 640x528
    48 difference = setting of 23
    240p is 640x240
    264p is 640x264
    24 difference = setting of 11
    Setting = half of (extra lines for PAL minus two)
    Does not appear to have any actual effect
    Entire second location of video modes is present but appears useless as can be removed with no effect
    Operations Guides store screen mode separately
     
  10. MarzSyndrome

    MarzSyndrome

    Everything is going to the beat. Member
    Thanks for the info, dude. They certainly had to make the NES emulation a tad complicated didn't they? :-P


    Has anyone noticed, btw, how Phantasy Star IV and Golden Axe III appear to be using unique European roms by the looks of it? They certainly don't match anything in the GoodGen or No-Intro sets.
     
  11. ICEknight

    ICEknight

    Researcher Researcher
    <!--quoteo(post=366460:date=Oct 27 2009, 09:15 AM:name=MarzSyndrome)--><div class='quotetop'>QUOTE (MarzSyndrome @ Oct 27 2009, 09:15 AM) <a href="index.php?act=findpost&pid=366460">[​IMG]</a></div><div class='quotemain'><!--quotec-->Has anyone noticed, btw, how Phantasy Star IV and Golden Axe III appear to be using unique European roms by the looks of it? They certainly don't match anything in the GoodGen or No-Intro sets.<!--QuoteEnd--></div><!--QuoteEEnd-->There's no European Phantasy Star IV ROM in the Goodset, to begin with. Which is strange, since that game was indeed released over here.
     
  12. MarzSyndrome

    MarzSyndrome

    Everything is going to the beat. Member
    <!--quoteo(post=366487:date=Oct 27 2009, 03:58 PM:name=ICEknight)--><div class='quotetop'>QUOTE (ICEknight @ Oct 27 2009, 03:58 PM) <a href="index.php?act=findpost&pid=366487">[​IMG]</a></div><div class='quotemain'><!--quotec--><!--quoteo(post=366460:date=Oct 27 2009, 09:15 AM:name=MarzSyndrome)--><div class='quotetop'>QUOTE (MarzSyndrome @ Oct 27 2009, 09:15 AM) <a href="index.php?act=findpost&pid=366460">[​IMG]</a></div><div class='quotemain'><!--quotec-->Has anyone noticed, btw, how Phantasy Star IV and Golden Axe III appear to be using unique European roms by the looks of it? They certainly don't match anything in the GoodGen or No-Intro sets.<!--QuoteEnd--></div><!--QuoteEEnd-->There's no European Phantasy Star IV ROM in the Goodset, to begin with. Which is strange, since that game was indeed released over here.
    <!--QuoteEnd--></div><!--QuoteEEnd-->
    And of course, anyone who still wanted to dump it could get one off eBay no problem, but expect to pay a fairly hefty sum for it (£30 minimum by the looks of things atm).
     
  13. JDAdams

    JDAdams

    Member
    318
    0
    16
    <!--quoteo(post=366520:date=Oct 27 2009, 05:21 PM:name=MarzSyndrome)--><div class='quotetop'>QUOTE (MarzSyndrome @ Oct 27 2009, 05:21 PM) <a href="index.php?act=findpost&pid=366520">[​IMG]</a></div><div class='quotemain'><!--quotec--><!--quoteo(post=366487:date=Oct 27 2009, 03:58 PM:name=ICEknight)--><div class='quotetop'>QUOTE (ICEknight @ Oct 27 2009, 03:58 PM) <a href="index.php?act=findpost&pid=366487">[​IMG]</a></div><div class='quotemain'><!--quotec--><!--quoteo(post=366460:date=Oct 27 2009, 09:15 AM:name=MarzSyndrome)--><div class='quotetop'>QUOTE (MarzSyndrome @ Oct 27 2009, 09:15 AM) <a href="index.php?act=findpost&pid=366460">[​IMG]</a></div><div class='quotemain'><!--quotec-->Has anyone noticed, btw, how Phantasy Star IV and Golden Axe III appear to be using unique European roms by the looks of it? They certainly don't match anything in the GoodGen or No-Intro sets.<!--QuoteEnd--></div><!--QuoteEEnd-->There's no European Phantasy Star IV ROM in the Goodset, to begin with. Which is strange, since that game was indeed released over here.
    <!--QuoteEnd--></div><!--QuoteEEnd-->
    And of course, anyone who still wanted to dump it could get one off eBay no problem, but expect to pay a fairly hefty sum for it (£30 minimum by the looks of things atm).
    <!--QuoteEnd--></div><!--QuoteEEnd-->

    I've got one right here - it runs perfectly in 60Hz mode so might in be that in fact it's just a UE ROM? I have no dumping equipment so can't confirm but surely someone must have dumped it? I could always get hold of a WAD for the EU VC version and compare the ROM to a known U one I suppose...
     
  14. ICEknight

    ICEknight

    Researcher Researcher
    The PAL ROM from the VC shows a later date in the header, so I'd say they changed some stuff after the US release.

    EDIT: Also, there's many differences in the rest of the ROM.