aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-10-04 21:23:15 -0400
committerJesse Luehrs <doy@tozt.net>2014-10-04 21:23:15 -0400
commit80f3c023c52fb1e25f8d832440cd5e11fe91a3bd (patch)
treeb313eea600b2ea0d5d5992014c82bb55f11bae50
parent8495ebe542903a4fb93f7bbb19fc4e53d050073b (diff)
downloadnes-snake-80f3c023c52fb1e25f8d832440cd5e11fe91a3bd.tar.gz
nes-snake-80f3c023c52fb1e25f8d832440cd5e11fe91a3bd.zip
zero-page addressing for variables
-rw-r--r--snake.s16
1 files changed, 8 insertions, 8 deletions
diff --git a/snake.s b/snake.s
index f0cf151..1283db0 100644
--- a/snake.s
+++ b/snake.s
@@ -72,7 +72,7 @@ LoadPalettesLoop:
; initialize variables in ram
LDA #$00
- STA buttons_pressed.w
+ STA buttons_pressed
LDA #%00010000 ; enable sprites
STA $2001
@@ -98,9 +98,9 @@ read_controller1_values:
LDA $4016
AND #%00000001
- ASL buttons_pressed.w
- ORA buttons_pressed.w
- STA buttons_pressed.w
+ ASL buttons_pressed
+ ORA buttons_pressed
+ STA buttons_pressed
INX
JMP read_controller1_values
@@ -111,25 +111,25 @@ NMI:
JSR read_controller1
handle_up:
- LDA buttons_pressed.w
+ LDA buttons_pressed
AND #%00001000
CMP #$00
BEQ handle_down
handle_down:
- LDA buttons_pressed.w
+ LDA buttons_pressed
AND #%00000100
CMP #$00
BEQ handle_left
handle_left:
- LDA buttons_pressed.w
+ LDA buttons_pressed
AND #%00000010
CMP #$00
BEQ handle_right
handle_right:
- LDA buttons_pressed.w
+ LDA buttons_pressed
AND #%00000001
CMP #$00
BEQ nmi_return