don't click here

Utility Sonic 2 - Simon Wai Disassembly

Discussion in 'Engineering & Reverse Engineering' started by Alex Field, May 21, 2022.

  1. Current Post (as of November 2022):
    A heavily modified version of Esrael's famous 2007 disassembly, with the following features and enhancements.
    • Converted to AS, allowing for more accurate building and AS-exclusive features.*
    • Sonic 2 Final-styled GitHub organization, labeling, constants and macros.
    • As of December 3, 2022, ALL levels in the game (barring empty pits) can be fully edited in SonLVL with the provided INI files, including all of their unique objects.
    • Disassembled sound driver and music (still needs documentation, and sound effects will need to be split so they won't break when shifted around).
    • A WIP Wiki, including information for hexadecimal level editing if you can't or (for whatever reason) don't want to use SonLVL.
    Download here!

    *OrionNavattan, who fixed errors from the conversion to AS, stated that a bit-perfect ROM currently isn't possible due to how the music and sound driver are split, as well as padding weirdness; however, everything up to $4EC6C is bit-perfect, so there shouldn't be any difference in gameplay.
    Original Post (May 2022):
    So, the last major disassembly of Sonic 2 Simon Wai was by SuperEgg and Nayr in 2012, and that version had several accuracy issues; the only accurate one was from Esrael, and that was from c. 2007.

    So why not post it to GitHub, port it to AS and update it?

    It's still a work-in-progress, however several objects and routines have been relabeled/tabbed, and some mappings split. The ROM itself still isn't identical, however the only differences come down to small byte differences, which itself is weirdness caused by the assembler (presumably) automatically enabling zero-offset optimization.

    Might as well mention some of the interesting things this prototype has:
    • The compression used for Green Hill Zone's chunks in the Nick Arcade build, and also Kid Chameleon is still present, albeit unused; I've decided to dub it "Chameleon Compression". It is another variation of the LZSS algorithm, and uses extreme unrolling to achieve fast decompression speeds.
    • Obj03 (path swappers) are coded in an... interesting way, using a table to determine which character is passing by it instead of the "lea" method.
    • The sound driver is already compressed with Saxman, but the music isn't; this confirms that the 68k version is the original, while the Z80-variant is a port.
    • The bizarre object in Slot $0F is also still present, and has the same effects; interestingly, the RAM address it changes was changed from $FFE9 to $FFD9.
    For some of the features it has:
    • Updated labels and variable names to be consistent with Sonic 2 Github.
    • SonLVL support; currently fully supports GHZ, HTZ and WZ (which has no unique objects... or objects at all), and partially supports MTZ.
    • Z80 sound driver disassembled (thanks, SuperEgg!).
    Last edited: Dec 3, 2022