don't click here

Problems in the GHZ1 S pipe.

Discussion in 'Engineering & Reverse Engineering' started by Puto, Dec 11, 2006.

Thread Status:
Not open for further replies.
  1. 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.
    Apparently, when I go down the S pipe too fast in GHZ1 on a ROM assembled from Hive's June 2005 Disassembly, I die because the camera is too slow or something. I don't know if this bug is from the disassembly or from my code, but since I've heard other similar reports of that around here somewhere, is there a known fix for it?
    Video here, MPEG-4.
     
  2. Xenowhirl

    Xenowhirl

    Tech Member
    175
    0
    0
    That can happen in the original, try getting speed shoes and running through an S pipe, you'll die if you don't slow down. A known fix is to do what Stealth did in S1K with the bottom boundary checking when the screen is scrolling. Look for loc_13336 in that disassembly, if ($FFFFF726).w > ($FFFFF72E).w that means the screen is still scrolling down, so branch past the "kill sonic" code when that happens to fix it.

    And you can fix the slow camera problem after a spindash by doing this as soon as the spindash ends:
    Code (Text):
    1. move.w  #$60,($FFFFF73E).w; reset looking up/down
     
  3. 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.
    Thanks! It worked just fine :(


    Forget that last part. Apparently, I didn't implement that check right, because now I never die when I fall off-screen. So what's wrong with this code?
    Code (Text):
    1. Boundary_Bottom:
    2.         move.w  #8, ($fffff726).w
    3.         cmpi.w  #8, ($fffff72e).w
    4.         bgt     Still_Scrolling
    5.         cmpi.w  #$501,($FFFFFE10).w; is level SBZ2 ?
    6.         bne.w   KillSonic; if not, kill Sonic
    7.         cmpi.w  #$2000,($FFFFD008).w
    8.         bcs.w   KillSonic
    9.         clr.b   ($FFFFFE30).w; clear    lamppost counter
    10.         move.w  #1,($FFFFFE02).w; restart the level
    11.         move.w  #$103,($FFFFFE10).w; set level  to SBZ3 (LZ4)
    12.         rts
    13. ; ===========================================================================
    14. Still_Scrolling:
    15.         rts
     
  4. Hayate

    Hayate

    Tech Member
    Try this.

    Code (Text):
    1. Boundary_Bottom:
    2.         move.w ($fffff726).w,d0
    3.         move.w ($fffff72e).w,d1
    4.         cmpi.w d0,d1
    5.         bgt     Still_Scrolling
    6.         cmpi.w  #$501,($FFFFFE10).w; is level SBZ2 ?
    7.         bne.w   KillSonic; if not, kill Sonic
    8.         cmpi.w  #$2000,($FFFFD008).w
    9.         bcs.w   KillSonic
    10.         clr.b   ($FFFFFE30).w; clear    lamppost counter
    11.         move.w  #1,($FFFFFE02).w; restart the level
    12.         move.w  #$103,($FFFFFE10).w; set level  to SBZ3 (LZ4)
    13.         rts
    14. ; ===========================================================================
    15. Still_Scrolling:
    16.         rts
    I'm still not that good with ASM, so it might not work.
     
  5. 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.
    Like that it doesn't work, it doesn't even compile, however, slightly tweaking it, it did work :(
    Code (Text):
    1. Boundary_Bottom:
    2.         move.w ($fffff726).w,d0
    3.         move.w ($fffff72e).w,d1
    4.         cmp.w   d1,d0
    5.         bgt     Still_Scrolling
    6.         cmpi.w  #$501,($FFFFFE10).w; is level SBZ2 ?
    7.         bne.w   KillSonic; if not, kill Sonic
    8.         cmpi.w  #$2000,($FFFFD008).w
    9.         bcs.w   KillSonic
    10.         clr.b   ($FFFFFE30).w; clear    lamppost counter
    11.         move.w  #1,($FFFFFE02).w; restart the level
    12.         move.w  #$103,($FFFFFE10).w; set level  to SBZ3 (LZ4)
    13.         rts
    14. ; ===========================================================================
    15. Still_Scrolling:
    16.         rts
    Thanks :)
     
  6. nineko

    nineko

    I am the Holy Cat Tech Member
    6,308
    486
    63
    italy
    Yes, as Xenowhirl said, this happens also in the original game. I died hundreds of times there, I'm always too fast :(
     
Thread Status:
Not open for further replies.