aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-03-06 23:23:03 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-03-06 23:23:03 +0100
commit53b6d7eb0461d63f580c5a2612b71a735a5ecba1 (patch)
tree5559c010c5cf1cd97c549b2a1bd8c7bd51ad200d
parentdd4b095f81cdd9fe8beb5361485c6c6285819834 (diff)
downloadjetpac.nes-53b6d7eb0461d63f580c5a2612b71a735a5ecba1.tar.gz
jetpac.nes-53b6d7eb0461d63f580c5a2612b71a735a5ecba1.zip
Fix bounce up for cross enemies
Some old code was checking on the kind of level and skipping the bottom check if it was a half-sized enemy. However, the 'bounce' algorithm is not used by any half-sized enemy. Thus, the check can be removed entirely. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
-rw-r--r--.nasm/segments.txt2
-rw-r--r--src/enemies.s12
2 files changed, 2 insertions, 12 deletions
diff --git a/.nasm/segments.txt b/.nasm/segments.txt
index 5907869..5bd1c28 100644
--- a/.nasm/segments.txt
+++ b/.nasm/segments.txt
@@ -1,4 +1,4 @@
- HEADER: 16/16 (100%)
-- ROM0: 6561/32762 (20.03%)
+- ROM0: 6551/32762 (20.00%)
- ROMV: 6/6 (100%)
- ROM2: 8192/8192 (100%)
diff --git a/src/enemies.s b/src/enemies.s
index b4511e6..b6005fc 100644
--- a/src/enemies.s
+++ b/src/enemies.s
@@ -872,7 +872,7 @@
inc Globals::zp_arg1
inc Globals::zp_arg1
jsr Background::collides
- beq @check_front_or_bottom
+ beq @prepare_check_front_collision
;; There was a (hopefully purely) upper collision!
@bounce_down:
@@ -891,16 +891,6 @@
rts
- ;; Now, depending on the level, the enemy might be the regular size or
- ;; shorter. If it's on the shorter end, then move to check the bottom
- ;; corners directly.
- @check_front_or_bottom:
- lda Globals::zp_level_kind
- cmp #2
- beq @prepare_check_front_collision
- cmp #1
- bne @check_bottom
-
@prepare_check_front_collision:
;; We are checking the "front" (center) of the enemy, which corresponds
;; to the regular sized enemy. This means to increase the Y tile