From 6ef407f525324393600a9eb6a39ad7cf21a814a3 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Sun, 15 Mar 2026 22:50:12 +0100 Subject: Update the shuttle as fuel is getting in MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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à --- src/items.s | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 79 insertions(+), 9 deletions(-) (limited to 'src/items.s') 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 -- cgit v1.2.3