Guest User

Untitled

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