Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Obj3C: ; XREF: Obj_Index
- moveq #0,d0
- move.b $24(a0),d0
- move.w Obj3C_Index(pc,d0.w),d1
- jsr Obj3C_Index(pc,d1.w)
- bra.w MarkObjGone
- ; ===========================================================================
- Obj3C_Index: dc.w Obj3C_Main-Obj3C_Index
- dc.w Obj3C_Solid-Obj3C_Index
- dc.w Obj3C_FragMove-Obj3C_Index
- ; ===========================================================================
- Obj3C_Main: ; XREF: Obj3C_Index
- addq.b #2,$24(a0)
- move.l #Map_obj3C,4(a0)
- move.w #$450F,2(a0)
- move.b #4,1(a0)
- move.b #$10,$19(a0)
- move.b #4,$18(a0)
- move.b $28(a0),$1A(a0)
- Obj3C_Solid: ; XREF: Obj3C_Index
- move.w ($FFFFD010).w,$30(a0) ; load Sonic's horizontal speed
- move.w #$1B,d1
- move.w #$20,d2
- move.w #$20,d3
- move.w 8(a0),d4
- bsr.w SolidObject
- btst #5,$22(a0) ; Sonic virtually pushing the wall?
- bne.s Obj3C_ChkRoll ; if yes, branch
- tst.w $10(a1) ; has Sonic forced to stop?
- bne.s locret_D180 ; if not, we don't mind him
- btst #7,$22(a1) ; has Sonic Jump Dashed?
- bne.s Obj3C_ChkRoll ; if yes, test Jump Dash flag
- locret_D180:
- rts
- ; ===========================================================================
- Obj3C_ChkRoll: ; XREF: Obj3C_Solid
- cmpi.b #2,$1C(a1) ; is Sonic rolling?
- bne.s locret_D180 ; if not, branch
- move.w $30(a0),d0
- bpl.s Obj3C_ChkSpeed
- neg.w d0
- Obj3C_ChkSpeed:
- cmpi.w #$250,d0 ; is Sonic's speed $480 or higher?
- bcs.s locret_D180 ; if not, branch
- move.w $30(a0),$10(a1)
- addq.w #4,8(a1)
- lea (Obj3C_FragSpd1).l,a4 ; use fragments that move right
- move.w 8(a0),d0
- cmp.w 8(a1),d0 ; is Sonic to the right of the block?
- bcs.s Obj3C_Smash ; if yes, branch
- subq.w #8,8(a1)
- lea (Obj3C_FragSpd2).l,a4 ; use fragments that move left
- Obj3C_Smash:
- move.w $10(a1),$14(a1)
- bclr #5,$22(a0)
- bclr #5,$22(a1)
- moveq #7,d1 ; load 8 fragments
- move.w #$70,d2
- bsr.s SmashObject
- Obj3C_FragMove: ; XREF: Obj3C_Index
- bsr.w SpeedToPos
- addi.w #$70,$12(a0) ; make fragment fall faster
- bsr.w DisplaySprite
- tst.b 1(a0)
- bpl.w DeleteObject
- rts
Add Comment
Please, Sign In to add comment