diff options
| -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 |
