map: Added main menu map
authorLukas Krickl <lukas@krickl.dev>
Sat, 11 Oct 2025 15:19:50 +0000 (17:19 +0200)
committerLukas Krickl <lukas@krickl.dev>
Sat, 11 Oct 2025 15:19:50 +0000 (17:19 +0200)
For now this map just loads l1 right away.
In the future there will be a menu here :)

src/main.s
src/mainmenu.s [new file with mode: 0644]
src/map.s
src/update.s

index ca2b769198cae20a467ac7172f36fdcb98579590..e0f331a5798ac96fbd188db27efadeb7118df4ba 100644 (file)
@@ -68,6 +68,7 @@ main:
 #include "actor.s"
 #include "rectangle.s"
 #include "projectile.s"
+#include "mainmenu.s"
 
 #include "tiles.inc"
 #include "text.s"
diff --git a/src/mainmenu.s b/src/mainmenu.s
new file mode 100644 (file)
index 0000000..8004e89
--- /dev/null
@@ -0,0 +1,16 @@
+       
+       ; map routine that loads l1
+map_r_load_l1:
+       ld de, l1_map
+       call map_load
+       ret
+
+l_main_menu:
+       mapdef 0, pat_empty, l_main_menu_objs, bank8000, bank8800, bank8C00, bank9000
+
+l_main_menu_objs:
+       modef MOT_SET_MAP_ROUTINE, 0, 0, map_r_load_l1
+       modef MOT_DISABLE_SCROLL, 0, 0, 0
+       modef MOT_NOP, 0, 0xFF, 0
+
+
index 93f00dfbc640f971a12a28dc99208f29dba67853..fa7c30837f867ad59e179a4f7e822167d01168df 100644 (file)
--- a/src/map.s
+++ b/src/map.s
@@ -16,6 +16,13 @@ map_clear_routine:
        ; inputs:
        ;               de: map ptr
 map_load:
+       ; clear row
+       xor a, a
+       ld [map_curr_row], a
+
+       ; enable scroll
+       call mo_enable_scroll
+
        ; clear map routine
        call map_clear_routine
 
index 4248076ab45216899df7c4c069ca65197378a204..1c08a846581f58ca3ad64e531e7e26cb950522bc 100644 (file)
@@ -25,7 +25,7 @@ update_game:
   ret
 
 new_game:
-       ld de, l1_map
+       ld de, l_main_menu
        call map_load
 
        ld hl, update_game