Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ***********************************************
- ; * *
- ; * The Stepping-Feet Illusion for Commodore 64 *
- ; * *
- ; * Assembly code by Kimono (Felice Nardella) *
- ; * *
- ; * Jan 2024 *
- ; * *
- ; ***********************************************
- * = $c000
- start
- jsr copySprite
- jsr setupSprite
- mainLoop
- jsr fillScreen
- jsr moveSprite
- jsr $e544 ; clear screen
- jsr moveSprite
- jmp mainLoop
- fillScreen
- ldx #0
- stx $d020 ; black border
- stx $d021 ; black screen
- loop_0
- lda #$a0 ; reverse space ascii code (160)
- sta $0400,x ; fills the first 255 screen locations
- sta $0401,x ;
- lda #1 ; first white
- sta $d800,x
- lda #0 ; second black
- sta $d801,x
- inx
- inx
- bne loop_0
- loop_1
- lda #$a0
- sta $0500,x
- sta $0501,x
- lda #1
- sta $d900,x
- lda #0
- sta $d901,x
- inx
- inx
- bne loop_1
- loop_2
- lda #$a0
- sta $0600,x
- sta $0601,x
- lda #1
- sta $da00,x
- lda #0
- sta $da01,x
- inx
- inx
- bne loop_2
- loop_3
- lda #$a0
- sta $0700,x
- sta $0701,x
- lda #1
- sta $db00,x
- lda #0
- sta $db01,x
- inx
- inx
- cpx #$e8
- bne loop_3
- rts
- setupSprite
- lda #$d ; 832/64 = 13
- sta $07f8 ; pointer sprite 0 (2040)
- lda #$e ; 896/64 = 14
- sta $07f9 ; pointer sprite 1 (2041)
- lda #%00000011 ;
- sta $d015 ; activate both sprites (53269)
- sta $d01d ; x sprite expansion
- lda #6 ; color blue (6)
- sta $d027 ; color sprite 0 (53287)
- lda #7 ; color yellow (7)
- sta $d028 ; color sprite 1 (53288)
- lda #24
- sta $d000 ; pos x sprite 0
- lda #115
- sta $d001 ; pos y sprite 0
- lda #24
- sta $d002 ; pos x sprite 1
- lda #165
- sta $d003 ; pos y sprite 1
- rts
- copySprite
- ldx #0
- lda #$ff
- c1
- sta $0340,x ; block 832
- sta $0380,x ; block 896
- inx
- cpx #$40
- bne c1
- rts
- moveSprite
- ldx #24
- m1
- stx $d000
- stx $d002
- inx
- jsr delay
- cpx #$ff
- bne m1
- jsr activateMSBx
- ldx #0
- m2
- stx $d000
- stx $d002
- inx
- jsr delay
- cpx #42
- bne m2
- m3
- stx $d000
- stx $d002
- jsr delay
- dex
- bne m3
- jsr disableMSBx
- ldx #$ff
- m4
- stx $d000
- stx $d002
- dex
- jsr delay
- cpx #24
- bne m4
- rts
- delay
- txa
- pha
- ldx #0
- ldy #0
- p1
- iny
- bne p1
- inx
- cpx #$20
- bne p1
- pla
- tax
- rts
- activateMSBx
- lda #%00000011 ;
- sta $d010 ; activate msb x for sprites
- rts
- disableMSBx
- lda #%00000000 ;
- sta $d010 ; disable msb x for sprites
- rts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement