aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-10-09 13:19:33 -0400
committerJesse Luehrs <doy@tozt.net>2014-10-09 13:19:33 -0400
commitc892af763c8794ab0b3b8bccc2b5d409566b3c26 (patch)
treecd326caf6101a1354f543b0993023f4e9614cbd9
parente039f249a80f9068518579c06e8b4a8cef7b7339 (diff)
downloadnes-snake-c892af763c8794ab0b3b8bccc2b5d409566b3c26.tar.gz
nes-snake-c892af763c8794ab0b3b8bccc2b5d409566b3c26.zip
start making the snake use a ring buffer
-rw-r--r--main.s11
1 files changed, 11 insertions, 0 deletions
diff --git a/main.s b/main.s
index cce0ae4..55948b4 100644
--- a/main.s
+++ b/main.s
@@ -275,6 +275,17 @@ apply_direction:
TXA
CLC
ADC (head), y ; head.x offset by 1 is head.y
+ INC head
+ INC head
+ STA (head), y
+ DEC head
+ DEC head
+ TYA
+ EOR #$01
+ TAY
+ LDA (head), y
+ INC head
+ INC head
STA (head), y
check_collisions