Trying to VC inject Starflight (Genesis)

Discussion in 'Wii - Hacking' started by Dteyn, Jun 27, 2009.

Jun 27, 2009
  1. Dteyn
    OP

    Member Dteyn GBAtemp Fan

    Joined:
    Aug 3, 2008
    Messages:
    338
    Country:
    Canada
    I've been trying to inject the Starflight ROM into a Virtual Console but so far I've had no joy. I've used the directions in this thread to do the injection and banner and everything. EXCELLENT instructions by RadioShadow by the way, the Wad installs perfectly and it's so cool to see the proper banner for the game.

    Unfortunately when I try to load the game at the Wii menu, after clicking Start it just goes to a red screen. I've tried multiple wads (all of which work before injecting of course), and even tried using AutoInjectuWad Injector V3, all with the same results... WAD installs file but when trying to play it goes to a red screen. I even found two copies of the Starflight ROM (REV00 and REV01), tried both with the same results.

    My question is: should I give up? Does the red screen problem mean the VC method just ain't going to work? Or is it worth trying a couple more wads? So far I've tried injecting with Sonic 1, Sonic 3, Sonic Spinball, and Comix Zone.

    For now I've been playing Starflight using the Genesis GX emulator, which at least gives me a chance to play the game. Even though I know it's petty and vain, I would really love to play it as a VC title instead of the emulator.

    Anyone have suggestions?

    PS: If you've never played the game Starflight or Starflight II, you really owe it to yourself to try it. As a gamer it's one of the best games I've ever played, such an incredibly deep gameplay that in the past has kept me playing for months (literally!). SF2 is the only game I've ever had to keep a logbook for, to keep track of all the different things in the game... it sounds tedious but it's amazing. Basically you go around the universe to different galaxies, finding new planets to colonize, mining for minerals on distant planets, or trading goods with alien species. It's a game worth checking out for sure. You can get Starflight 1/2 for Windows/DOS/Mac/Genesis at this site.
     
  2. Juanmatron

    Member Juanmatron Slater Color

    Joined:
    Aug 5, 2008
    Messages:
    1,667
    Location:
    SEGA's World
    Country:
    Spain
    Why don´t use Genesis Plus GX to load the game?
     
  3. Dteyn
    OP

    Member Dteyn GBAtemp Fan

    Joined:
    Aug 3, 2008
    Messages:
    338
    Country:
    Canada
    If you actually read my post you'd see that's what I'm doing currently.

    I would like a way to inject it into a VC title however, since I prefer that over the emulator. Different quirks for different jerks. :P
     
  4. Ergo

    Member Ergo GBAtemp Advanced Fan

    Joined:
    Oct 29, 2008
    Messages:
    614
    Country:
    United States
    In my experience, Sonic 3D Blast is the best Genesis wad for injects, so you might want to give that a shot. (And, after it works, send me a link to it!)

    Also: do you know of a similar tutorial anywhere for Turbo CD games?
     
  5. RadioShadow

    Member RadioShadow GBAtemp Advanced Fan

    Joined:
    Aug 30, 2007
    Messages:
    525
    Location:
    UK
    Country:
    United Kingdom
    It is most likely the rom. The Wii Emulator is picky that if the checksum isn't correct, it won't load the rom (red screen of death). It would do the same on an actual Mega Drive (uisng a Flash Card).

    Unofficial emulators have an option to ignore the checksum, but with the Wii Emulator, you have to fix the checksum. There is a tool that can fix the checksum.

    I'll find the tool this evening and see if I can get it working myself.


    EDIT: Okay, I'm getting the same results as well. Not all MD roms are going to work and Starflight is one of them, even though the rom itself is fine.

    TMNT Hyper Stone Heist for example works but has no sound and Micro Machines doesn't boot at all, despite what WAD you inject it into.

    Simple put, you're out of luck.


    EDIT 2: I typed too soon. Injecting it into "Musha" works! [​IMG] Without sound... [​IMG]

    Now Musha has a patch file with "temporarily" changes the rom data loaded into the emulator. *looks into the file*


    EDIT 3: It has that problem with TMNT, the sound doesn't play which is due to an emulator issue of some kind. I do know however the patch in Musha skips the checksum, for some reason. This does fix the red screen of death problem in Starflight but no sound plays. [​IMG]

    If you want the MUSHA wad, feel free to send me an e-mail.
     
  6. Dteyn
    OP

    Member Dteyn GBAtemp Fan

    Joined:
    Aug 3, 2008
    Messages:
    338
    Country:
    Canada
    Thanks for the info RadioShadow, it helps to understand where the problem lies. By the way, just wanted to say great tutorial on Genesis WAD injections. It was super-easy to follow and works perfectly (so long as the ROM is compatible!), I was quite impressed. It feels really cool to install the WAD and then see the proper banner/title in the Wii menu, it makes it look so official! [​IMG]

    I'm just grabbing the MUSHA wad now, I'm gonna tinker with it a bit. I really hope it's possible in some way to get sound working. Maybe I'll try downloading some Sega ROM tools and try processing the ROM and see if it makes a difference. I already tried converting the .bin to .smd, but that just resulted in a black screen (obviously the emulator doesn't parse SMD format ROMs, just BIN format).

    Do you think there might be any way to get the sound working? I wonder if it's possible to put the patch from the MUSHA wad into another wad, so that it skips the ROM checksum on another wad. The thought being that perhaps another wad might work with sound, if the checksum could be skipped. The best candidate to try this with might be Sonic 3D Blast, as per Ergo's suggestion of it being the most compatible in his experience.

    Any thoughts?

    Edit: If I open up patch.zlib in the data.ccf file, it seems to be a text file with the patches listed. There is one commented as "skip check sum", and a bunch of other stuff that seems at first glance to be unrelated to skipping the checksum. Based on my past assembly experience, I'd bet that the simple patch of 0x602E to location 0x00031A is enough to disable the checksum. Maybe I'll put that one line into a file called "patch.zlib" and then put it into the Sonic 3D Blast wad. Maybe that will be enough to cause the Sonic 3D Blast wad to ignore the bad checksum and load the game. I'll give it a shot and report back with results.

    Edit 2: No joy yet... still tinkering though. [​IMG]
     
  7. Dteyn
    OP

    Member Dteyn GBAtemp Fan

    Joined:
    Aug 3, 2008
    Messages:
    338
    Country:
    Canada
    I did a bit more testing and here's what I've come up with.

    It seems like the patch included with MUSHA doesn't actually do anything to the Starflight ROM. I verified this by two methods, one is just by editing patch.zlib so that it says "# no patches" instead of the patch content. With the patch content removed, the game still loads in the same condition as with the patch code left in.

    Secondly, looking at the lines in the patch itself, it's comparing against the title ID of the ROM before patching. The patch itself contains two different patches, apparently for different versions of the MUSHA ROM (possibly JP version?). The first patch looks like this, I removed the garbled text (possibly Japanese but didn't show up as such on my screen):

    Code:
    >0x180ÂÂÂÂstringÂÂÂÂÂÂÂÂ"GM T-35013 -00"
    0x000332:
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x4e71 until 0x346
    
    # (garbled text removed)
    0x00b844:
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x4e71 x 3ÂÂÂÂÂÂÂÂ# nop
    
    
    # (garbled text removed)
    The second patch looks like this:

    Code:
    >0x180ÂÂÂÂstringÂÂÂÂÂÂÂÂ"GM T-35046 -00"
    
    0x00031a:
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x602eÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# skip check sum
    
    0x00058a:
    ÂÂÂÂbelongÂÂÂÂÂÂÂÂ0x0007ff00ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# jsr 0x004472 -> jsr 0x07ff00
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x4e71,0x4e71ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# ori.bÂÂÂÂ#$03,d0 -> nop; nop
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x4e71ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# moveq.l #$9a,d5 -> nop
    
    0x07ff00:
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x4eb8,0x4472ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# jsrÂÂÂÂ0x4472.w 
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x0000,0x0003ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# ori.bÂÂÂÂ#$03,d0
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x7a9aÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# moveq.l #$9a,d5
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x48e7,0x00c0ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# movem.l a0-a1,-(a7)
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x23fc,0x63e0,0x0000,0x00c0,0x0004ÂÂÂÂ# move.l $63e00000,$00c00004 
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x41fa,0x0046ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# lea.lÂÂÂÂ$0046(pc),a0 = 0x07ff60
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x43f9,0x00c0,0x0000ÂÂÂÂÂÂÂÂÂÂÂÂ# lea.l $00c00000,a1
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x2298ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# move.l (a0)+,(a1)
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x2298ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# move.l (a0)+,(a1)
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x2298ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# move.l (a0)+,(a1)
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x2298ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# move.l (a0)+,(a1)
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x2298ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# move.l (a0)+,(a1)
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x2298ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# move.l (a0)+,(a1)
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x2298ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# move.l (a0)+,(a1)
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x2298ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# move.l (a0)+,(a1)
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x23fc,0x6660,0x0000,0x00c0,0x0004ÂÂÂÂ# move.l $66000000,$00c00004 
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x41fa,0x0042ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# lea.lÂÂÂÂ$0042(pc),a0 = 0x07ff80
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x43f9,0x00c0,0x0000ÂÂÂÂÂÂÂÂÂÂÂÂ# lea.l $00c00000,a1
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x2298ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# move.l (a0)+,(a1)
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x2298ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# move.l (a0)+,(a1)
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x2298ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# move.l (a0)+,(a1)
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x2298ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# move.l (a0)+,(a1)
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x2298ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# move.l (a0)+,(a1)
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x2298ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# move.l (a0)+,(a1)
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x2298ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# move.l (a0)+,(a1)
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x2298ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# move.l (a0)+,(a1)
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x4cdf,0x0300ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# movem.l (a7)+,a0-a1
    ÂÂÂÂbeshortÂÂÂÂÂÂÂÂ0x4e75ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ# rts
    
    0x07ff60:
    ÂÂÂÂbelongÂÂÂÂÂÂÂÂ0xffffffff
    ÂÂÂÂbelongÂÂÂÂÂÂÂÂ0xffffffff
    ÂÂÂÂbelongÂÂÂÂÂÂÂÂ0xffffffff
    ÂÂÂÂbelongÂÂÂÂÂÂÂÂ0xffffffff
    ÂÂÂÂbelongÂÂÂÂÂÂÂÂ0xffffffff
    ÂÂÂÂbelongÂÂÂÂÂÂÂÂ0xdddddddd
    ÂÂÂÂbelongÂÂÂÂÂÂÂÂ0xdfffffff
    ÂÂÂÂbelongÂÂÂÂÂÂÂÂ0xdfffffff
    0x07ff80:
    ÂÂÂÂbelongÂÂÂÂÂÂÂÂ0xdfffffff
    ÂÂÂÂbelongÂÂÂÂÂÂÂÂ0xdfffffff
    ÂÂÂÂbelongÂÂÂÂÂÂÂÂ0xdfffffff
    ÂÂÂÂbelongÂÂÂÂÂÂÂÂ0xdfffffff
    ÂÂÂÂbelongÂÂÂÂÂÂÂÂ0xdfffffff
    ÂÂÂÂbelongÂÂÂÂÂÂÂÂ0xdfffffff
    ÂÂÂÂbelongÂÂÂÂÂÂÂÂ0xcccccccc
    ÂÂÂÂbelongÂÂÂÂÂÂÂÂ0xdddddddd
    The first line of each patch, >0x180, seems to be comparing with line 0x180 in the ROM. If it matches, then the patch proceeds. In this case it's looking for "GM T-35013" or "GM T-35046", the latter being the title ID of the MUSHA ROM. However when looking at the Starflight ROM, the title ID is "GM T-50216". Because this doesn't match, the emulator doesn't apply the patch to the ROM.

    Before I figured out the patch data wasn't relevant to Starflight working, I took the patch data for the 35046 patch and applied it to the Musha ROM, then disassembled the clean and patched ROMs using IRA. Looking at the disassembly I can see where the patch skips certain sections of code that at first glance definitely seem to be related to checksums. That being said it's strange that the patch has no effect on the Starflight ROM, I also disassembled it and couldn't find any similar routines as the ones that are patched in the Musha ROM.

    So anyways, if it's not the patch that makes it work... it must be something else entirely.

    I'll keep digging!

    PS: As an interesting sidenote, I noticed the name of the ROM file inside the WAD can be changed, so long as you edit the romfile entry inside the config file. For example, instead of renaming the Starflight ROM to "MushaAleste_USA.SGD.zlib", I changed it to "Starflight_USA.SGD.zlib" and then opened up config, changed the romfile entry to point to Starflight_USA.SGD instead of MushaAleste_USA.SGD. I tested this and it works perfectly, I think it's a nice touch and makes the WAD look more "official" if someone unpacks it in the future. [​IMG]
     
  8. Dteyn
    OP

    Member Dteyn GBAtemp Fan

    Joined:
    Aug 3, 2008
    Messages:
    338
    Country:
    Canada
    Alright, after doing some more digging I've discovered there are 12 different VC emulator programs among the 25 Genesis WADs that I have. I extracted each WAD and copied the 00000001.app (the emulator executable) from each WAD. There are several WADs that use the same emulator program, which means to test every emulator program it would be useless to test every single WAD. Rather, I'll test WADs based on a unique 00000001.app as per the following list:

    Code:
    05c0c1ab4304d0efb4dec4f13a6dc291 - 1,575,264 bytes - Sonic the Hedgehog 2
    
    15b534d6f8e8efe917f15a1e6d445940 - 1,443,584 bytes - Altered Beast
    15b534d6f8e8efe917f15a1e6d445940 - 1,443,584 bytes - Columns
    15b534d6f8e8efe917f15a1e6d445940 - 1,443,584 bytes - Ecco the Dolphin
    15b534d6f8e8efe917f15a1e6d445940 - 1,443,584 bytes - Gunstar Heroes
    15b534d6f8e8efe917f15a1e6d445940 - 1,443,584 bytes - Mean Bean Machine
    15b534d6f8e8efe917f15a1e6d445940 - 1,443,584 bytes - Ristar
    15b534d6f8e8efe917f15a1e6d445940 - 1,443,584 bytes - Sonic the Hedgehog 1
    15b534d6f8e8efe917f15a1e6d445940 - 1,443,584 bytes - Toe Jam and Earl 1
    
    1afc9246e73b784eb193f84f26b56c9e - 1,572,704 bytes - Kid Chameleon
    1afc9246e73b784eb193f84f26b56c9e - 1,572,704 bytes - Streets of Rage 2
    
    33f003df886825ec8b7c1ee2bb5b35e5 - 1,442,400 bytes - Phantasy Star 3
    
    4eed5ce9253eb5834ff4d55d531c519a -ÂÂ 739,008 bytes - MUSHA
    
    58e20d6a2610db287d41371a93b23f4b - 1,591,296 bytes - Sonic Spinball
    58e20d6a2610db287d41371a93b23f4b - 1,591,296 bytes - Streets of Rage 1
    58e20d6a2610db287d41371a93b23f4b - 1,591,296 bytes - Sword of Vermillion
    
    5af9169cb834bb2e727a257234a1cea2 - 1,575,328 bytes - Shining in the Darkness
    
    8f112fff907d017f51a4a096eec67696 - 1,606,336 bytes - Alien Soldier
    8f112fff907d017f51a4a096eec67696 - 1,606,336 bytes - Sonic 3D Blast
    
    c2d31b4cd04c69fb50b78cc383037143 - 1,577,536 bytes - Comix Zone
    
    ea1c2f087d2227ecfb160bba9ae9ed46 - 1,576,384 bytes - Landstalker
    ea1c2f087d2227ecfb160bba9ae9ed46 - 1,576,384 bytes - Sonic the Hedgehog 3
    
    ecc9800768a6f7dc0097f3265cd2fcfc - 1,643,392 bytes - Phantasy Star 2
    
    ef5de7a4cb3863462c32526a4780cbc0 - 1,574,048 bytes - Ecco the Dolphin II
    ef5de7a4cb3863462c32526a4780cbc0 - 1,574,048 bytes - Toe Jam and Earl 2
    Interestingly, the Emulator app for the MUSHA WAD is about half the size of the rest. Other than Phantasy Star 3, it's also the only Genesis WAD I have that includes a 00000007.app file. For anyone who's following along and is curious, here's what each app file contains:

    00000000.app - Contains the Banner, Icon, and Title information
    00000001.app - Contains the emulator executable
    00000002.app - Contains wwwlib-rvl.lz7, seems to be compressed web info. Possibly required to view the game manual.
    00000003.app - Contains a TTF font library called WiiNTLG-Regular
    00000004.app - Contains the information for the Home Button menu
    00000005.app - Contains the ROM, save icons, and game manual
    00000006.app - ??? (possibly an extension to the emulator executable)
    00000007.app - ??? (possibly an extension to the emulator executable)

    That's about it for now. Now I'm off to test the different VC emulator executables. [​IMG]
     
  9. Dteyn
    OP

    Member Dteyn GBAtemp Fan

    Joined:
    Aug 3, 2008
    Messages:
    338
    Country:
    Canada
    Well I tested all the WADs with a unique VC emulator 00000001.app, unfortunately they all have the red screen except MUSHA. I don't have any Japanese WADs and my collection is far from complete, so there are likely some other Genesis WADs out there with different emulator apps.

    If anyone out there with a larger or complete WAD collection is willing to do some testing, that would be great. Basically just extract all the wads using wwunpacker, and check the md5sum of the 00000001.app file. If it's not on the list above, please post the md5sum and the name of the WAD it's from.

    I'm not sure where to go from here... maybe I'll try taking the 00000001.app/00000006.app files from other WADs and putting them in the MUSHA WAD file to see if the sound will work. It's starting to look bleak, given that the game loads I really wish it would work with sound... it's a real shame, Starflight is a fantastic game!
     
  10. Category

    Member Category Trainee Romhacker

    Joined:
    Jan 29, 2008
    Messages:
    233
    Location:
    Bournemouth
    Country:
    United Kingdom
    I feel awful for bringing back a dead thread, but I love starflight, and am personally working on a romhack of it myself.

    I had problems getting it to boot properly, due to the fact that EA slipped their own checksum routine in. This may affect loading through VC, but you can go here to see how to disable it in the ROM - wboy's EA checksum fix.

    Second problem, is you seem to be injecting it into games without any SRAM. Starflight relies strongly on the SRAM save feature, that will always fail if the emulator isn't expecting it.


    Like I said, apologies for reviving a dead thread, just hope Dteyn sees it! (And PM me about your WAD if you get it working ;) )
     
  11. rooskie54

    Member rooskie54 GBAtemp Regular

    Joined:
    Jan 4, 2009
    Messages:
    282
    Country:
    United States
    "Dteyn was last seen: Sep 4, 2011"

    Maybe he'll stumble across this, but it's been almost 2 years since he logged into his account here.
     

Share This Page