Guest User

Untitled

a guest
Jan 15th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Obj3C:                  ; XREF: Obj_Index
  2.         moveq   #0,d0
  3.         move.b  $24(a0),d0
  4.         move.w  Obj3C_Index(pc,d0.w),d1
  5.         jsr Obj3C_Index(pc,d1.w)
  6.         bra.w   MarkObjGone
  7. ; ===========================================================================
  8. Obj3C_Index:    dc.w Obj3C_Main-Obj3C_Index
  9.         dc.w Obj3C_Solid-Obj3C_Index
  10.         dc.w Obj3C_FragMove-Obj3C_Index
  11. ; ===========================================================================
  12.  
  13. Obj3C_Main:             ; XREF: Obj3C_Index
  14.         addq.b  #2,$24(a0)
  15.         move.l  #Map_obj3C,4(a0)
  16.         move.w  #$450F,2(a0)
  17.         move.b  #4,1(a0)
  18.         move.b  #$10,$19(a0)
  19.         move.b  #4,$18(a0)
  20.         move.b  $28(a0),$1A(a0)
  21.  
  22. Obj3C_Solid:                ; XREF: Obj3C_Index
  23.         move.w  ($FFFFD010).w,$30(a0) ; load Sonic's horizontal speed
  24.         move.w  #$1B,d1
  25.         move.w  #$20,d2
  26.         move.w  #$20,d3
  27.         move.w  8(a0),d4
  28.         bsr.w   SolidObject
  29.         btst    #5,$22(a0)  ; Sonic virtually pushing the wall?
  30.         bne.s   Obj3C_ChkRoll   ; if yes, branch
  31.  
  32.         tst.w   $10(a1)     ; has Sonic forced to stop?
  33.         bne.s   locret_D180 ; if not, we don't mind him
  34.         btst    #7,$22(a1)  ; has Sonic Jump Dashed?
  35.         bne.s   Obj3C_ChkRoll   ; if yes, test Jump Dash flag
  36.  
  37. locret_D180:
  38.         rts
  39. ; ===========================================================================
  40.  
  41. Obj3C_ChkRoll:              ; XREF: Obj3C_Solid
  42.         cmpi.b  #2,$1C(a1)  ; is Sonic rolling?
  43.         bne.s   locret_D180 ; if not, branch
  44.         move.w  $30(a0),d0
  45.         bpl.s   Obj3C_ChkSpeed
  46.         neg.w   d0
  47.  
  48. Obj3C_ChkSpeed:
  49.         cmpi.w  #$250,d0    ; is Sonic's speed $480 or higher?
  50.         bcs.s   locret_D180 ; if not, branch
  51.         move.w  $30(a0),$10(a1)
  52.         addq.w  #4,8(a1)
  53.         lea (Obj3C_FragSpd1).l,a4 ; use fragments that move right
  54.         move.w  8(a0),d0
  55.         cmp.w   8(a1),d0    ; is Sonic to the right of the block?
  56.         bcs.s   Obj3C_Smash ; if yes, branch
  57.         subq.w  #8,8(a1)
  58.         lea (Obj3C_FragSpd2).l,a4 ; use fragments that move left
  59.  
  60. Obj3C_Smash:
  61.         move.w  $10(a1),$14(a1)
  62.         bclr    #5,$22(a0)
  63.         bclr    #5,$22(a1)
  64.         moveq   #7,d1       ; load 8 fragments
  65.         move.w  #$70,d2
  66.         bsr.s   SmashObject
  67.  
  68. Obj3C_FragMove:             ; XREF: Obj3C_Index
  69.         bsr.w   SpeedToPos
  70.         addi.w  #$70,$12(a0)    ; make fragment fall faster
  71.         bsr.w   DisplaySprite
  72.         tst.b   1(a0)
  73.         bpl.w   DeleteObject
  74.         rts
Add Comment
Please, Sign In to add comment