aboutsummaryrefslogtreecommitdiff
path: root/src/interrupts.s
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-03-11 23:44:13 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-03-11 23:44:13 +0100
commit9ae51a4c210b8f01718e21eda592c498715a642b (patch)
tree90867f95c133b8c4383a9559075b73b77b92c98b /src/interrupts.s
parenta0ef7b9c4d341de3f3f518626c40576e45cbf244 (diff)
downloadjetpac.nes-9ae51a4c210b8f01718e21eda592c498715a642b.tar.gz
jetpac.nes-9ae51a4c210b8f01718e21eda592c498715a642b.zip
Initial implementation for items
This now only supports the appearance of shuttle parts and the fact that the player can collect them at a very specific order and drop them so to stack up the final shuttle. This is of course just the skeleton and there's a bunch of TODO's left. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'src/interrupts.s')
-rw-r--r--src/interrupts.s18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/interrupts.s b/src/interrupts.s
index c5eb306..81709ed 100644
--- a/src/interrupts.s
+++ b/src/interrupts.s
@@ -62,7 +62,7 @@
;; Do we need to update the lifes from players on the HUD?
lda Player::zp_state
and #%00001000
- beq @global_flags
+ beq @shuttle_update
;; Yeah!
@@ -97,9 +97,21 @@
and #%11110111
sta Player::zp_state
-@global_flags:
- ;; TODO: some actions here will depend on the status of the game...
+@shuttle_update:
+ ;; Should the shuttle be updated?
lda Globals::zp_flags
+ tax
+ and #%00100000
+ beq @game_status
+ jsr Items::update_shuttle
+
+ ;; And unset the flag.
+ lda Globals::zp_flags
+ and #%11011111
+ sta Globals::zp_flags
+
+@game_status:
+ txa
and #%00000001
bne @ppu_registers