don't click here

A Robotnik boss battle...

Discussion in 'General Sonic Discussion' started by Trigahd, Jul 1, 2005.

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

    LOst

    Tech Member
    4,891
    8
    18
    See code above. You don't use CMP.
     
  2. Weird Person

    Weird Person

    You lost two seconds reading this Member
    367
    0
    0
    Who knows?
    mmm... I changed the value at $19FAA ($67 , "BEQ") to $6B, Equivalent to in Asm "BMI", I Played, and a new bug appeared. When Reach 0, I don't defeat, Little Explosion Appears, But I need hit once one more time to end the game.

    I tried in a Unchanged Sonic 1 Rom. Try do this, A extra hit will be needed with or without the compare routine.

    I'm not want to be nitpicking, but 0 isn't less than 0. -1 is less than 0.
     
  3. LocalH

    LocalH

    roxoring your soxors Tech Member
    This is also the same reason that you can't normally kill Robotnik in S(3)&K, at the point when he electrocutes Knuckles after stealing the Master Emerald. His hitcount is set extremely high (perhaps 255, but any fairly large number would work equally well). I seem to remember a simple hack that reduced his hitcount to something like 6 or 8, and he just popped like a regular badnik, giving 100 points.
     
  4. LOst

    LOst

    Tech Member
    4,891
    8
    18
    NO! NOT CHANGE! You have to add BMI below the BEQ. YOU MUST HAVE BOTH. Else it will take 9 hits to kill Eggman instead of 8.
     
  5. Weird Person

    Weird Person

    You lost two seconds reading this Member
    367
    0
    0
    Who knows?
    why add? and also, it's IMPOSSIBLE add without make the rom Crash. Jump offsets will be changed, and the result is obvious.
     
  6. LocalH

    LocalH

    roxoring your soxors Tech Member
    Or you could replace it and lower the hitcount by one - that way, on the hit that it would have turned to $00, it will now turn to $FF, which sets the high bit, which causes the BMI to branch.
     
  7. LOst

    LOst

    Tech Member
    4,891
    8
    18
    Yea, lower the hitcount to 7, and replace BEQ with BMI and it will work. If not the explosions are triggered at zero that is <.<;

    Here's how you do it:
    Code (Text):
    1. ROM:00019E5A loc_19E5A: ? ? ? ? ? ? ? ? ? ? ? ? ? ?; CODE XREF: ROM:00019E2Aj ...
    2. ROM:00019E5A ? ? ? ? ? ? ? ? move.w ?#0,$34(a0)
    3. ...
    4. ROM:00019E60 ? ? ? ? ? ? ? ? move.b ?#7,$21(a0) ? ?; set number of hits to 7
    5. ...
    6. ROM:00019E66 ? ? ? ? ? ? ? ? move.w ?#-1,$30(a0)
    7. ROM:00019E6C
    8. ROM:00019E6C Obj85_Eggman: ? ? ? ? ? ? ? ? ? ? ? ? ?; DATA XREF: ROM:00019D66o
    9. ROM:00019E6C ? ? ? ? ? ? ? ? moveq ? #0,d0
    10. ROM:00019E6E ? ? ? ? ? ? ? ? move.b ?$34(a0),d0
    But I suggest you redirect the function loc_19FA6 to the end of the ROM and rewrite the condition code.

    Code (Text):
    1. loc_19FA6: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; CODE XREF: ROM:00019F14j
    2.  
    3. ROM:00019FA6 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tst.b &nbsp; $21(a0)
    4. ROM:00019FAA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; beq.s &nbsp; loc_19FBC
    5. ROM:00019FAC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addq.b &nbsp;#2,$34(a0)
    6. ROM:00019FB0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; move.w &nbsp;#-1,$30(a0)
    7. ROM:00019FB6 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clr.w &nbsp; $32(a0)
    8. ROM:00019FBA &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rts &nbsp; &nbsp;
    9. ROM:00019FBC; ---------------------------------------------------------------------------
    10. ROM:00019FBC
    11. ROM:00019FBC loc_19FBC: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ; CODE XREF: ROM:00019FAAj
    12. ROM:00019FBC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; move.b &nbsp;#6,$34(a0)
    13. ROM:00019FC2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; move.w &nbsp;#$25C0,8(a0)
    14. ROM:00019FC8 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; move.w &nbsp;#$53C,$C(a0)
    15. ROM:00019FCE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; move.b &nbsp;#$14,$16(a0)
    16. ROM:00019FD4 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rts &nbsp; &nbsp;
     
  8. LocalH

    LocalH

    roxoring your soxors Tech Member
    True, that would be the most optimal method. Mine was more of a 'quick hack' type thing that would probably work (although I didn't think of the "trigger explosion on 0" possibility, I was assuming that it was all handled through the BEQ).

    Also, if anyone reading is confused about not needing CMP, if the value you're comparing against is 0, then you can omit the CMP. Basically, CMP is a subtraction that throws away the numerical result and only sets the processor flags based on that result. BEQ of course means "Branch if EQual to zero". So, for a "pull the numbers out of my ass" example, if you're comparing D0 against $80, and D0 contains $81, then the result of the CMP subtraction would be $01. Since that's not $00, the Z flag would not be set and the code would fall through the BEQ. If D0 is $80, then the result is $00, and the branch is taken. Same thing in reverse with BNE (Branch if Not Equal to zero).
     
Thread Status:
Not open for further replies.