aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-03-15 22:50:12 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-03-15 22:50:12 +0100
commit6ef407f525324393600a9eb6a39ad7cf21a814a3 (patch)
treea852f2c34167376fb90f4f018816615e4192b537 /src
parentcf3a0c963225068b6e3269f50e240950607a5c6b (diff)
downloadjetpac.nes-6ef407f525324393600a9eb6a39ad7cf21a814a3.tar.gz
jetpac.nes-6ef407f525324393600a9eb6a39ad7cf21a814a3.zip
Update the shuttle as fuel is getting in
Just like in the original, the shuttle turns purple for each fuel tank. That being said, due to the restriction from the NES/Famicom on updating background tile attributes, a "half-filled" strategy is being used here to convey the same idea for a total of 6 fuel tanks to be delivered. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'src')
-rw-r--r--src/items.s88
1 files changed, 79 insertions, 9 deletions
diff --git a/src/items.s b/src/items.s
index dc5b018..1490174 100644
--- a/src/items.s
+++ b/src/items.s
@@ -816,21 +816,91 @@
;;
;; NOTE: this has to be called with the PPU disabled.
.proc update_shuttle
- lda Globals::zp_level_kind
- bne @fuel
+ lda Items::zp_collected
+ cmp #9
+ bne @high_middle
+ bit PPU::m_status
+ lda #$2B
+ sta PPU::m_address
+ lda #$E5
+ sta PPU::m_address
+ lda #%10100000
+ sta PPU::m_data
+ jmp @end
+
+ @high_middle:
+ lda Items::zp_collected
+ cmp #8
+ bcc @half_high_middle
+ bit PPU::m_status
+ lda #$2B
+ sta PPU::m_address
+ lda #$ED
+ sta PPU::m_address
+ lda #%10101010
+ sta PPU::m_data
+ bne @end
+
+ @half_high_middle:
+ lda Items::zp_collected
+ cmp #7
+ bcc @low_middle
+ bit PPU::m_status
+ lda #$2B
+ sta PPU::m_address
+ lda #$ED
+ sta PPU::m_address
+ lda #%10100010
+ sta PPU::m_data
+ bne @end
- ;; Update the shuttle.
+ @low_middle:
lda Items::zp_collected
+ cmp #6
+ bcc @half_low_middle
+ bit PPU::m_status
+ lda #$2B
+ sta PPU::m_address
+ lda #$ED
+ sta PPU::m_address
+ lda #%10100000
+ sta PPU::m_data
+ bne @end
+
+ @half_low_middle:
+ lda Items::zp_collected
+ cmp #5
+ bcc @low
+ bit PPU::m_status
+ lda #$2B
+ sta PPU::m_address
+ lda #$ED
+ sta PPU::m_address
+ lda #%00100000
+ sta PPU::m_data
+ bne @end
+
+ @low:
+ lda Items::zp_collected
+ cmp #4
+ bcc @just_top
+ bit PPU::m_status
+ lda #$2B
+ sta PPU::m_address
+ lda #$F5
+ sta PPU::m_address
+ lda #%10101010
+ sta PPU::m_data
+
+ @just_top:
cmp #3
- bne @mid_shuttle
+ bcc @just_middle
jsr draw_high_part_shuttle
- @mid_shuttle:
- jsr draw_middle_part_shuttle
- rts
- @fuel:
- ;; TODO
+ @just_middle:
+ jsr draw_middle_part_shuttle
+ @end:
rts
.endproc