diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2026-03-20 09:54:25 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2026-03-20 12:48:17 +0100 |
| commit | 8f7b8ce3335404badc276445d899372839cdde71 (patch) | |
| tree | c5422f80bc9e13f927965bfa655dd29d6bec5942 /src/over.s | |
| parent | 01f92b866eb4610b8d12008ea3389ac56052d20a (diff) | |
| download | jetpac.nes-8f7b8ce3335404badc276445d899372839cdde71.tar.gz jetpac.nes-8f7b8ce3335404badc276445d899372839cdde71.zip | |
Add support for the SUSE coin
This is a coin that appears after going through a first cycle of levels
and that allows the player to get a different game over screen than
usual.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'src/over.s')
| -rw-r--r-- | src/over.s | 58 |
1 files changed, 57 insertions, 1 deletions
@@ -67,9 +67,16 @@ @do_render: jsr Over::clear_out_screen - ;; TODO: coin game over. + lda Globals::zp_flags + and #$03 + cmp #2 + beq @regular + jsr Over::render_coin_game_over + jmp @next + @regular: jsr Over::render_regular_game_over + @next: ;; Enable back the PPU (only background). lda #%00001110 sta PPU::zp_mask @@ -234,4 +241,53 @@ ;; "OVER" .byte $29, $30, $1F, $2C, $FF .endproc + + ;; Render the "Game over" in the case the player has collected SUSE's coin. + ;; TODO: see how much it can be merged + ;; TODO: not centered nor fully realized. + .proc render_coin_game_over + ;; Set the position. + bit PPU::m_status + ldx #$29 + stx PPU::m_address + ldx #$6C + stx PPU::m_address + + ;; And just iterate over the "message" until we reach the end of string + ;; $FF character. + ldx #0 + @message_loop: + lda message, x + cmp #$FF + beq @out + sta PPU::m_data + inx + bne @message_loop + + @out: + ;; Reset attributes for the end of the message. + bit PPU::m_status + ldx #$2B + stx PPU::m_address + ldx #$D5 + stx PPU::m_address + lda #0 + sta PPU::m_data + sta PPU::m_data + sta PPU::m_data + + rts + + message: + ;; "YOU " + .byte $33, $29, $2F, $00 + ;; "ARE " + .byte $1B, $2C, $1F, $00 + ;; "A " + .byte $1B, $00 + ;; "SUPER " + .byte $2D, $2F, $2A, $1F, $2C, $00 + ;; "PLAYER!" TODO + .byte $2A, $26, $1B, $33, $1F, $2C, $FF + .endproc .endscope |
