From 9ff2033e936689135210989a5fee057a4a13527e Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Thu, 13 Mar 2025 22:52:49 +0100 Subject: Add a title and a main screens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds the skeleton for having a title and a main screen. For now the title menu doesn't do much, as the selection is simply ignored, but at least it already knows how to cycle between these two states. Signed-off-by: Miquel Sabaté Solà --- src/vectors.s | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/vectors.s') diff --git a/src/vectors.s b/src/vectors.s index 2edc6a6..b06f404 100644 --- a/src/vectors.s +++ b/src/vectors.s @@ -78,16 +78,43 @@ tya pha + ;; Sprite DMA. lda #$00 sta OAM::ADDRESS lda #$02 sta OAM::DMA + ;; TODO: some actions here will depend on the status of the game... + + ;; Decrease title timer. + lda Title::zp_title_timer + beq :+ + dec Title::zp_title_timer +: + + ;; Should we update PPU registers? + bit Globals::zp_flags + bvc @scroll + + ;; Zero out the `ppu` flag. + lda #%10111111 + and Globals::zp_flags + sta Globals::zp_flags + + bit PPU::STATUS + + ;; Update the PPU control register with the shadowed value. + lda PPU::zp_control + sta PPU::CONTROL + +@scroll: + ;; Always reset the scroll just in case. bit PPU::STATUS lda #$00 sta PPU::SCROLL sta PPU::SCROLL + ;; Unblock the main code. lda #%01111111 and Globals::zp_flags sta Globals::zp_flags -- cgit v1.2.3