Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rem msk_pf_rd demo
- includesfile multisprite.inc
- set kernel multisprite
- set romsize 4k
- dim sc0 = score
- dim sc1 = score + 1
- dim sc2 = score + 2
- dim sf = f
- player0x=25
- player0y=50
- COLUBK = $A2
- COLUPF = $00
- pfheight=7
- playfield:
- XXXXXXXXXXXXXXXX
- X...............
- X........X......
- X...............
- X...............
- X.......X.......
- X...............
- X...............
- X..X............
- X...............
- XXXXXXXXXXXXXXXX
- end
- player0:
- %00000000
- %00000000
- %00000000
- %00000000
- %00000000
- %00000000
- %00000000
- %00000000
- %10000000
- end
- main
- temp2 = ((SWCHA ^ $FF) & sf)/16 : sf = SWCHA
- temp3 = temp2 & 3 : player0y = player0y + dtbl[temp3]
- temp3 = (temp2/4) ^ 3 : player0x = player0x + dtbl[temp3]
- temp1 = player0x
- temp2 = player0y
- gosub update_scr
- temp1 = (player0x - 16)/4
- temp2 = (player0y-3)/8
- temp1 = msk_pf_rd(temp1, temp2)
- if temp1 then COLUP0 = $1A else COLUP0 = $44
- drawscreen
- goto main
- data dtbl
- 0, 1, -1, 0
- end
- function msk_pf_rd()
- if temp1 & 8 then temp1 = temp1 ^ 7
- if temp1 > 15 then temp1 = temp1 ^ 8
- if temp1 & 8 then skip_PF1
- asm
- ldy temp2
- lda (PF1pointer),y
- sta temp2
- end
- goto skip_PF2
- skip_PF1
- asm
- ldy temp2
- lda (PF2pointer),y
- sta temp2
- end
- skip_PF2
- temp1 = temp1 & 7
- temp1 = bits[temp1] & temp2
- if temp1 then temp1 = 255
- return
- data bits
- $80,$40,$20,$10,8,4,2,1
- end
- update_scr
- sc0 = 0 : sc1 = sc1 & 15
- if temp1 >= 100 then sc0 = sc0 + 16 : temp1 = temp1 - 100
- if temp1 >= 100 then sc0 = sc0 + 16 : temp1 = temp1 - 100
- if temp1 >= 50 then sc0 = sc0 + 5 : temp1 = temp1 - 50
- if temp1 >= 30 then sc0 = sc0 + 3 : temp1 = temp1 - 30
- if temp1 >= 20 then sc0 = sc0 + 2 : temp1 = temp1 - 20
- if temp1 >= 10 then sc0 = sc0 + 1 : temp1 = temp1 - 10
- sc1 = (temp1 * 4 * 4) | sc1
- sc1 = sc1 & 240 : sc2 = 0
- if temp2 >= 100 then sc1 = sc1 + 1 : temp2 = temp2 - 100
- if temp2 >= 100 then sc1 = sc1 + 1 : temp2 = temp2 - 100
- if temp2 >= 50 then sc2 = sc2 + 80 : temp2 = temp2 - 50
- if temp2 >= 30 then sc2 = sc2 + 48 : temp2 = temp2 - 30
- if temp2 >= 20 then sc2 = sc2 + 32 : temp2 = temp2 - 20
- if temp2 >= 10 then sc2 = sc2 + 16 : temp2 = temp2 - 10
- sc2 = sc2 | temp2
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement