Added simple intro layout
This commit is contained in:
parent
d28e93f54e
commit
14952319dd
29
snake.asm
29
snake.asm
@ -54,6 +54,10 @@ length:
|
|||||||
random:
|
random:
|
||||||
BYTE
|
BYTE
|
||||||
|
|
||||||
|
; Status (0 intro playing, 1 game running)
|
||||||
|
status:
|
||||||
|
BYTE
|
||||||
|
|
||||||
; Costants
|
; Costants
|
||||||
; ----------------------------------------------------------------------
|
; ----------------------------------------------------------------------
|
||||||
|
|
||||||
@ -149,13 +153,25 @@ upperbarLoop:
|
|||||||
|
|
||||||
jsr fullreset
|
jsr fullreset
|
||||||
|
|
||||||
; Endless loop, show that there is enogh time after the interrupt
|
; Simple intro
|
||||||
|
intro:
|
||||||
|
ldx 53280
|
||||||
|
inx
|
||||||
|
stx 53280
|
||||||
|
|
||||||
|
jsr $ffe4
|
||||||
|
cmp #$20
|
||||||
|
bne intro
|
||||||
|
|
||||||
|
lda #1
|
||||||
|
sta status
|
||||||
|
|
||||||
endless:
|
endless:
|
||||||
|
; Endless loop, show that there is enogh time after the interrupt
|
||||||
ldx $400
|
ldx $400
|
||||||
inx
|
inx
|
||||||
stx $400
|
stx $400
|
||||||
jmp endless
|
jmp endless
|
||||||
brk
|
|
||||||
|
|
||||||
; Full reset
|
; Full reset
|
||||||
; ----------------------------------------------------------------------
|
; ----------------------------------------------------------------------
|
||||||
@ -172,6 +188,8 @@ fullreset:
|
|||||||
sta listStart
|
sta listStart
|
||||||
lda #5
|
lda #5
|
||||||
sta length
|
sta length
|
||||||
|
lda #0
|
||||||
|
sta status
|
||||||
rts
|
rts
|
||||||
|
|
||||||
; Interrupt Handler
|
; Interrupt Handler
|
||||||
@ -180,6 +198,13 @@ irq:
|
|||||||
; Acknoweledge IRQ
|
; Acknoweledge IRQ
|
||||||
dec $d019
|
dec $d019
|
||||||
|
|
||||||
|
; Check status
|
||||||
|
lda status
|
||||||
|
cmp #1
|
||||||
|
beq doGame ; if status is 1, must do game
|
||||||
|
jmp irqalways ; else simply do every-interrupt tasks (always-do)
|
||||||
|
|
||||||
|
doGame:
|
||||||
; Check counter
|
; Check counter
|
||||||
ldx irqn
|
ldx irqn
|
||||||
dex
|
dex
|
||||||
|
Loading…
Reference in New Issue
Block a user