Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ROM:00002D98 ; =============== S U B R O U T I N E =======================================
- ROM:00002D98
- ROM:00002D98
- ROM:00002D98 ManageCorner: ; CODE XREF: ROM:000284F2p
- ROM:00002D98 ; ROM:00028506p ...
- ROM:00002D98 clr.b $48(a6) ;
- ROM:00002D98 ; Clear corner byte.
- ROM:00002D9C move.w $BD8(a5),d0 ; Move camera stage position to d0.
- ROM:00002DA0 add.w $1C2(a6),d0 ; Add distance char can be from corner to d0 to get minimum allowed screen position.
- ROM:00002DA4 cmp.w 6(a6),d0 ; Compare character stage position to d0.
- ROM:00002DA8 blt.s loc_2DC8 ; If d0 is less, branch.
- ROM:00002DAA move.b #1,$48(a6) ; Set corner byte to "in left corner".
- ROM:00002DB0 move.w d0,d1 ; Move d0 to d1.
- ROM:00002DB2 sub.w 6(a6),d1 ; Set d1 to difference between screen pos and lowest allowed screen pos.
- ROM:00002DB6 move.w d0,6(a6) ; Set char screen pos to lowest allowed screen pos.
- ROM:00002DBA tst.b $63(a6) ; Test "throwing/being thrown" bit.
- ROM:00002DBE beq.s loc_2DC8 ; Branch if char is not throwing or being thrown.
- ROM:00002DC0 movea.w $29E(a6),a4 ; Move opponent's player offset to a4.
- ROM:00002DC4 add.w d1,6(a4) ; Add d1 (old difference between screen pos and lowest allowed screen pos) to opponent's screen position.
- ROM:00002DC8
- ROM:00002DC8 loc_2DC8: ; CODE XREF: ManageCorner+10j
- ROM:00002DC8 ; ManageCorner+26j
- ROM:00002DC8 move.w #$180,d1 ; Move the immediate number $180 to d1.
- ROM:00002DCC sub.w $1C2(a6),d1 ; Subtract distance char can be from corner from d1 to get (maximum allowed screen position) - 100.
- ROM:00002DD0 move.w $BD8(a5),d0 ; Move camera stage position to d0.
- ROM:00002DD4 add.w d1,d0 ; Add camera stage position to d0.
- ROM:00002DD6 cmp.w 6(a6),d0 ; Compare char screen position with d0.
- ROM:00002DDA bgt.s locret_2DFA ; If d0 is greater, branch.
- ROM:00002DDC move.b #2,$48(a6) ; Else set corner byte to "in right corner".
- ROM:00002DE2 move.w d0,d1 ; Move d0 to d1.
- ROM:00002DE4 sub.w 6(a6),d1 ; Set d1 to difference between screen pos and maximum allowed screen pos.
- ROM:00002DE8 move.w d0,6(a6) ; Set char screen pos to maximum allowed screen pos.
- ROM:00002DEC tst.b $63(a6) ; Test "throwing/being thrown" bit.
- ROM:00002DF0 beq.s locret_2DFA ; Branch if char is not throwing or being thrown.
- ROM:00002DF2 movea.w $29E(a6),a4 ; Else move opponent's player offset to a4.
- ROM:00002DF6 add.w d1,6(a4) ; Add d1 (old difference between screen pos and maximum allowed screen pos) to opponent's screen pos.
- ROM:00002DFA
- ROM:00002DFA locret_2DFA: ; CODE XREF: ManageCorner+42j
- ROM:00002DFA ; ManageCorner+58j
- ROM:00002DFA rts
- ROM:00002DFA ; End of function ManageCorner
Add Comment
Please, Sign In to add comment