don't click here

Socket disassembly

Discussion in 'Technical Discussion' started by GenesisFan64, Sep 17, 2010.

  1. GenesisFan64

    GenesisFan64

    The bright side of the dark side. Member
    108
    0
    16
    Hello everyone,

    This is my dissassembly of that Sonic clone, Socket.
    is not fully optimized yet (because I need to check the sound driver stuff), but still compiles just like the original ROM

    This game uses a compression format that MarkeyJestey was capable to crack it for me (in IRC), <strike>but I need his permission to release his program here...</strike>
    I hope someone gets interesed on hacking this game...

    <a href="http://theocas.net/fs/u/4c93e6806af8d2.48696076_Socket_disasm.zip" target="_blank">Download</a>

    <strike> EDIT: Sorry if it's the wrong forum, this is my first time posting a new topic here in Retro... </strike>

    EDIT 2: Here's the decompressor: <a href="http://theocas.net/fs/u/4c95021b40c180.00035551_MJs_Socket_decomp.zip" target="_blank">Download</a>, thanks MarkeyJester for allowing me to release your tool...

    How to use:
    <ul><li>Find the compressed data (ex. "unk_901E0")</li><li>Copy the ASM data to a new .asm file</li><li>Assemble the asm file with asm68k, and in command line: asm68k /p "<YourCmpDataASM>.asm", "Input.bin" </li><li><strike>Open the built file in a hex editor and delete the first $400 bytes, then Save</strike></li><li>Open decomp.exe</li><li>Done, see "Output.bin"</li></ul>

    EDIT 3: I was wrong, don't delete the first $400 bytes
     
  2. Ravenfreak

    Ravenfreak

    I dunno what I should put here. Tech Member
    2,999
    127
    43
    O'Fallon Mo
    Hacking Sonic Drift, Writer at Sonic Cage Dome
    I downloaded this because I wouldn't mind hacking a game besides Sonic, though I have never played Socket before. Awesome job, and I hope you can get the sound driver data implemented soon. ^_^
     
  3. theocas

    theocas

    Tech Member
    346
    0
    16
    Awesome this be. I might be able to port some pretty interesting stuff from here!
     
  4. TmEE

    TmEE

    Master of OPL3-SA2/3 Tech Member
    1,726
    1
    18
    Estonia, Rapla City
    T-04YBSC-A !
    I hate how people call it Sonic clone...

    but other than that, kickarsch work :)
     
  5. GenesisFan64

    GenesisFan64

    The bright side of the dark side. Member
    108
    0
    16
    <strike>LAST TRIAL MEMBER POST</strike>
    EDIT: Thank you Retro.

    IDB update (.asm included):
    <a href="http://theocas.net/fs/u/4ca0f93a48b699.15660144_Socket_disasm_27sep10.zip" target="_blank">Download</a>
    <ul><li>Removed original ROM (I actually forgot to delete it in the first release by accident)</li><li>Modified some arrays, for example...
    Before:
    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='codemain'><!--eg1--><pre class="asm" style="font-family:monospace;"> <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">11</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">0</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">4F</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">b</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">16</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">3</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">l</span> Txt_PRESSSTART</pre><!--gc2--><!--CSAgICAgICAgZGMudyAmIzAzNjsxMQoJCWRjLncgMAoJCWRjLmIgJiMwMzY7NEYKICAgICAgICAgICAg
    ICAgIGRjLmIgJiMwMzY7MTYKICAgICAgICAgICAgICAgIGRjLncgMwoJCWRjLmwgVHh0X1BSRVNTU1RBU
    lQ=--><!--egc2--><!--g2--></div><!--eg2-->
    After:
    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='codemain'><!--eg1--><pre class="asm" style="font-family:monospace;"> <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">11</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">0</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">l</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">4F160003</span> <span style="color: #adadad; font-style: italic;">;Full VDP Address</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">l</span> Txt_PRESSSTART</pre><!--gc2--><!--CSAgICAgICAgZGMudyAmIzAzNjsxMQoJCWRjLncgMAoJCWRjLmwgJiMwMzY7NEYxNjAwMDMJO0Z1bGwg
    VkRQIEFkZHJlc3MKCQlkYy5sIFR4dF9QUkVTU1NUQVJU--><!--egc2--><!--g2--></div><!--eg2--></li></ul>

    <!--quoteo(post=508313:date=Sep 20 2010, 07:13 AM:name=TmEE)--><div class='quotetop'>QUOTE (TmEE @ Sep 20 2010, 07:13 AM) <a href="index.php?act=findpost&pid=508313">[​IMG]</a></div><div class='quotemain'><!--quotec-->I hate how people call it Sonic clone...<!--QuoteEnd--></div><!--QuoteEEnd-->
    Me too.
     
  6. GenesisFan64

    GenesisFan64

    The bright side of the dark side. Member
    108
    0
    16
    *double post*

    <a href="http://theocas.net/fs/u/4cb63c584bf8a3.40559629_SocketPlay.bin" target="_blank">SocketPlay</a>
    Inspired by the lukeusher123's GEMS playback ROM
    Press <- and -> to change the sound ID, ( C ) to play

    But, seriously... is anyone here interested on hacking this game?

    Edit: <a href="http://theocas.net/fs/u/4cb647fd8e4c82.22525407_SocketPlay_src.zip" target="_blank">Source code</a>
     
  7. Ravenfreak

    Ravenfreak

    I dunno what I should put here. Tech Member
    2,999
    127
    43
    O'Fallon Mo
    Hacking Sonic Drift, Writer at Sonic Cage Dome
    ^ I'm interested, especially since I just played it for the first time yesterday. :v: Also, I downloaded the entire OSV of Socket before you released your rom. xD Awesome job with that btw. I've been identifying RAM addresses and such and I'm documenting them just in case someone needs them. ^_^
     
  8. Eduardo Knuckles

    Eduardo Knuckles

    Not a loved one, but the most hated person. Misfit
    414
    10
    18
    Someplace somewhere
    Project S.A.M.G.
    Fantastic. I could already expect this by looking that you're really a fan of this game (like myself). Could PLEASE someone start working on a editor or something like this? (Just suggesting)... Edit levels with ASM or pure binary is a bit boring.
    Well, I downloaded the stuff. So I can look it with better eyes before my next post.

    EDIT: In addtion, I noticed that the source needs a bit more of organization for the level layout stuff and more. So, I'm offering my help on this.
     
  9. theocas

    theocas

    Tech Member
    346
    0
    16
    I'd love to port some shiz around from Socket to Sonic, but the big question is the art - does Markey's Decompressor just output uncompressed art that I can then Nemesis compress, or what?

    EDIT: Where is all the level art in the disasm? I really want my .bin files D:

    <!--quoteo(post=517267:date=Oct 14 2010, 04:53 AM:name=Eduardo Knuckles)--><div class='quotetop'>QUOTE (Eduardo Knuckles @ Oct 14 2010, 04:53 AM) <a href="index.php?act=findpost&pid=517267">[​IMG]</a></div><div class='quotemain'><!--quotec-->Fantastic. I could already expect this by looking that you're really a fan of this game (like myself). Could PLEASE someone start working on a editor or something like this? (Just suggesting)... Edit levels with ASM or pure binary is a bit boring.
    Well, I downloaded the stuff. So I can look it with better eyes before my next post.

    EDIT: In addtion, I noticed that the source needs a bit more of organization for the level layout stuff and more. So, I'm offering my help on this.<!--QuoteEnd--></div><!--QuoteEEnd-->
    I might as well code an editor sometime in the future, it depends on how I'm feeling :P
     
  10. roxahris

    roxahris

    Everyone's a hypocrite. Take my word for it. Member
    1,224
    0
    0
    Doing anything at all
    This game has excellent music. Of course, considering it was done by the same people as Battle Mania Daiginjou, that's hardly a surprise.

    I wonder how the physics simulation in this game compares to Sonic's?
     
  11. Ritz

    Ritz

    Subhedgehog Member
    4,062
    86
    28
    Physics simulation in Socket is practically nonexistent.

    The game's not half bad, though! It'd be cool to see someone do something with this, but I imagine it'll go down about as well as drx's Ristar level editor. I can't believe no one's even tried the damn thing.
     
  12. GenesisFan64

    GenesisFan64

    The bright side of the dark side. Member
    108
    0
    16
    *Bump*

    Ok, I returned hacking Socket again.
    And this time, I started to see how the Sound driver works...

    Code (Text):
    1. $3392A - Music pointers (each pointer: [WORD, little-endian])
    2.  
    3. To find a song location: (For example, Title Screen = $01)
    4.  - Find the WORD (Which is $2401)
    5.  - Reverse the value ($0124)
    6.  - And calculate: $3392A + $0124 = $33A4E <- the result
    7.  
    8. < SONG HEADER FORMAT >
    9. $xxyyyy =
    10. &nbsp;&nbsp;- xx - unknown [BYTE]
    11. &nbsp;&nbsp;- yyyy - music data location [WORD, little-endian]
    12. &nbsp;&nbsp;&nbsp;&nbsp;Calculate $3392A+yyyy (Reverse yyyy first)
    13. &nbsp;&nbsp;&nbsp;&nbsp;(Repeats for 10 [$A] times, Each pointer is used for the respective channel [FM1-5,DAC,PSG1-3,NOISE])
    (˄ Updated, x2)

    And a update to SocketPlay:
    [​IMG]
    <a href="http://theocas.net/fs/u/4d50c9ee3c2941.53823789_SocketPlay.bin" target="_blank">Download</a>
     
  13. Ravenfreak

    Ravenfreak

    I dunno what I should put here. Tech Member
    2,999
    127
    43
    O'Fallon Mo
    Hacking Sonic Drift, Writer at Sonic Cage Dome
    It's great to see you're still working on this GF64. ^_^ But I wish I released those notes I took before my HDD decided to crash. :( If and when I recover my data, I'll post them.
     
  14. GenesisFan64

    GenesisFan64

    The bright side of the dark side. Member
    108
    0
    16
    More...

    Code (Text):
    1. Coordination flag list:
    2.  
    3. $00-$50 - Wait for next note
    4. $60-$6F - Notes (C-x, C#x, etc.)
    5. $70-$7F - Same as $60-$6F, "long note"
    6. $91-$98 - Pitch (x-0, x-1, etc.), ignored by NOISE
    7.  
    8. $F1xxxxyy - Set volume xxxx, echo yy
    9. $F8 - end of data
    10. $FCxx - Voice select (FM), PCM Sound (DAC), PSG Type (PSG), NOISE Type (NOISE)
    11. $FDxx - channel tempo
     
  15. MarkeyJester

    MarkeyJester

    Time to Grow Up. Resident Jester
    2,127
    253
    63
    Japan
    Some interesting research, it looks like quite a reasonably similar engine to SMPS, have you considered documenting this information on the wiki somewhere? These are solid results after all.

    keep up the good research!
     
  16. theocas

    theocas

    Tech Member
    346
    0
    16
    Holy shit, that's pretty solid info you got there... especially that SocketPlay ROM. But yeah, I second Markey's suggestion. Document this before it gets lost and everyone blows up and whine that the can't find shit. Good work!
     
  17. GenesisFan64

    GenesisFan64

    The bright side of the dark side. Member
    108
    0
    16
    *Bump*

    ANOTHER update: <a href="http://theocas.net/fs/u/4db528ba4dfbf9.91563215_Socket_disasm_25abr11.zip" target="_blank">Download</a> (IDB and ASM)

    The changes (Sound driver only):
    <ul><li>More labelling (ex. Array of FM and PSG notes)</li><li>Added true locations of the Music/SFX in SndDrv_SndList
    Example:
    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='codemain'><!--eg1--><pre class="asm" style="font-family:monospace;">SndDrv_SndList: <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">1</span> <span style="color: #adadad; font-style: italic;">; $33A2A</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">2401</span> <span style="color: #adadad; font-style: italic;">; $33A4E</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">2C06</span> <span style="color: #adadad; font-style: italic;">; $33F56</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">3B0C</span> <span style="color: #adadad; font-style: italic;">; $34565</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">FC11</span> <span style="color: #adadad; font-style: italic;">; $34B26</span>
    <span style="color: #00bfff;">dc</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">$</span><span style="color: #ff0000;">6216</span> <span style="color: #adadad; font-style: italic;">; $34F8C</span>
    <span style="color: #adadad; font-style: italic;">;...</span></pre><!--gc2--><!--U25kRHJ2X1NuZExpc3Q6CWRjLncgMQkJCTsgJiMwMzY7MzNBMkEKCQlkYy53ICYjMDM2OzI0MDEJCTsg
    JiMwMzY7MzNBNEUKCQlkYy53ICYjMDM2OzJDMDYJCTsgJiMwMzY7MzNGNTYKCQlkYy53ICYjMDM2OzNCM
    EMJCTsgJiMwMzY7MzQ1NjUKCQlkYy53ICYjMDM2O0ZDMTEJCTsgJiMwMzY7MzRCMjYKCQlkYy53ICYjMD
    M2OzYyMTYJCTsgJiMwMzY7MzRGOEMKCQk7Li4u--><!--egc2--><!--g2--></div><!--eg2--></li></ul>
     
  18. GenesisFan64

    GenesisFan64

    The bright side of the dark side. Member
    108
    0
    16
    *MEGA Bump* and *double post*

    Guess who turns 19 today?...

    So yeah, here's new stuff:

    Updated Socket diassembly
    • GRC Sound driver is more commented
    • Label changes
    NOTE: If you open the .idb and export to .asm, you'll have to fix the instructions that IDA did wrong:

    find "<-- FIX"
    and on that line, replace from:
    jsr -LABEL-
    to
    jsr (-LABEL-).w

    Do the same thing to the others, I recommend using "Replace All", because there's a lot of them
    the ASM file is already fixed and ready to use.

    Mini Hack: Socket "alternate" ending
    It's the ending... but with an alternate song, "Sun Rise Purple" from Battle Mania Daiginjou ("Trouble Shooter Vintage")

    GRC Driver dissasembly
    Disassembly of the GRC Driver only, it can be assembled to a ROM to try on emulator.

    GRC Driver disassembly, alternate z80 driver
    The same thing as the other, but with a custom z80 driver, from smps (it's still buggy)

    Another note: This game is MINE... I mean, I'm the first one who hacked it, if you want to make a Socket hack, credit me if you can, it took a lot to me to document the locations and adresses
    If someone is interested on making like a "...toGRC" converter, ask me for the format

    Happy Socket anniversary
     
  19. redhotsonic

    redhotsonic

    Also known as RHS Tech Member
    1,587
    9
    18
    United Kingdom
    YouTuber
    Have I got to sign up and install Google drive to download the disassembly? Seems like it =/
     
  20. GenesisFan64

    GenesisFan64

    The bright side of the dark side. Member
    108
    0
    16