Sonic 2 split disassembly help

Discussion in 'Discussion and Q&A Archive' started by Unspoken, Dec 6, 2007.

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

    Unspoken Well-Known Member Member

    Joined:
    Aug 10, 2007
    Messages:
    64
    In Sonic 2 as soon as you jump with 50 rings you transform, How would I modify it to be like the S3-K series where you have to press the button twice.


    I have haven't used a disassembler in a while :p
     
  2. Sephiroth

    Sephiroth WHY SO CURIOUS?!? Member

    Joined:
    Aug 11, 2007
    Messages:
    507
    Location:
    Qatar, M.E.
    Wouldn't it be a simple command to check to see if either a, b, or c are being pressed? You can have a look at the jumping or spindash code and work it out from there, and placeing that bit of code AFTER the 50 ring check and the 7 Emerald check. Should be easy. I'm gonna write up a guide later, possibly, if I can be bothered. Although I might edit this post later with the right code, so watch this space.
     
  3. Unspoken

    Unspoken Well-Known Member Member

    Joined:
    Aug 10, 2007
    Messages:
    64
    Wheres Sonic's spin dash coding located?, Dam I can't believe after a few months my minds gone completely blank :p
     
  4. shobiz

    shobiz Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    198
    Location:
    Karachi, Pakistan
    If you're using Xenowhirl's disassembly (which you should be), the code starts with Sonic_CheckSpindash.


    As for the Super Sonic think, the simplest way of doing it is probably going to Sonic_JumpHeight, and in the last part of it, changing the



    Code:
    	tst.b	y_vel(a0)	&#59; is Sonic exactly at the height of his jump?
    
    	beq.s	Sonic_CheckGoSuper&#59; if yes, test for turning into Super Sonic


    to





    Code:
    	move.b	(Ctrl_1_Press_Logical).w,d0
    
    	andi.b	#$70,d0&#59; is A or B or C pressed?
    
    	bne.s	Sonic_CheckGoSuper&#59; if yes, test for turning into Super Sonic
     
  5. Unspoken

    Unspoken Well-Known Member Member

    Joined:
    Aug 10, 2007
    Messages:
    64
    Nope, I have an older version that looks like this


    loc_1AB1A: ; CODE XREF: h+3B96j h+3BA0j


    tst.b $12(a0)


    beq.s loc_1AB38


    rts


    So would the above code you provided still work?
     
    Last edited by a moderator: Dec 8, 2007
  6. Sephiroth

    Sephiroth WHY SO CURIOUS?!? Member

    Joined:
    Aug 11, 2007
    Messages:
    507
    Location:
    Qatar, M.E.
    Wow, your one of the few that is still working with the Nemesis Disassembly. Still, I'll se what I can do.
     
  7. Spanner

    Spanner The Tool Member

    Joined:
    Aug 9, 2007
    Messages:
    2,570
    The 2007 disassembly's very good, faster building, cross-platform, art can be swapped easily, comes with project files for SonED2 & it has the sound driver in a separate file. You should try it, you'll love it.


    I should ask though, will there be any plans to do a Sonic 1 Sound Driver to Sonic 2 guide with the 2007 disasm?
     
  8. Sephiroth

    Sephiroth WHY SO CURIOUS?!? Member

    Joined:
    Aug 11, 2007
    Messages:
    507
    Location:
    Qatar, M.E.
    *adds to things to do list*


    Since I'm working with it, I might as well have a crack at it aswell.....
     
  9. shobiz

    shobiz Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    198
    Location:
    Karachi, Pakistan
    It really shouldn't be too hard to port it in the 2007 disassembly, the only things that would probably require changing would be some label names. However, I've never tried porting the Sonic 1 sound driver across, so I could be completely wrong.
     
  10. Unspoken

    Unspoken Well-Known Member Member

    Joined:
    Aug 10, 2007
    Messages:
    64
    When I try to build the 2007 version I get a error.


    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 (unused)


    fatal error assembly terminated.


    If I can get it to work that will be great, Just for the record how would I do it in the older version I mentioned.
     
    Last edited by a moderator: Dec 8, 2007
  11. shobiz

    shobiz Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    198
    Location:
    Karachi, Pakistan
    You've split the ROM before attempting to compile it right? I can't think of any other cause for the file being missing (unless of course you deleted it, which I doubt).


    To use the code in Nemesis' disassembly, just change the Sonic_CheckGoSuper to loc_1AB38
     
  12. Tweaker

    Tweaker OI! MIRON! Member

    Joined:
    Aug 10, 2007
    Messages:
    324
    You don't even have to - when you look up the routines, just look up the "loc_xxx" label names and it'll lead you right to the new routine. Just change your references to that and you're set. This is what I did when I ported it to the 2007 disassembly.


    (In addition, I also used the leftover code to load the S1 sound driver instead of making a new one. Leftovers FTW!)
     
  13. Spanner

    Spanner The Tool Member

    Joined:
    Aug 9, 2007
    Messages:
    2,570
    I keep on getting addressing mode not allowed on build.bat, what am I doing wrong?
     
  14. shobiz

    shobiz Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    198
    Location:
    Karachi, Pakistan
    Well, what line does the error occur on? What are the contents of that line?
     
  15. Sephiroth

    Sephiroth WHY SO CURIOUS?!? Member

    Joined:
    Aug 11, 2007
    Messages:
    507
    Location:
    Qatar, M.E.
    Oh man, I get this problem all the time.


    The main thing is that it is ALWAYS with a cmp command (well with me, at least) and somehow I fix it, but I can't remember how I do it.
     
  16. Unspoken

    Unspoken Well-Known Member Member

    Joined:
    Aug 10, 2007
    Messages:
    64
    I thought I had but th split.dat screen disappears before I could read it, I used the print screen button at the right moment and it sais


    ERROR: Couldn't open romfile "s2.bin".


    It's a clean unmodified rom named correctly, tried another one just incase and same problem.


    Also I did as you mentioned and It doesn't work.


    move.b (Ctrl_1_Press_Logical).w,d0


    andi.b #$70,d0; is A or B or C pressed?


    bne.s loc_1AB38
     
    Last edited by a moderator: Dec 9, 2007
  17. shobiz

    shobiz Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    198
    Location:
    Karachi, Pakistan
    Hmm, try renaming the file to just "s2" - maybe the file extensions are screwing up.

    Oops - you're supposed to change the Ctrl_1_Press_Logical to $FFFFF603 as well.
     
    Last edited by a moderator: Dec 9, 2007
  18. Unspoken

    Unspoken Well-Known Member Member

    Joined:
    Aug 10, 2007
    Messages:
    64
    Got the 2007 version working, thanks.
     
    Last edited by a moderator: Dec 9, 2007
  19. Spanner

    Spanner The Tool Member

    Joined:
    Aug 9, 2007
    Messages:
    2,570

    Code:
    VintRet:
    
    	jsr	Init_Sonic1_Sound_Driver; Esrael L. G. Neto
    
    	addq.l	#1,($FFFFFE0C).w
    
    	movem.l	(sp)+,d0-a6
    
    	rte
    Results in:


    [​IMG]


    This is just after doing the 1st step of the guide on VintRet (loc_45E on Nem's disasm), don't know what I'm doing wrong.
     
    Last edited by a moderator: Dec 9, 2007
  20. shobiz

    shobiz Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    198
    Location:
    Karachi, Pakistan
    Well, as far as I can tell, AS is just complaining that you've referenced Init_Sonic1_Sound_Driver, which doesn't exist yet. Try following the whole guide and then compiling. The other errors are just a consequence of the first one, so if that is fixed the others should fix themselves.
     
Thread Status:
Not open for further replies.