Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lda #6
- sta $0 ;xpos
- lda #6
- sta $1 ;ypos
- lda #0
- sta $5 ;previous address
- lda #0
- sta $6
- ;$2 and $3 are the two addresses of the dot.
- jmp lewp
- duplicateBallAddress:
- lda $2
- sta $4
- lda $3
- sta $5
- rts
- drawBall:
- lda #0
- sta ($4), y ;erase previous ball
- lda $1 ;y position
- adc $1 ;double to get memory location
- tax
- lda ypos, x
- sta $2 ;lsb
- inx
- lda ypos, x ;msb
- sta $3
- lda $0 ;load x position
- clc
- adc $2 ;add x position
- sta $2
- lda #1
- sta ($2),y ;draw pixel
- rts
- lewp:
- jsr drawBall
- jsr duplicateBallAddress
- inc $0
- inc $1
- jmp lewp
- ypos:
- dcb $00,$02,$20,$02,$40,$02,$60,$02
- dcb $80,$02,$a0,$02,$c0,$02,$e0,$02
- dcb $00,$03,$20,$03,$40,$03,$60,$03
- dcb $80,$03,$a0,$03,$c0,$03,$e0,$03
- dcb $00,$04,$20,$04,$40,$04,$60,$04
- dcb $80,$04,$a0,$04,$c0,$04,$e0,$04
- dcb $00,$05,$20,$05,$40,$05,$60,$05
- dcb $80,$05,$a0,$05,$c0,$05,$e0,$05
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement