Added pause feature
This commit is contained in:
parent
23343d93f3
commit
f528c5f22a
17
snake.asm
17
snake.asm
@ -26,6 +26,7 @@ irqn:
|
||||
BYTE
|
||||
|
||||
; Direction of the snake (2,4,6,8 as down,left,right,up)
|
||||
; 5 means `pause`
|
||||
direction:
|
||||
BYTE
|
||||
|
||||
@ -225,13 +226,19 @@ keybCheckD:
|
||||
jmp keybEndCheck
|
||||
keybCheckW:
|
||||
cmp #$57
|
||||
bne keybEndCheck
|
||||
bne keybCheckP
|
||||
lda direction
|
||||
cmp #2
|
||||
beq keybEndCheck
|
||||
lda #8
|
||||
sta direction
|
||||
jmp keybEndCheck
|
||||
keybCheckP:
|
||||
cmp #$50
|
||||
bne keybEndCheck
|
||||
lda #5
|
||||
sta direction
|
||||
jmp keybEndCheck
|
||||
keybEndCheck:
|
||||
|
||||
; Get direction and move head accordingly
|
||||
@ -256,10 +263,14 @@ dirCheck6:
|
||||
stx snakeX
|
||||
dirCheck8:
|
||||
cmp #8
|
||||
bne dirEndCheck
|
||||
bne dirCheck5
|
||||
ldy snakeY
|
||||
dey
|
||||
sty snakeY
|
||||
dirCheck5:
|
||||
cmp #5
|
||||
bne dirEndCheck
|
||||
jmp skipPauseTests
|
||||
dirEndCheck:
|
||||
|
||||
; Check screen boundaries overflow
|
||||
@ -386,6 +397,8 @@ checkEndSelfEat:
|
||||
lda #$20 ; just put a space to erase snake tail tile
|
||||
sta (tileMem),y
|
||||
|
||||
skipPauseTests:
|
||||
|
||||
irqalways:
|
||||
; Things that must be done every interrupt (50Hz)
|
||||
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
Loading…
Reference in New Issue
Block a user