don't click here

Prototype I did some investigation on the prototype of the Game Gear conversion of Sonic 1

Discussion in 'Engineering & Reverse Engineering' started by Bellie, Nov 11, 2024.

  1. On December 7th, 2003, a prototype of the Game Gear conversion of the original Sonic the Hedgehog was leaked. It was only limited to Green Hill zone 1, as the game reset each time the score tally finished.
    Today I've taken to reverse-engineering this, as well as looking for any leftover data from the other stages. That was easy, as the RAM address that holds the current zone ID is the same between the Master System version and this prototype ($D23E).

    For starters, I disabled the code that reset the game. It was a simple jump to the beginning, so I just replaced that jump with nops. Turns out this also allowed access to the special stages.

    1. Special Stages
    The Special Stages (which seem more like bonus rounds in this game) are accessable, and they do have the iconic jolly music. However, don't count on finishing one, as they are more often than not a closed area, where Sonic can't pass. Additionally they don't have their graphics, which makes them take very long to load (which will be a common theme for most of the other stages). (EDIT: I initially believed the palettes were broken, however upon further investigation I realised they actually take from an otherwise-unused palette that almost mirrors the Master System version's.)

    Then I tried to pass to Green Hill zone 2 normally, but it looks like that just brings you back to zone 1 again. Damn Ancient and their failsafes!
    So, I resorted to using the cheat from now. 00D23E01 for Green Hill zone 2.

    2. Green Hill zone 2 just crashes the game on a black screen. (unless you patch the game, see here)

    3. Green Hill zone 3 just spawns you below some garbage tiles at the top and you fall into a pit and die.

    4. Bridge zone 1 just spawns you above a pit and you die.

    5. Bridge zone 2 spawns you inside some sort of hazard and you die instantly.

    6. Bridge zone 3 just spawns you above a pit and you die... well, if I'm to repeat this, this is going to be too repetitive... so from now on, assume any zones I don't mention here as just spawning you above a pit.

    7. Jungle zone 1 has some layout data left. You fall in water immediately after spawning, and there are some pits you can jump over. I don't consider this zone as very playable though, none of the zones besides Green Hill zone 1 are, of course.

    8. Jungle zone 2 has some layout data left, too. The code to scroll the screen up when you land already exists (or should I say still exists?), and some layout data is here (although you can't get very far).

    9. Jungle zone 3 is the first zone ID that resets to the title screen.

    10. Labyrinth zone 1 is a little playable. There's some layout data there, and water is revealed to be fully functional.

    11. Labyrinth zone 2 crashes to the title screen.

    12. Labyrinth zone 3 crashes on a black screen.

    13. Scrap Brain zone 1 is a little playable, but when you reach where the conveyor belts are in the original, you can no longer jump or spin, causing you to not be able to get the extra Sonic. If you jump on said monitor, you can get it, but then you'll be stuck spinning, but you can hold right to move. You can't reach the end of the zone, as the conveyor belt ends and you reach a pit and die.

    14. Scrap Brain zone 2 starts you higher than the camera. If you mindlessly move right you'll die, but you can wiggle your way out of that and bring the camera back to you. You can make out the crossroads, but the upper path brings death and the lower path makes you get stuck in collision.

    15. Sky Base zone 1 crashes on a black screen.

    16. Sky Base zone 2 crashes back to the title screen.

    17. Sky Base zone 3 does have its layout from the final boss fight, but the objects and scroll lock are missing, so you're as good as softlocked.

    18. Ending - Zone ID $12 corrupts the title card screen (unlike the other valid IDs, which either have their name, or, in the case of the zones that use the second Island graphics, just display a garbled name). As for the zone itself, the ending does play as intended (except for the graphics) until Sonic deals the final blow to Robotnik, at which point he falls down and dies.

    19. Final score addition - Zone ID $13 is misaligned and its palettes are broken, but the palette issue most likely is not a fault of missing data, but rather a mismatch of data where palettes formatted for the Master System are read by the Game Gear (which has its own palette system). It works, though, and even brings you into the credits!

    20. The credits screen is the same as the Master System version, from the palette, to the screen positioning, and even down to the fact it refers to itself as such!
    Sonic The Hedgehog (GG prototype)_000.png
    The screen works fine, aside from the obvious issues.

    21. Finale
    I've attached the modified ROM that removes the resetting. If I made any innaccuracies of any kind, I'd appreciate if you point it out. Have fun!
     

    Attached Files:

    Last edited: Nov 16, 2024
    • Like Like x 6
    • Informative Informative x 1
    • List
  2. I believe there is a patch out there that makes GHZ2 playable, barring a small graphical error with the spikes.

    EDIT: Change 0x155FE from C4 to B6 to fix GHZ2.
     
  3. interesting, I'll have to see what that does. thank you!
     
  4. Ravenfreak

    Ravenfreak

    Feeling festive this year Tech Member
    3,171
    248
    43
    O'Fallon Mo
    Hacking Sonic Drift
    Just want to say, I really enjoy seeing you hack the 8-bit games! It reminds me of when I first started looking into hacking them myself. :) I look forward to seeing if you find any other cool things in this prototype.
     
  5. haha sorry to disappoint, but I'm not so sure if I'll find anything more, or even how to find it. the most I know to do is to try the patch Alex sent, to which I'll report the results.
     
  6. I did an investigation on the second zone, with Alex Field's patch in place!
    Write-up
     
  7. If I had to guess, perhaps the Game Gear prototype has some incorrect pointers or bankswitches?
    This is really the only reason I could think of as I know nothing about Sonic 1 8-bit's codebase.
     
  8. I mean the idea of the zone art being removed is a guess, I don't think I have any way to find out for certain though as STH1EDWV is currently Master System only (and even if it did support the Game Gear release, there's no guarantee that it'd even support this prototype). I really should try to open the ROM in the editor, but no guarantees.
    edit: no luck opening the prototype in the editor; just results in an error.
     
  9. RavenFreak did attempt a disassembly of the Game Gear game, but it hasn't been updated in years. The only other alternative would be to go in with something like Ghidra (which is both free, and has native Z80 support) and try seeing what the byte change does to the code.
     
  10. oh right, I forgot about Ghidra! I should do that. luck has it that I've already got it on my PC.
    edit: I can't really make sense out of what Ghidra shows me. it seems like it's jumping to invalid data and maybe overflowing the stack or something? I think changing the $C4 to $B6 changes it from a `call` to an `or`, iirc.
     
    Last edited: Nov 16, 2024
  11. Ravenfreak

    Ravenfreak

    Feeling festive this year Tech Member
    3,171
    248
    43
    O'Fallon Mo
    Hacking Sonic Drift
    You'll need a plugin for Ghidra to be able to get the code to load properly, but honestly I couldn't get it to work right. Maybe it's because I tried on an older version and the plugin only works on a different revision? This is the plugin: https://github.com/VGKintsugi/Ghidra-SegaMasterSystem-Loader

    I use Emulicious to make my disassemblies, but recently I've had issues getting games to properly disassemble. Not sure why, I'm using Windows 11 and I informed the dev already too in the discord server so I'm just waiting on a response back from him. There's also SMSExamine, but it doesn't work on Windows 11. Needless to say if you're using Windows 11 you might be out of luck getting this to properly disassemble. If you've got a different operating system, Emulicious and or SMSExamine might work for you.
     
  12. ah, I see.. Emulicious might be my best bet then. thank you!