aboutsummaryrefslogtreecommitdiff
path: root/main.fab
diff options
context:
space:
mode:
Diffstat (limited to 'main.fab')
-rw-r--r--main.fab50
1 files changed, 46 insertions, 4 deletions
diff --git a/main.fab b/main.fab
index 948bd1c..8b52021 100644
--- a/main.fab
+++ b/main.fab
@@ -1,4 +1,4 @@
-vars /allvars
+vars /ecavars
U[64] buf // A buffer that can store the current and next row
U curr_gen = 0 // Swap these offsets back and forth per generation
U next_gen = 32
@@ -105,6 +105,8 @@ fn upload_curr_gen()
nmi eca_nmi()
// Turn on rendering sprites and bg
+ ppu_upload_oam_poll_pads(0)
+
{PPUMASK}(PPUMASK_ON | PPUMASK_NO_CLIP)
upload_curr_gen()
@@ -114,6 +116,11 @@ nmi eca_nmi()
// Main mode for running the ECA
mode eca_main()
: nmi eca_nmi
+: vars /ecavars
+ nmi
+ nmi
+ nmi
+ nmi
// Initialize the screen
init_eca_state()
// Wait 60 frames before beginning
@@ -122,9 +129,43 @@ mode eca_main()
// Loop forever:
while true
nmi
+ update_pads()
+ if pads[0].held & BUTTON_START
+ goto mode settings()
+ : preserves /ecavars
calc_and_advance_gen()
-charmap(".#-=n!@~E$%^S&*(C)_+A{}|12345678qwertyuiop<asd>")
+//charmap settingsscreen("E", 48)
+
+vars /settings_vars
+ U slow_counter = 0
+
+nmi settings_nmi()
+ // Turn on rendering sprites and bg
+ ppu_upload_oam_poll_pads(0)
+
+ {PPUMASK}(PPUMASK_ON | PPUMASK_NO_CLIP)
+
+ ppu_reset_scroll(0, 0)
+
+mode settings()
+: nmi settings_nmi
+: vars /ecavars
+: vars /settings_vars
+ nmi
+ nmi
+ nmi
+ nmi
+ while true
+ nmi
+ update_pads()
+ //update_cursor()
+ //upload_cursor()
+ if pads[0].held & BUTTON_START
+ goto mode eca_main()
+ : preserves /ecavars
+
+charmap (".#-=n!@~E$%^S&*(C)_+A{}|12345678qwertyuiop<asd>")
data /titlescreen
[] title
@@ -181,6 +222,7 @@ nmi main_nmi()
// The main entry point for the program
mode main()
: nmi main_nmi
+: vars /titlescreen /ecavars
// Set the palette:
palette = example_palette
ppu_upload_palette()
@@ -210,8 +252,8 @@ mode main()
nmi
// Go to the main eca mode
- goto mode eca_main()
- : preserves /allvars
+ goto mode settings()
+ : preserves /ecavars
// Define the tileset (commonly called CHR):
chrrom