diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2026-03-15 22:50:12 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2026-03-15 22:50:12 +0100 |
| commit | 6ef407f525324393600a9eb6a39ad7cf21a814a3 (patch) | |
| tree | a852f2c34167376fb90f4f018816615e4192b537 | |
| parent | cf3a0c963225068b6e3269f50e240950607a5c6b (diff) | |
| download | jetpac.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>
| -rw-r--r-- | .nasm/segments.txt | 2 | ||||
| -rw-r--r-- | src/items.s | 88 |
2 files changed, 80 insertions, 10 deletions
diff --git a/.nasm/segments.txt b/.nasm/segments.txt index 28e3a9a..bb3538d 100644 --- a/.nasm/segments.txt +++ b/.nasm/segments.txt @@ -1,4 +1,4 @@ - HEADER: 16/16 (100%) -- ROM0: 7838/32762 (23.92%) +- ROM0: 7986/32762 (24.38%) - ROMV: 6/6 (100%) - ROM2: 8192/8192 (100%) 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 |
