Guest User

Untitled

a guest
Aug 10th, 2015
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; ===========================================================================
  2. ; loc_D27C:
  3. SwScrl_CPZ:
  4.     move.w  (Camera_X_pos_diff).w,d4
  5.     ext.l   d4
  6.     asl.l   #5,d4
  7.     move.w  (Camera_Y_pos_diff).w,d5
  8.     ext.l   d5
  9.     asl.l   #6,d5
  10.     bsr.w   SetHorizVertiScrollFlagsBG
  11.     move.w  (Camera_X_pos_diff).w,d4
  12.     ext.l   d4
  13.     asl.l   #7,d4
  14.     moveq   #4,d6
  15.     bsr.w   SetHorizScrollFlagsBG2
  16.     move.w  (Camera_BG_Y_pos).w,d0
  17.     move.w  d0,(Camera_BG2_Y_pos).w
  18.     move.w  d0,(Vscroll_Factor_BG).w
  19.     move.b  (Scroll_flags_BG).w,d0
  20.     or.b    (Scroll_flags_BG2).w,d0
  21.     move.b  d0,(Scroll_flags_BG3).w
  22.     clr.b   (Scroll_flags_BG).w
  23.     clr.b   (Scroll_flags_BG2).w
  24.  
  25.     lea (Horiz_Scroll_Buf).w,a1
  26.     moveq   #0,d0
  27.     sub.w   (Camera_X_pos).w,d0
  28.     swap    d0
  29.     sub.w   (Camera_BG_X_pos).w,d0
  30.  
  31.     move.w  #223,d4
  32.     move.w  (Camera_BG_Y_pos).w,d1
  33.     subi.w  #$120,d1
  34.     bpl.s   SwScrl_CPZ_Ripple
  35.     not.w   d1                      ; for d1 < 0, this is equal to neg.w d1 / subq.w #1,d1
  36.     sub.w   d1,d4
  37.     bpl.s   .loop
  38.     add.w   d4,d1
  39.  
  40. .loop:
  41.     move.l  d0,(a1)+
  42.     dbf d1,.loop
  43.  
  44.     subq.w  #1,d4
  45.     bmi.s   SwScrl_CPZ_End
  46.  
  47.     moveq   #$F,d1
  48.     sub.w   d1,d4
  49.     bpl.s   SwScrl_CPZ_DoRipple
  50.     add.w   d4,d1
  51.     bra.s   SwScrl_CPZ_DoRipple
  52. ; ---------------------------------------------------------------------------
  53. SwScrl_CPZ_Ripple:
  54.     subi.w  #$10,d1
  55.     bpl.s   SwScrl_CPZ_Bottom
  56.     not.w   d1                      ; for d1 < 0, this is equal to neg.w d1 / subq.w #1,d1
  57.     sub.w   d1,d4
  58.     ; Note: d4 simply can't be negative here.
  59.  
  60. SwScrl_CPZ_DoRipple:
  61.     move.w  (TempArray_LayerDef).w,d2
  62.     moveq   #7,d3
  63.     and.b   (Timer_frames+1).w,d3
  64.     bne.s   .skip_wave_dec
  65.     subq.w  #1,d2
  66.     andi.w  #$1F,d2
  67.     move.w  d2,(TempArray_LayerDef).w
  68.  
  69. .skip_wave_dec:
  70.     lea SwScrl_RippleData(pc),a2
  71.     lea (a2,d2.w),a2
  72.     move.w  d0,d2
  73.  
  74. .loop:
  75.     move.b  (a2)+,d0
  76.     ext.w   d0
  77.     add.w   d2,d0
  78.     move.l  d0,(a1)+
  79.     dbf d1,.loop
  80.  
  81.     subq.w  #1,d4
  82.     bmi.s   SwScrl_CPZ_End
  83.  
  84. SwScrl_CPZ_Bottom:
  85.     move.w  (Camera_BG2_X_pos).w,d0
  86.     neg.w   d0
  87.  
  88. .loop:
  89.     move.l  d0,(a1)+
  90.     dbf d4,.loop
  91.  
  92. SwScrl_CPZ_End:
  93.     rts
  94. ; ===========================================================================
Advertisement
Add Comment
Please, Sign In to add comment