aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-10-08 15:53:31 -0400
committerJesse Luehrs <doy@tozt.net>2014-10-08 15:53:31 -0400
commit010b3e9b73793b5eec2672e095062da29da907fd (patch)
tree7d5617811c9a379503f2ee7e42f2bbce546472ad
parentfe156a97d5373cd9a7b093ab1c40bda403ad93fb (diff)
downloadnes-snake-010b3e9b73793b5eec2672e095062da29da907fd.tar.gz
nes-snake-010b3e9b73793b5eec2672e095062da29da907fd.zip
don't draw the snake when on the title screen
-rw-r--r--main.s13
1 files changed, 12 insertions, 1 deletions
diff --git a/main.s b/main.s
index 33c73b2..65902fe 100644
--- a/main.s
+++ b/main.s
@@ -147,9 +147,13 @@ NMI:
PHA
LDA game_state
+ BEQ reset_sprites
CMP #$01
- BNE end_nmi
+ BEQ draw_head
+ CMP #$02
+ BEQ end_nmi
+draw_head:
LDA head_y
STA $0200
LDA #$00
@@ -158,7 +162,14 @@ NMI:
STA $0202
LDA head_x
STA $0203
+ JMP do_dmi
+reset_sprites:
+ LDA #$FE
+ STA $0200
+ STA $0203
+
+do_dmi:
LDA #$00
STA $2003
LDA #$02