aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-03-18 00:01:17 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-03-18 00:01:17 +0100
commitc961e1fed5d31f5f9b7c9cf016790c9612f85978 (patch)
tree62b973dc8455c6b706b40807769432b7158ba10f /src
parent3a4ae1f5ef956ff243b80610e0ca00085edba0e5 (diff)
downloadjetpac.nes-c961e1fed5d31f5f9b7c9cf016790c9612f85978.tar.gz
jetpac.nes-c961e1fed5d31f5f9b7c9cf016790c9612f85978.zip
Add missing 'Items::zp_current_tiles' updates
Collisions are based on this, so we better not forget updating these values. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'src')
-rw-r--r--src/items.s17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/items.s b/src/items.s
index 7d22828..e90ae82 100644
--- a/src/items.s
+++ b/src/items.s
@@ -382,8 +382,18 @@
clc
adc #8
sta Items::zp_pool_base + 1, x
+ lsr
+ lsr
+ lsr
+ sta Items::zp_current_tiles, x
lda zp_player_screen_x
+ tay
sta Items::zp_pool_base + 2, x
+ lsr
+ lsr
+ lsr
+ sta Items::zp_current_tiles + 1, x
+ tya
;; Are we at the zone where we must drop items?
cmp #DROPPING_SCREEN_X - 8
@@ -412,6 +422,10 @@
;; adjust from the player's subpixel movement.
lda #DROPPING_SCREEN_X
sta Items::zp_pool_base + 2, x
+ lsr
+ lsr
+ lsr
+ sta Items::zp_current_tiles + 1, x
jmp @next
@@ -626,7 +640,7 @@
rts
.endproc
- ;; Initialize an ite from the pool as indexed by the 'x' register.
+ ;; Initialize an item from the pool as indexed by the 'x' register.
;;
;; NOTE: the 'x' register is modified, but the 'y' register is not touched.
.proc init_item_x
@@ -774,7 +788,6 @@
and #$7F
ora #$40
sta Items::zp_pool_base, x
- ;; TODO: what if it died while on the ground
;; Unset the 'grabbing' bit, and increase the number of falling items.
lda Items::zp_state