From 4c8ed456d990ee99884e9dcd245f665ccb894b50 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 19 Mar 2025 17:28:36 +0100 Subject: Disable the PPU between the title to main screens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During other transitions like game over and such it might also be needed to have something similar, but for now this should cut it. Signed-off-by: Miquel Sabaté Solà --- src/assets.s | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 6 deletions(-) (limited to 'src/assets.s') diff --git a/src/assets.s b/src/assets.s index 8e839d3..ffc6585 100644 --- a/src/assets.s +++ b/src/assets.s @@ -74,7 +74,30 @@ dex bne @upper_title_bar_loop - ;; TODO: store back palettes after game over. + ;; Update 2nd palette for background. This is redundant upon entering + ;; the game, but it makes sense after a game over. + lda #$3F + sta PPU::ADDRESS + lda #$09 + sta PPU::ADDRESS + lda #$28 + sta PPU::DATA + lda #$2C + sta PPU::DATA + lda #$16 + sta PPU::DATA + + ;; Update 1st palette for foreground. + lda #$3F + sta PPU::ADDRESS + lda #$11 + sta PPU::ADDRESS + lda #$30 + sta PPU::DATA + lda #$10 + sta PPU::DATA + lda #$30 + sta PPU::DATA rts .endproc @@ -82,11 +105,32 @@ ;; Performs all the needed tricks in order to get the second nametable as ;; expected. .proc prepare_for_main_screen - ;; TODO: second palette for background should be: - ;; .byte $0F, $14, $2C, $28 - ;; - ;; TODO: first palette for the foreground should be: - ;; .byte $0F, $16, $10, $30 + bit PPU::STATUS + + ;; Update 2nd palette for background. + lda #$3F + sta PPU::ADDRESS + lda #$09 + sta PPU::ADDRESS + lda #$14 + sta PPU::DATA + lda #$2C + sta PPU::DATA + lda #$28 + sta PPU::DATA + + ;; Update 1st palette for foreground. + lda #$3F + sta PPU::ADDRESS + lda #$11 + sta PPU::ADDRESS + lda #$16 + sta PPU::DATA + lda #$10 + sta PPU::DATA + lda #$30 + sta PPU::DATA + rts .endproc -- cgit v1.2.3