diff options
| author | Miquel Sabaté Solà <mikisabate@gmail.com> | 2025-03-13 22:52:49 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mikisabate@gmail.com> | 2025-03-13 22:52:49 +0100 |
| commit | 9ff2033e936689135210989a5fee057a4a13527e (patch) | |
| tree | dd41ffd78f451d28a554f105ff40017ed31106a2 /src/vectors.s | |
| parent | 2627b459d9a19ce7f1b7f3a359dca3b30b66b34e (diff) | |
| download | jetpac.nes-9ff2033e936689135210989a5fee057a4a13527e.tar.gz jetpac.nes-9ff2033e936689135210989a5fee057a4a13527e.zip | |
Add a title and a main screens
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à <mikisabate@gmail.com>
Diffstat (limited to 'src/vectors.s')
| -rw-r--r-- | src/vectors.s | 27 |
1 files changed, 27 insertions, 0 deletions
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 |
