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
- move.w (Camera_Y_pos_diff).w,d5
- ext.l d5
- asl.l #6,d5
- bsr.w SetHorizVertiScrollFlagsBG
- move.w (Camera_X_pos_diff).w,d4
- ext.l d4
- asl.l #7,d4
- moveq #4,d6
- bsr.w SetHorizScrollFlagsBG2
- move.w (Camera_BG_Y_pos).w,d0
- move.w d0,(Camera_BG2_Y_pos).w
- move.w d0,(Vscroll_Factor_BG).w
- 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
- lea (Horiz_Scroll_Buf).w,a1
- moveq #0,d0
- sub.w (Camera_X_pos).w,d0
- swap d0
- sub.w (Camera_BG_X_pos).w,d0
- move.w #223,d4
- move.w (Camera_BG_Y_pos).w,d1
- subi.w #$120,d1
- bpl.s SwScrl_CPZ_Ripple
- not.w d1 ; for d1 < 0, this is equal to neg.w d1 / subq.w #1,d1
- sub.w d1,d4
- bpl.s .duffsdevice
- add.w d4,d1
- .duffsdevice:
- move.w d1,d3
- not.w d3
- andi.w #$F,d3
- add.w d3,d3
- lsr.w #4,d1
- jmp .loop(pc,d3.w)
- ; ---------------------------------------------------------------------------
- .loop:
- rept (1<<4)
- move.l d0,(a1)+
- endm
- dbf d1,.loop
- subq.w #1,d4
- bmi.s SwScrl_CPZ_End
- moveq #$F,d1
- sub.w d1,d4
- bpl.s SwScrl_CPZ_DoRipple
- add.w d4,d1
- bra.s SwScrl_CPZ_DoRipple
- ; ---------------------------------------------------------------------------
- SwScrl_CPZ_Ripple:
- subi.w #$10,d1
- bpl.s SwScrl_CPZ_Bottom
- not.w d1 ; for d1 < 0, this is equal to neg.w d1 / subq.w #1,d1
- sub.w d1,d4
- ; Note: d4 simply can't be negative here.
- SwScrl_CPZ_DoRipple:
- move.w (TempArray_LayerDef).w,d2
- moveq #7,d3
- and.b (Timer_frames+1).w,d3
- bne.s .skip_wave_dec
- subq.w #1,d2
- andi.w #$1F,d2
- move.w d2,(TempArray_LayerDef).w
- .skip_wave_dec:
- lea SwScrl_RippleData(pc),a2
- lea (a2,d2.w),a2
- move.w d0,d2
- .loop:
- move.b (a2)+,d0
- ext.w d0
- add.w d2,d0
- move.l d0,(a1)+
- dbf d1,.loop
- subq.w #1,d4
- bmi.s SwScrl_CPZ_End
- SwScrl_CPZ_Bottom:
- move.w (Camera_BG2_X_pos).w,d0
- neg.w d0
- move.w d4,d3
- not.w d3
- andi.w #$F,d3
- add.w d3,d3
- lsr.w #4,d4
- jmp .loop(pc,d3.w)
- ; ---------------------------------------------------------------------------
- .loop:
- rept (1<<4)
- move.l d0,(a1)+
- endm
- dbf d4,.loop
- SwScrl_CPZ_End:
- rts
- ; ===========================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement