Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .include "defs.s"
- DIRECTION = $2000
- .segment "VECTORS"
- .word nmi
- .word reset
- .word irq
- .code
- reset: jmp main
- nmi: rti
- irq: rti
- main: lda IO_MODEFLAG_VTERM
- sta IO_MODEFLAGS
- lda #(IO_PAINT_RED | IO_PAINT_BOLD)
- sta IO_PAINT
- lda #0
- sta DIRECTION
- ldx #0
- loop: jsr blank
- jsr draw
- jsr move
- jsr check
- jsr delay
- jmp loop
- blank: lda #' '
- ldy #39
- : sta IO_VTERM_START,y
- dey
- bmi :+
- jmp :-
- : rts
- draw: lda #'+'
- sta IO_VTERM_START,x
- rts
- move: lda DIRECTION
- cmp #0
- beq :+
- dex
- rts
- : inx
- rts
- check: txa
- cpx #0
- beq :+
- cpx #39
- bne :++
- lda #1
- sta DIRECTION
- rts
- : lda #0
- sta DIRECTION
- : rts
- delay: lda #$30
- : cmp #0
- beq :+++
- ldy #$FF
- : cpy #0
- beq :+
- nop
- nop
- nop
- nop
- nop
- dey
- jmp :-
- : sbc #1
- jmp :---
- : rts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement