From dbcbd43287a28bf087e20e660edd5ba40b5c27ec Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 4 Mar 2026 23:44:47 +0100 Subject: Update lifes left for player 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The whole handling of player 2 will come whenever I set to implement multi-player for this game. Signed-off-by: Miquel Sabaté Solà --- src/interrupts.s | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/interrupts.s') diff --git a/src/interrupts.s b/src/interrupts.s index 8c53af7..b5120b4 100644 --- a/src/interrupts.s +++ b/src/interrupts.s @@ -34,6 +34,28 @@ jsr Driver::pal_handler .endif + ;; Do we need to update the lifes from players on the HUD? + lda Player::zp_state + and #%00001000 + beq @global_flags + + ;; Yeah! TODO: this is only done for player 1. + bit PPU::m_status + lda #$28 + sta PPU::m_address + lda #$4B + sta PPU::m_address + lda Player::zp_lifes + clc + adc #$10 + sta PPU::m_data + + ;; And unset the 'life' flag from the player. + lda Player::zp_state + and #%11110111 + sta Player::zp_state + +@global_flags: ;; TODO: some actions here will depend on the status of the game... lda Globals::zp_flags and #%00000001 -- cgit v1.2.3