aboutsummaryrefslogtreecommitdiff
path: root/src/driver.s
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2025-03-13 22:52:49 +0100
committerMiquel Sabaté Solà <mikisabate@gmail.com>2025-03-13 22:52:49 +0100
commit9ff2033e936689135210989a5fee057a4a13527e (patch)
treedd41ffd78f451d28a554f105ff40017ed31106a2 /src/driver.s
parent2627b459d9a19ce7f1b7f3a359dca3b30b66b34e (diff)
downloadjetpac.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/driver.s')
-rw-r--r--src/driver.s28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/driver.s b/src/driver.s
new file mode 100644
index 0000000..521c335
--- /dev/null
+++ b/src/driver.s
@@ -0,0 +1,28 @@
+.segment "CODE"
+
+.scope Driver
+ .proc switch
+ ;; Get the assets ready for the main screen. That is, make sure that the
+ ;; palettes and such are as desired since the title screen needed
+ ;; another setup.
+ jsr Assets::prepare_for_main_screen
+
+ ;; Switch to the other base nametable.
+ lda #%10001010
+ sta PPU::zp_control
+
+ ;; Mark the state of the game as "game". That is, the player has
+ ;; started. Also set the `ppu` flag so the PPU control update takes
+ ;; place.
+ lda #%01000001
+ ora Globals::zp_flags
+ sta Globals::zp_flags
+
+ rts
+ .endproc
+
+ .proc update
+ ;; TODO
+ rts
+ .endproc
+.endscope