don't click here

S2:AE update topic/ rika needs help topic

Discussion in 'Engineering & Reverse Engineering' started by Rika Chou, May 4, 2006.

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

    drx

    mfw Researcher
    2,254
    350
    63
    :rolleyes:
    $14 is just an offset of a memory address. Changing $14 will change what will be increased by $40 :P
     
  2. SMTP

    SMTP

    Tech Member
    My bad then.... =P
     
  3. StephenUK

    StephenUK

    Liquor in the front, poker in the rear Tech Member
    1,678
    0
    16
    Manchester, UK
    Quackshot Disassembly
    Try setting $14(a1) as low as #3, and see if it has any effect. If not, I'll look into it a bit more. Been quite a while since I touched it.
     
  4. Rika Chou

    Rika Chou

    Tech Member
    5,276
    169
    43
    Still seemingly no effect. =/
     
  5. StephenUK

    StephenUK

    Liquor in the front, poker in the rear Tech Member
    1,678
    0
    16
    Manchester, UK
    Quackshot Disassembly
    I'll look into it in a clean disassembly for you and see what I can do. Steepness of the slope would effect it as well.
     
  6. Rika Chou

    Rika Chou

    Tech Member
    5,276
    169
    43
    Thanks, I appreciate it.
     
  7. Rika Chou

    Rika Chou

    Tech Member
    5,276
    169
    43
    Got another small question now...

    How do I change Sonic's height while he is ducking? I noticed that he is the same height while he is ducking as he is while he is standing.
     
  8. ICEknight

    ICEknight

    Researcher Researcher
    Are you completely sure? I thought you could duck in order to avoid the spikeballs thrown by one of Labyrinth's orbinauts...

    EDIT: The orbinaut in question is in act 2, around coordinates 0BCC 05E2. Sonic can indeed use this height change to his advantage, althought the "look down" function makes it a bit awkward.
     
  9. Rika Chou

    Rika Chou

    Tech Member
    5,276
    169
    43
    Yeah, you're right. Sonic can seem to avoid damage while ducking. However, this is my problem:

    [​IMG]

    Sonic is being pushed to the left as the platform moves right. Sonic can only make it through when I lower it enough where he can stand.
     
  10. Rika Chou

    Rika Chou

    Tech Member
    5,276
    169
    43
    I am still having trouble with this, so bump.
     
  11. stormislandgal

    stormislandgal

    It's not a phase! Tech Member
    4,534
    10
    18
    Married life <3
    I think somewhere in Sonic's SST there is a value that tells what Sonic's hieght is. If you could figure that out, you could change it for when he ducks.

    I dunno if that's the case though, as I've never tried this stuff. But it does seem reasonable to me.
     
  12. StephenUK

    StephenUK

    Liquor in the front, poker in the rear Tech Member
    1,678
    0
    16
    Manchester, UK
    Quackshot Disassembly
    Ok this is something I never usually do, but since it's you, I'll make an exception.

    This is from my disassembly and is a small section from the start of Sonic's programming (0x19F50 in case you didn't know. I've edited the labels).

    Code (Text):
    1. ; ----------------------------------------------------------------------------
    2. ; Sprite
    3. ;
    4. ; Sonic
    5. ; ----------------------------------------------------------------------------
    6.  
    7. Sprite_Sonic:
    8.         tst.w   ($FFFFFE08).w;Is debug mode being used?
    9.         beq.s   Sonic_Load;If not, branch
    10.         jmp loc_41A78   ;Debug Mode routine
    11. ; ?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„
    12.  
    13. Sonic_Load:
    14.         moveq   #0,d0
    15.         move.b  $24(a0),d0
    16.         move.w  Sonic_Index(pc,d0.w),d1
    17.         jmp Sonic_Index(pc,d1.w)
    18. ; ?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„
    19. Sonic_Index:    dc.w loc_SonicMain-Sonic_Index; 0
    20.         dc.w loc_SonicControl-Sonic_Index; 1
    21.         dc.w loc_1B120-Sonic_Index; 2
    22.         dc.w loc_1B1E6-Sonic_Index; 3
    23.         dc.w loc_1B31C-Sonic_Index; 4
    24.         dc.w loc_1B330-Sonic_Index; 5
    25. ; ?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„?„
    26.  
    27. loc_SonicMain:; DATA XREF: h+2FF6o
    28.         addq.b  #2,$24(a0);Move routine counter to D0
    29.         move.b  #$13,$16(a0);Set Sonic's Height (real value / 2)           
    30.         move.b  #9,$17(a0);Set Sonic's Width (real value / 2)
    31.         move.l  #Map_Sonic3,4(a0);Mappings
    32.         move.b  #2,$18(a0);Sprite Priority
    33.         move.b  #$18,$19(a0);Set Sonic's Width (real value)
    34.         move.b  #4,1(a0);Playfield Co-ordinate system
    35.         move.w  #$600,($FFFFF760).w;Sonic's Top Speed
    36.         move.w  #$C,($FFFFF762).w;Sonic's Acceleration
    37.         move.w  #$80,($FFFFF764).w;Sonic's Deceleration
    As you can see, Sonic's height is set in this routine. I looked in the ducking routine and couldn't find any height reference, so I'm assuming it uses this. I could be wrong though. All you should need to do is the following:

    Code (Text):
    1. loc_SonicMain:     
    2.                 addq.b  #2,$24(a0);Move routine counter to D0
    3.                 cmpi.b  #8,$1C(a0)              ;Is ducking animation being displayed?
    4.                 bne.s   NormalHeight                ;If not, branch
    5.  
    6. DuckHeight:
    7.                 move.b  #$11,$16(a0);Set Sonic's Height (real value / 2)
    8.                 bra.s     HeightSet
    9.  
    10. NormalHeight:
    11.         move.b  #$13,$16(a0);Set Sonic's Height (real value / 2)
    12.  
    13. HeightSet:     
    14.         move.b  #9,$17(a0);Set Sonic's Width (real value / 2)
    This may or may not work, so if not, let me know and I'll look into it a bit more for you.
     
  13. Rika Chou

    Rika Chou

    Tech Member
    5,276
    169
    43
    It didn't seem to work.
     
  14. StephenUK

    StephenUK

    Liquor in the front, poker in the rear Tech Member
    1,678
    0
    16
    Manchester, UK
    Quackshot Disassembly
    Try replacing $11 with $D. If that doesn't work, I'll look into it a bit more.
     
  15. Rika Chou

    Rika Chou

    Tech Member
    5,276
    169
    43
    Still nothing.
     
  16. StephenUK

    StephenUK

    Liquor in the front, poker in the rear Tech Member
    1,678
    0
    16
    Manchester, UK
    Quackshot Disassembly
    I'll experiment with it a bit tonight and see what I come up with then. Can't be too difficult.
     
  17. Rika Chou

    Rika Chou

    Tech Member
    5,276
    169
    43
    Thanks.
     
  18. Rika Chou

    Rika Chou

    Tech Member
    5,276
    169
    43
    I don't suppose you've got around to this yet?
     
  19. StephenUK

    StephenUK

    Liquor in the front, poker in the rear Tech Member
    1,678
    0
    16
    Manchester, UK
    Quackshot Disassembly
    Sorry I've been so tied up with other things lately that I've only just got round to doing it.

    Ok, I've looked into it and it turns out I got it backwards. Increase the value written to $14(a0) to speed up the slopes. I just put it as high as $140 to test and I flew down them. The oly thing is, this also makes it harder for you to get back up the slopes so you have to find a balance unless you recode it like I did for the grind rails.
     
  20. Rika Chou

    Rika Chou

    Tech Member
    5,276
    169
    43
    Thanks...but I have already worked that out.

    I was asking about the Sonic's ducking height.
     
Thread Status:
Not open for further replies.