aboutsummaryrefslogtreecommitdiff
path: root/src/jetpac.s
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-03-08 22:09:31 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-03-08 22:14:15 +0100
commitf1d1d0efee9faa3067f7b0fc8b9a2aebb17f1ccd (patch)
treeeb6c2008a025f6ae88f7dc1e3f61360599189e0e /src/jetpac.s
parentfeed0b705daff0001253b6ec89b61c9821d2fe21 (diff)
downloadjetpac.nes-f1d1d0efee9faa3067f7b0fc8b9a2aebb17f1ccd.tar.gz
jetpac.nes-f1d1d0efee9faa3067f7b0fc8b9a2aebb17f1ccd.zip
Support reading from the second controller
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'src/jetpac.s')
-rw-r--r--src/jetpac.s10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/jetpac.s b/src/jetpac.s
index 25fdf5a..5fdd01f 100644
--- a/src/jetpac.s
+++ b/src/jetpac.s
@@ -125,8 +125,8 @@
;; variables defined before
sta Globals::zp_flags
sta Globals::zp_multiplayer
- sta Joypad::zp_buttons1
- sta Joypad::zp_buttons2
+ sta Joypad::zp_buttons
+ sta Joypad::zp_prev
sta Player::zp_state
;; Initialize the level. We allow the build system to pass its own value for
@@ -187,7 +187,11 @@
sta PPU::m_mask
@main_game_loop:
- READ_JOYPAD1
+ ;; Select the joypad from the active player and read it.
+ lda Globals::zp_multiplayer
+ and #$01
+ tax
+ READ_JOYPAD_X
lda Globals::zp_flags
and #%00000011