don't click here

S2 Disassembly 2007

Discussion in 'Engineering & Reverse Engineering' started by Xenowhirl, Sep 28, 2007.

Thread Status:
Not open for further replies.
  1. Xenowhirl

    Xenowhirl

    Tech Member
    175
    0
    0
    That's right, here's a new Sonic 2 disassembly: s2dasm2007.zip

    The steps to build it are: Take a final sonic 2 rom from somewhere, name it s2.bin, stick it in the directory with split.bat and run that, then run build.bat. You don't have to download AS (that's included this time). The main file to edit is called s2.asm.

    Bullet points:
    - Unmodified, it assembles to be perfectly identical to Sonic 2 final, even with the unchanged (source) version of AS like the one I included, and it assembles fairly fast (1-5 seconds depending on the computer).
    - The Z80 sound driver is disassembled and integrated into the build process such that it gets assembled and compressed into the rom when you build. It uses labels from the 68k code to choose the correct pointers to use and banks to switch to, so you don't have to worry about breaking the sound by adding unrelated stuff anymore.
    - I identified more objects and addresses, split more things to file like the sprite mappings, added lots of comments, named some labels, added more equates, fixed disassembly mistakes here and there, etc. etc. just look at it already.

    Extra downloads (the above download is needed first in any case):
    Linux build tools
    Mac build tools
    s2.asm split into many little included asm files

    Enjoy.

    Thanks to shobiz for reviewing my changes and providing invaluable feedback and numerous suggestions, Puto for compiling the build tools for Linux and Mac and giving some suggestions, Tweaker for recommending I use Hivebrain's terminology and answering some questions that helped a little, Varion Icaria for answering some questions and showing me some labels, Hivebrain for his 2005 S1 disassembly, everyone behind the Sonic 2 articles on SCHG, everyone that contributed to Kens, and Nemesis and Aurochs and everyone who made the previous S2 disassembly possible.
     
  2. As I've said many times before, this is absolutely brilliant. The extra labeling and commenting makes the code a hell lot clearer, adding equates for SST values (and a lot of RAM values) was an excellent idea, and of course the numerous simplifying macros added make the code a lot cleaner (especially creditText, rom_ptr_z80 and levartptrs)
     
  3. Chimpo

    Chimpo

    I Gotta Be Me Member
    8,646
    1,507
    93
    Los Angeles, 2029
    Don't Forget! Try Your Best!
    Xenowhirl

    I love you man.

    No seriously, this pretty much confirms my decision to switch from S1 to S2 since I found the other disassemblies to be confusing as fuck. Fucking awesome.
     
  4. Puto

    Puto

    Shin'ichi Kudō, detective. Tech Member
    2,013
    0
    16
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    For the hell of it, here's the Win64 build tools. It seems to crash when "phase" is used though, so you'll have to change this to use pre-assembled Z80 init code if you use them, and there's not much of an advantage, if any, of using 64-bit tools vs the normal 32-bit ones. Still, it's here in case anyone is interested.
     
  5. Sonic Hachelle-Bee

    Sonic Hachelle-Bee

    Taking a Sand Shower Tech Member
    808
    201
    43
    Lyon, France
    Sonic 2 Long Version
    I'm using it starting now. Excellent work!
     
  6. Dracula

    Dracula

    Oldbie
    605
    0
    16
    I'm watching you!
    Converting NES Mappers to MMC5
    Awesome work! Makes me wanna hack again.
     
  7. Bibin

    Bibin

    DON'T LET THE SUN LAUGH AT YOU. Member
    881
    0
    0
    New York City
    Ghost in the Machine
    Hmm, something's not right, I split Sonic the Hedgehog 2 (W) (REV00).bin, renamed to s2.bin of course, and it gets to the sega screen, and 3 frames in it crashes and makes a strange little blip. The area all around the sega logo is blue also, and the sega logo is visible from the start.

    EDIT: Got it, I used REV001.
     
  8. I can't get this to build on my Kubuntu Linux 7.10 setup
    ./build.sh ends with the following output
    The same happens when I directly run ./asl from the linux folder

    Also when using a self compiled version of as from sources, I get the following:
    Any help would be appreciated.
     
  9. Puto

    Puto

    Shin'ichi Kudō, detective. Tech Member
    2,013
    0
    16
    Portugal, Oeiras
    Part of Team Megamix, but haven't done any actual work in ages.
    PROT_EXEC|PROT_WRITE? Have you tried chmodding the entire source dir to 755 or 777 or something?
     
  10. chmodding seems to have no effect.
    I assume its a problem with the asl executable because all the other binaries in the ./linux folder run.

    Edit:
    Fixed,
    I compiled asl from the latest source snapshot instead of the stable release.

    here is the working asl build in case anyone else experiences this problem.
    MegaUpload
     
  11. Quickman

    Quickman

    be attitude for gains Tech Member
    5,595
    18
    18
    :x
    omg porjcet
    For anyone else using the Linux build tools: you need to escape the space in the folder name "mappings/special stage" in s2.txt - just replace line 12 with this.
    Code (Text):
    1. #dir    "mappings/special stage"
    Afterthought: this might also work, though I haven't tried it.
    Code (Text):
    1. #dir    mappings/special\ stage
    (Note that I use a four-space tab; you should too, but if you care about neatness replace the four spaces in my example with a tab character.)
     
  12. Flygon

    Flygon

    Member
    Excuse me, does anyone know where I can get the project files for this Disasm?
     
  13. Get it on the dissasemblies wiki page, there should be another download there, or one that includes them.
     
  14. Flygon

    Flygon

    Member
    Thanks, I found it.

    It took me a while but I found it.
     
  15. Spanner

    Spanner

    The Tool Member
    Um...they are included with the disassembly in the "soned2proj" zipped folder.
     
  16. roxahris

    roxahris

    Everyone's a hypocrite. Take my word for it. Member
    1,224
    0
    0
    Doing anything at all
    Just thought I'd like to say that the Linux build tools, nor the normal version of AS, work for me. The ones up there ones are probably broke due to SURPRISE YOU HAVE A 64BIT PROCESSOR (No, really, I didn't know it was 64bit until Linux told me so), and the normal ones complain about the +s...
     
  17. Hi people, first proper post on these forums I'm using Windows XP 32-bit and I unpack the main .zip into a folder and just for a test run to make sure things are working I tried build.bat and got:

    macro assembler 1.42 Beta [Bld 55]
    (i386-unknown-win32)
    © 1992,2007 Alfred Arnold
    68RS08-Generator © 2006 Andreas Bolsch
    Mitsubishi M16C-Generator also © 1999 RMS
    XILINX KCPSM(Picoblaze)-Generator © 2003 Andreas Wassatsch
    TMS320C2x-Generator © 1994/96 Thomas Sailer
    TMS320C5x-Generator © 1995/96 Thomas Sailer

    assembling s2.asm
    PASS 1
    s2.macrosetup.asm(201)
    > > >s2.asm(3051): error: error in opening file
    > > > No such file or directory
    > > > BINCLUDE "art/palettes/Title Water.bin"; Title Screen Water palette (unu
    sed)
    fatal error, assembly terminated
    Press any key to continue . . .

    EDIT: Problem solved
     
Thread Status:
Not open for further replies.