mainmenu: lcd is now disabled when writing menu
authorLukas Krickl <lukas@krickl.dev>
Tue, 15 Jul 2025 03:45:30 +0000 (05:45 +0200)
committerLukas Krickl <lukas@krickl.dev>
Tue, 15 Jul 2025 03:45:30 +0000 (05:45 +0200)
Maps kinda want lcd enabled during load.
The menu should not really have the lcd on anyway.
Maybe one day vblank_wait should just return if the lcd is off....

src/defs.s
src/mainmenu.s
src/strings.s
src/video.s

index 515964cfcf74a2cd8a7f9ffcbfd48f8cc84e10a8..1dce131f1280356a2fe13d764de9a0099f5a685d 100644 (file)
 .de act_size, 0
   
   ; max bge queue size
-#define BGE_MAX 16
+#define BGE_MAX 8
 
   ; max bg updates per frame
 #define BG_UPDATE_MAX 8 
index a1091e53eaa1f6fd0a936a1ae0be291733433509..dfcaf2bd8fe7f72f9d4bec6d24cd9e5d3e1021ee 100644 (file)
@@ -24,6 +24,8 @@ main_menu_init:
   ; to get the engine to load a tileset
   call map_init
   
+  call lcd_off
+
   ld hl, STR_PRESS_START 
   ld de, SCRN0+128+2
   call puts
@@ -32,7 +34,8 @@ main_menu_init:
   ld a, 144
   ld [RWY], a
   ld [RWX], a
-
+  
+  call lcd_on
   call video_fade_in
   ldnull bc
   ret
index fac3a480a61bfa70aaa2b7882f377a2cd2f34834..7337f6d732260de0add208c8e4904fd5e6cb9ce1 100644 (file)
@@ -26,7 +26,7 @@ STR_PANIC:
 .db 0
 
 STR_TEST:
-.str "0123456789ABCDEF"
+.str "01234567"
 .db 0
 
 STR_PRESS_START:
index f4f7a47742e8b208ab2eecb227dfdae724717861..8301bc617417b581fb2584dbb4c2769dca096b92 100644 (file)
@@ -13,12 +13,14 @@ vblank:
 
   ; dma previous frame's oam
   call OAMDMAFN
+
+  call bg_update_queue_process
+  
+  call scroll_write
   
   ; get inputs 
   call poll_inputs
 
-  call scroll_write
-  call bg_update_queue_process
 
   ; cycle bg tiles for animations
   ld a, [frame_count]
@@ -185,6 +187,7 @@ video_fade_out:
   video_fade_set_bgp 0b11000000
   video_fade_set_bgp 0b00000000
 
+  call disableinterrutpts
   pop_all
   ret
 
@@ -198,6 +201,8 @@ video_fade_out:
 video_fade_in:
   push_all
 
+  call enableinterrupts
+
   ; disable winodw
   ld a, [RLCD]
   and a, ~LCDF_WINDOWON & 0xFF