aboutsummaryrefslogtreecommitdiff
path: root/src/interrupts.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/interrupts.s')
-rw-r--r--src/interrupts.s22
1 files changed, 22 insertions, 0 deletions
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