Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ===========================================================================
- ; loc_D27C:
- SwScrl_CPZ:
- move.w (Camera_X_pos_diff).w,d4
- ext.l d4
- asl.l #5,d4 ; d4 = CamXdiff / 8 (16 fixed)
- move.w (Camera_Y_pos_diff).w,d5
- ext.l d5
- asl.l #6,d5 ; d5 = CamYdiff / 4 (16 fixed)
- bsr.w SetHorizVertiScrollFlagsBG ; scroll layer #1!
- move.w (Camera_X_pos_diff).w,d4
- ext.l d4
- asl.l #7,d4 ; d4 = CamXdiff / 2 (16 fixed)
- moveq #4,d6 ; set bit #2 of scroll flags
- bsr.w SetHorizScrollFlagsBG2 ; scroll layer #2!
- move.w (Camera_BG_Y_pos).w,d0
- move.w d0,(Camera_BG2_Y_pos).w
- move.w d0,(Vscroll_Factor+2).w ; set Y-pos to VSRAM buffer
- move.b (Scroll_flags_BG).w,d0
- or.b (Scroll_flags_BG2).w,d0
- move.b d0,(Scroll_flags_BG3).w
- clr.b (Scroll_flags_BG).w
- clr.b (Scroll_flags_BG2).w
- move.b (Vint_runcount+3).w,d1 ; >> weak point, what if game lags?
- andi.w #7,d1
- bne.s +
- subq.w #1,(TempArray_LayerDef).w
- +
- lea (byte_DDD0+1).l,a0 ; ???
- move.w (Camera_BG_Y_pos).w,d0
- move.w d0,d2 ; d2 = BG Ypos
- andi.w #$3F0,d0
- lsr.w #4,d0 ; d0 = number of 16-px scroll block to start from
- lea (a0,d0.w),a0
- move.w d0,d4 ; d4 = current 16-px block
- lea (Horiz_Scroll_Buf).w,a1
- move.w #$E,d1 ; d1 = 16-px blocks to do
- move.w (Camera_X_pos).w,d0
- neg.w d0
- swap d0 ; setup plane A scrolling
- andi.w #$F,d2 ; d2 = pixels left outside of screen for the top block
- move.w (Camera_BG_X_pos).w,d0 ; load scroll value for layer #1
- cmpi.b #$12,d4 ; are we going to scroll block $12 (ripple)?
- beq.s loc_D34A ; if yes, branch
- blo.s + ; if less than, branch
- move.w (Camera_BG2_X_pos).w,d0 ; load scroll value for layer #2
- +
- neg.w d0
- add.w d2,d2
- jmp ++(pc,d2.w) ; jump to 'move.l d0,(a1)+' sequence, at position calculated with D2
- ; ===========================================================================
- - move.w (Camera_BG_X_pos).w,d0 ; load scroll value for layer #1
- cmpi.b #$12,d4 ; are we going to scroll block $12?
- beq.s +++ ; if yes, branch
- blo.s + ; if less than, branch
- move.w (Camera_BG2_X_pos).w,d0 ; load scroll value for layer #2
- +
- neg.w d0
- + rept 16 ; sequence to scroll 16-px block
- move.l d0,(a1)+
- endm
- addq.b #1,d4 ; increase current block number
- dbf d1,- ; repeat for $F 16-px blocks
- rts
- ; ===========================================================================
- ; Prepare to scroll block $12 (ripple), partially
- loc_D34A:
- move.w #bytesToLcnt($40),d0
- sub.w d2,d0
- move.w d0,d2
- bra.s ++
- ; ===========================================================================
- ; Prepare to scroll block $12 (ripple), full
- +
- move.w #$F,d2
- +
- move.w (Camera_BG_X_pos).w,d3
- neg.w d3
- move.w (TempArray_LayerDef).w,d0
- andi.w #$1F,d0
- lea SwScrl_RippleData(pc),a2
- lea (a2,d0.w),a2
- - move.b (a2)+,d0
- ext.w d0
- add.w d3,d0
- move.l d0,(a1)+
- dbf d2,-
- addq.b #1,d4 ; increase current block number
- dbf d1,-- ; repeat for $F 16-px blocks
- rts
- ; ===========================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement