Added routine for full reset of the game

This commit is contained in:
giomba 2017-12-21 17:00:45 +01:00
parent 95ae7e2ab4
commit 6bb4a5151a

View File

@ -23,17 +23,17 @@ sidtune:
; Number of interrupt ; Number of interrupt
; Used as counter to be decremented to do some things less frequently ; Used as counter to be decremented to do some things less frequently
irqn: irqn:
BYTE #4 BYTE
; Direction of the snake (2,4,6,8 as down,left,right,up) ; Direction of the snake (2,4,6,8 as down,left,right,up)
direction: direction:
BYTE #6 BYTE
; Snake head coordinates in video memory ; Snake head coordinates in video memory
snakeX: snakeX:
BYTE #19 BYTE
snakeY: snakeY:
BYTE #12 BYTE
; Parameters for calcTileMem ; Parameters for calcTileMem
calcTileX: calcTileX:
@ -43,9 +43,9 @@ calcTileY:
; List start and length ; List start and length
listStart: listStart:
BYTE #5 BYTE
length: length:
BYTE #5 BYTE
; Random value ; Random value
random: random:
@ -76,11 +76,9 @@ gameoverString:
; ---------------------------------------------------------------------- ; ----------------------------------------------------------------------
. = $2200 . = $2200
listX: listX:
BYTE #19
. = $2300 . = $2300
listY: listY:
BYTE #12
; ENTRY OF PROGRAM ; ENTRY OF PROGRAM
; ---------------------------------------------------------------------- ; ----------------------------------------------------------------------
@ -150,12 +148,32 @@ upperbarLoop:
; Enable interrupts ; Enable interrupts
cli cli
jsr fullreset
; Endless loop, show that there is enogh time after the interrupt ; Endless loop, show that there is enogh time after the interrupt
endless: endless:
ldx $400 ldx $400
inx inx
stx $400 stx $400
jmp endless jmp endless
brk
; Full reset
; ----------------------------------------------------------------------
fullreset:
lda #4
sta irqn
lda #6
sta direction
lda #19
sta snakeX
lda #12
sta snakeY
lda #5
sta listStart
lda #5
sta length
rts
; Interrupt Handler ; Interrupt Handler
; ---------------------------------------------------------------------- ; ----------------------------------------------------------------------