Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Deform_PGZ:
- ;$FFFFF73C contains current vertical scroll speed, example: 01, moving two pixels down
- move.w ($FFFFF73C).w,d5 ;move it to d5 as word: d5=0100
- ext.l d5 ;extend d5, d5=00000100 (on negative, d5=FFFFFE00)
- asl.l #4,d5 ;shift left 4 times, d5=00001000
- asl.l #1,d5 ;shift left once, d5=00002000
- cmpi.w #100,($FFFFF618).w
- bmi.s @slow
- asl.l #1,d5 ;shift left once, d5=00004000
- @slow:
- bsr Bg_Scroll_Y ;go to BG_Scroll_Y
- move.w ($FFFFF70C).w,($FFFFF618).w ;move $FFFFF70C (current Y position of background layer) to $FFFFF618 (some dupe)
- lea ($FFFFA800).w,a1
- move.w (v_scrshiftx).w,d4
- ext.l d4
- asl.l #6,d4
- move.l d4,d1
- asl.l #1,d4
- add.l d1,d4
- moveq #2,d6
- bsr ScrollBlock3
- move.w (v_scrshiftx).w,d4
- ext.l d4
- asl.l #6,d4
- moveq #6,d6
- bsr ScrollBlock5
- move.w (v_scrshiftx).w,d4
- ext.l d4
- asl.l #7,d4
- moveq #4,d6
- bsr ScrollBlock4
- @this:
- lea ($FFFFCC00).w,a1 ; load beginning address of horizontal scroll buffer to a1
- move.b #232,d3 ; max number of lines to write
- move.w ($FFFFF618).w,d1 ; get current bg vertical position
- neg.w d1
- add.w #72-1,d1 ; bigger than first part? (-1 because of dbf)
- bpl.w PGZ_Deform1 ; if not, branch
- add.w #48,d1 ; second part?
- bpl.w PGZ_Deform2 ; if not, branch
- add.w #4,d1
- bpl.w PGZ_Deform3
- add.w #4,d1
- bpl.w PGZ_Deform4
- add.w #8,d1
- bpl.w PGZ_Deform5
- add.w #8,d1
- bpl.w PGZ_Deform6
- add.w #16,d1
- bpl.w PGZ_Deform7
- add.w #16,d1
- bpl.w PGZ_Deform8
- add.w #32,d1
- bpl.w PGZ_Deform9
- add.w #72,d1
- bpl.w PGZ_DeformA
- add.w #16,d1
- bpl.w PGZ_DeformB
- add.w #48,d1
- bpl.w PGZ_DeformC
- add.w #16,d1
- bpl.w PGZ_DeformD
- add.w #16,d1
- bpl.w PGZ_DeformE
- add.w #80,d1
- bpl.w PGZ_DeformF
- add.w #16,d1
- bpl.w PGZ_Deform10
- add.w #64,d1
- bpl.w PGZ_Deform11
- add.w #16,d1
- bpl.w PGZ_Deform12
- add.w #32,d1
- bpl.w PGZ_Deform13
- add.w #16,d1
- bpl.w PGZ_Deform14
- PGZ_Deform1:
- move.w ($FFFFF700).w,d0 ; load FG screen's X position
- neg.w d0 ; negate (positive to negative)
- swap d0 ; send to the left side of d0
- lea ($FFFFA800).w,a2
- addq #$0001,(a2)
- move.w (a2),d2
- lsr.w #1,d2
- move.w d2,d0
- neg.w d0
- PGZ_DeformLoop_1:
- move.l d0,(a1)+ ; dump both the FG and BG scanline position to buffer
- sub.b #1,d3 ; subtract for limit, it doesnt need the check for the first 232, only the last block and beyond
- beq.w PGZ_Deform_Stop ; if 0, branch
- dbf d1,PGZ_DeformLoop_1 ; repeat d1 number of scanlines
- move.w #48-1,d1 ; Mountains
- PGZ_Deform2:
- move.w ($FFFFF700).w,d0 ; load FG screen's X position
- neg.w d0 ; negate (positive to negative)
- swap d0 ; send to the left side of d0
- move.w ($FFFFF708).w,d0 ; load BG screen's X position
- neg.w d0 ; negate (positive to negative)
- asr.w #4,d0 ; divide
- ;(6%)
- PGZ_DeformLoop_2:
- move.l d0,(a1)+ ; dump both the FG and BG scanline position to buffer
- sub.b #1,d3
- beq.w PGZ_Deform_Stop ; if 0, branch
- dbf d1,PGZ_DeformLoop_2 ; repeat d1 number of scanlines
- move.w #4-1,d1 ; treea
- PGZ_Deform3:
- move.w ($FFFFF700).w,d0 ; load FG screen's X position
- neg.w d0 ; negate (positive to negative)
- swap d0 ; send to the left side of d0
- move.w ($FFFFF708).w,d0 ; load BG screen's X position
- neg.w d0 ; negate (positive to negative)
- asr.w #3,d0 ; divide
- ;(12%)
- PGZ_DeformLoop_3:
- move.l d0,(a1)+ ; dump both the FG and BG scanline position to buffer
- sub.b #1,d3
- beq.w PGZ_Deform_Stop ; if 0, branch
- dbf d1,PGZ_DeformLoop_3 ; repeat d1 number of scanlines
- move.w #4-1,d1 ; trees
- PGZ_Deform4:
- move.w ($FFFFF700).w,d0 ; load FG screen's X position
- neg.w d0 ; negate (positive to negative)
- swap d0 ; send to the left side of d0
- move.w ($FFFFF708).w,d0 ; load BG screen's X position
- neg.w d0 ; negate (positive to negative)
- move.w d0,d2 ; copy to d2
- asr.w #2,d0 ; divide 4
- asr.w #4,d2 ; divide 16
- sub.w d2,d0
- ;(19%)
- PGZ_DeformLoop_4:
- move.l d0,(a1)+ ; dump both the FG and BG scanline position to buffer
- sub.b #1,d3
- beq.w PGZ_Deform_Stop ; if 0, branch
- dbf d1,PGZ_DeformLoop_4 ; repeat d1 number of scanlines
- move.w #8-1,d1 ; trees
- PGZ_Deform5:
- move.w ($FFFFF700).w,d0 ; load FG screen's X position
- neg.w d0 ; negate (positive to negative)
- swap d0 ; send to the left side of d0
- move.w ($FFFFF708).w,d0 ; load BG screen's X position
- neg.w d0 ; negate (positive to negative)
- asr.w #2,d0 ; divide
- ;(25%)
- PGZ_DeformLoop_5:
- move.l d0,(a1)+ ; dump both the FG and BG scanline position to buffer
- sub.b #1,d3
- beq.w PGZ_Deform_Stop ; if 0, branch
- dbf d1,PGZ_DeformLoop_5 ; repeat d1 number of scanlines
- move.w #8-1,d1 ; trees
- PGZ_Deform6:
- move.w ($FFFFF700).w,d0 ; load FG screen's X position
- neg.w d0 ; negate (positive to negative)
- swap d0 ; send to the left side of d0
- move.w ($FFFFF708).w,d0 ; load BG screen's X position
- neg.w d0 ; negate (positive to negative)
- move.w d0,d2 ; copy to d1
- asr.w #1,d0 ; divide
- asr.w #3,d2 ; divide
- sub.w d2,d0
- ;(37%)
- PGZ_DeformLoop_6:
- move.l d0,(a1)+ ; dump both the FG and BG scanline position to buffer
- sub.b #1,d3
- beq.w PGZ_Deform_Stop ; if 0, branch
- dbf d1,PGZ_DeformLoop_6 ; repeat d1 number of scanlines
- move.w #16-1,d1 ; trees
- PGZ_Deform7:
- move.w ($FFFFF700).w,d0 ; load FG screen's X position
- neg.w d0 ; negate (positive to negative)
- swap d0 ; send to the left side of d0
- move.w ($FFFFF708).w,d0 ; load BG screen's X position
- neg.w d0 ; negate (positive to negative)
- move.w d0,d2 ; copy to d1
- asr.w #1,d0 ; divide
- asr.w #4,d2 ; divide
- sub.w d2,d0
- ;(44%)
- PGZ_DeformLoop_7:
- move.l d0,(a1)+ ; dump both the FG and BG scanline position to buffer
- sub.b #1,d3 ; subtract for limit
- beq.w PGZ_Deform_Stop ; if 0, branch
- dbf d1,PGZ_DeformLoop_7 ; repeat d1 number of scanlines
- move.w #16-1,d1 ; trees
- PGZ_Deform8:
- move.w ($FFFFF700).w,d0 ; load FG screen's X position
- neg.w d0 ; negate (positive to negative)
- swap d0 ; send to the left side of d0
- move.w ($FFFFF708).w,d0 ; load BG screen's X position
- neg.w d0 ; negate (positive to negative)
- asr.w #1,d0 ; divide
- ;(50%)
- PGZ_DeformLoop_8:
- move.l d0,(a1)+ ; dump both the FG and BG scanline position to buffer
- sub.b #1,d3 ; subtract for limit
- beq.w PGZ_Deform_Stop ; if 0, branch
- dbf d1,PGZ_DeformLoop_8 ; repeat d1 number of scanlines
- move.w #32-1,d1 ; trees
- PGZ_Deform9:
- move.w ($FFFFF700).w,d0 ; load FG screen's X position
- neg.w d0 ; negate (positive to negative)
- swap d0 ; send to the left side of d0
- move.w ($FFFFF708).w,d0 ; load BG screen's X position
- neg.w d0 ; negate (positive to negative)
- move.w d0,d2 ; copy to d2
- asr.w #3,d2 ; divide by 8
- add.w d2,d0
- asr.w #1,d0 ; divide by 2
- ;(56%)
- PGZ_DeformLoop_9:
- move.l d0,(a1)+ ; dump both the FG and BG scanline position to buffer
- sub.b #1,d3 ; subtract for limit
- beq.w PGZ_Deform_Stop ; if 0, branch
- dbf d1,PGZ_DeformLoop_9 ; repeat d1 number of scanlines
- move.w #72-1,d1 ; River + Dirt under first row of trees
- PGZ_DeformA:
- move.w ($FFFFF700).w,d0 ; load FG screen's X position
- neg.w d0 ; negate (positive to negative)
- swap d0 ; send to the left side of d0
- move.w ($FFFFF708).w,d0 ; load BG screen's X position
- neg.w d0 ; negate (positive to negative)
- move.w d0,d2 ; copy to d2
- asr.w #2,d2 ; divide by 4
- add.w d2,d0
- asr.w #1,d0 ; divide by 2
- ;(62%)
- PGZ_DeformLoop_A:
- move.l d0,(a1)+ ; dump both the FG and BG scanline position to buffer
- sub.b #1,d3 ; subtract for limit
- beq.w PGZ_Deform_Stop ; if 0, branch
- dbf d1,PGZ_DeformLoop_A ; repeat d1 number of scanlines
- move.w #16-1,d1 ; Dirt under river
- PGZ_DeformB:
- move.w ($FFFFF700).w,d0 ; load FG screen's X position
- neg.w d0 ; negate (positive to negative)
- swap d0 ; send to the left side of d0
- move.w ($FFFFF708).w,d0 ; load BG screen's X position
- neg.w d0 ; negate (positive to negative)
- move.w d0,d2 ; copy to d2
- asr.w #1,d2 ; divide by 2
- add.w d2,d0
- asr.w #1,d0 ; divide by 2
- ;(75%)
- PGZ_DeformLoop_B:
- move.l d0,(a1)+ ; dump both the FG and BG scanline position to buffer
- sub.b #1,d3 ; subtract for limit
- beq.w PGZ_Deform_Stop ; if 0, branch
- dbf d1,PGZ_DeformLoop_B ; repeat d1 number of scanlines
- move.w #48-1,d1 ; Bricks
- PGZ_DeformC:
- move.w ($FFFFF700).w,d0 ; load FG screen's X position
- neg.w d0 ; negate (positive to negative)
- swap d0 ; send to the left side of d0
- move.w ($FFFFF708).w,d0 ; load BG screen's X position
- neg.w d0 ; negate (positive to negative)
- move.w d0,d2 ; copy to d2
- asr.w #1,d2 ; divide by 2
- add.w d2,d0
- asr.w #1,d0 ; divide by 2
- asr.w #2,d2 ; divide by 4
- add.w d2,d0
- ;(87%)
- PGZ_DeformLoop_C:
- move.l d0,(a1)+ ; dump both the FG and BG scanline position to buffer
- sub.b #1,d3 ; subtract for limit
- beq.w PGZ_Deform_Stop ; if 0, branch
- dbf d1,PGZ_DeformLoop_C ; repeat d1 number of scanlines
- move.w #16-1,d1 ; This is a dummy, change once background is imported
- PGZ_DeformD:
- move.w ($FFFFF700).w,d0 ; load FG screen's X position
- neg.w d0 ; negate (positive to negative)
- swap d0 ; send to the left side of d0
- move.w ($FFFFF708).w,d0 ; load BG screen's X position
- neg.w d0 ; negate (positive to negative)
- move.w d0,d2 ; copy to d1
- asr.w #1,d0 ; divide by 2
- asr.w #4,d2 ; divide by 16
- sub.w d2,d0
- PGZ_DeformLoop_D:
- move.l d0,(a1)+ ; dump both the FG and BG scanline position to buffer
- sub.b #1,d3 ; subtract for limit
- beq.w PGZ_Deform_Stop ; if 0, branch
- dbf d1,PGZ_DeformLoop_D ; repeat d1 number of scanlines
- move.w #16-1,d1 ; This is a dummy, change once background is imported
- PGZ_DeformE:
- move.w ($FFFFF700).w,d0 ; load FG screen's X position
- neg.w d0 ; negate (positive to negative)
- swap d0 ; send to the left side of d0
- lea ($FFFFA800).w,a2
- subq #$0002,(a2)
- move.w (a2),d0
- neg.w d0
- PGZ_DeformLoop_E:
- move.l d0,(a1)+ ; dump both the FG and BG scanline position to buffer
- sub.b #1,d3 ; subtract for limit
- beq.w PGZ_Deform_Stop ; if 0, branch
- dbf d1,PGZ_DeformLoop_E ; repeat d1 number of scanlines
- move.w #80-1,d1 ; This is a dummy, change once background is imported
- PGZ_DeformF:
- move.w ($FFFFF700).w,d0 ; load FG screen's X position
- neg.w d0 ; negate (positive to negative)
- swap d0 ; send to the left side of d0
- move.w ($FFFFF708).w,d0 ; load BG screen's X position
- neg.w d0 ; negate (positive to negative)
- asr.w #3,d0 ; divide
- PGZ_DeformLoop_F:
- move.l d0,(a1)+ ; dump both the FG and BG scanline position to buffer
- sub.b #1,d3 ; subtract for limit
- beq.w PGZ_Deform_Stop ; if 0, branch
- dbf d1,PGZ_DeformLoop_F ; repeat d1 number of scanlines
- move.w #16-1,d1 ; This is a dummy, change once background is imported
- PGZ_Deform10:
- move.w ($FFFFF700).w,d0 ; load FG screen's X position
- neg.w d0 ; negate (positive to negative)
- swap d0 ; send to the left side of d0
- move.w ($FFFFF708).w,d0 ; load BG screen's X position
- neg.w d0 ; negate (positive to negative)
- asr.w #2,d0 ; divide
- PGZ_DeformLoop_10:
- move.l d0,(a1)+ ; dump both the FG and BG scanline position to buffer
- sub.b #1,d3 ; subtract for limit
- beq.w PGZ_Deform_Stop ; if 0, branch
- dbf d1,PGZ_DeformLoop_10 ; repeat d1 number of scanlines
- move.w #64-1,d1 ; This is a dummy, change once background is imported
- PGZ_Deform11:
- move.w ($FFFFF700).w,d0 ; load FG screen's X position
- neg.w d0 ; negate (positive to negative)
- swap d0 ; send to the left side of d0
- move.w ($FFFFF708).w,d0 ; load BG screen's X position
- neg.w d0 ; negate (positive to negative)
- move.w d0,d2 ; copy to d1
- asr.w #3,d0 ; divide
- asr.w #4,d2 ; divide
- sub.w d2,d0
- PGZ_DeformLoop_11:
- move.l d0,(a1)+ ; dump both the FG and BG scanline position to buffer
- sub.b #1,d3 ; subtract for limit
- beq.w PGZ_Deform_Stop ; if 0, branch
- dbf d1,PGZ_DeformLoop_11 ; repeat d1 number of scanlines
- move.w #16-1,d1 ; This is a dummy, change once background is imported
- PGZ_Deform12:
- move.w ($FFFFF700).w,d0 ; load FG screen's X position
- neg.w d0 ; negate (positive to negative)
- swap d0 ; send to the left side of d0
- move.w ($FFFFF708).w,d0 ; load BG screen's X position
- neg.w d0 ; negate (positive to negative)
- asr.w #2,d0 ; divide
- PGZ_DeformLoop_12:
- move.l d0,(a1)+ ; dump both the FG and BG scanline position to buffer
- sub.b #1,d3 ; subtract for limit
- beq.s PGZ_Deform_Stop ; if 0, branch
- dbf d1,PGZ_DeformLoop_12 ; repeat d1 number of scanlines
- move.w #32-1,d1 ; This is a dummy, change once background is imported
- PGZ_Deform13:
- move.w ($FFFFF700).w,d0 ; load FG screen's X position
- neg.w d0 ; negate (positive to negative)
- swap d0 ; send to the left side of d0
- move.w ($FFFFF708).w,d0 ; load BG screen's X position
- neg.w d0 ; negate (positive to negative)
- move.w d0,d2 ; copy to d1
- asr.w #3,d0 ; divide
- asr.w #4,d2 ; divide
- sub.w d2,d0
- PGZ_DeformLoop_13:
- move.l d0,(a1)+ ; dump both the FG and BG scanline position to buffer
- sub.b #1,d3 ; subtract for limit
- beq.s PGZ_Deform_Stop ; if 0, branch
- dbf d1,PGZ_DeformLoop_13 ; repeat d1 number of scanlines
- move.w #32-1,d1 ; This is a dummy, change once background is imported
- PGZ_Deform14:
- move.w ($FFFFF700).w,d0 ; load FG screen's X position
- neg.w d0 ; negate (positive to negative)
- swap d0 ; send to the left side of d0
- move.w ($FFFFF708).w,d0 ; load BG screen's X position
- neg.w d0 ; negate (positive to negative)
- asl.w #1,d2 ; divide
- PGZ_DeformLoop_14:
- move.l d0,(a1)+ ; dump both the FG and BG scanline position to buffer
- sub.b #1,d3 ; subtract for limit
- beq.s PGZ_Deform_Stop ; if 0, branch
- dbf d1,PGZ_DeformLoop_14 ; repeat d1 number of scanlines
- PGZ_Deform_Stop:
- rts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement