aboutsummaryrefslogtreecommitdiff
path: root/src/items.s
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-04-02 07:51:13 +0200
committerMiquel Sabaté Solà <mssola@mssola.com>2026-04-02 07:51:13 +0200
commit98e1b21daf3b9ed2fa4fb38dde3c94c6a9f0a459 (patch)
tree83da66f8af265abb1841a7a11045781e427778b7 /src/items.s
parent1272d402ce2651e4e3966ecd2af2417eea66b0a3 (diff)
downloadjetpac.nes-98e1b21daf3b9ed2fa4fb38dde3c94c6a9f0a459.tar.gz
jetpac.nes-98e1b21daf3b9ed2fa4fb38dde3c94c6a9f0a459.zip
Fix wrong initialization on shuttle reassemble
The shuttle should be reassembled every 4 stages, not 8. I did not remember well how this worked and I jumped ahead with the conveniency of the 'Globals::zp_level_kind' variable. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'src/items.s')
-rw-r--r--src/items.s14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/items.s b/src/items.s
index 164d5b7..9ad1aba 100644
--- a/src/items.s
+++ b/src/items.s
@@ -130,7 +130,9 @@
.proc init_level
ldx #0
- lda Globals::zp_level_kind
+ ;; We have to re-assemble the shuttle every 4 stages.
+ lda Globals::zp_level
+ and #$03
bne @other_screens
;; Zero out the state except for the 'C' bit.
@@ -640,9 +642,10 @@
bit Items::zp_state
bmi @next
- ;; We don't need extra precautions except when the level kind is the
- ;; first one. In that case we must guarantee the right shuttle order.
- lda Globals::zp_level_kind
+ ;; We don't need extra precautions except when we are re-arrenging the
+ ;; shuttle. In that case we must guarantee the right shuttle order.
+ lda Globals::zp_level
+ and #$03
bne @do_follow_player
;; Is this the first shuttle part to be collected?
@@ -1005,7 +1008,8 @@
.proc prepare_background_scene
jsr draw_low_part_shuttle
- lda Globals::zp_level_kind
+ lda Globals::zp_level
+ and #$03
beq @end
@rest_of_the_rocket: