From 842d65760a28a3ebf1b51e3e177afdfb574aa29d Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Tue, 15 Jul 2025 05:45:30 +0200 Subject: [PATCH] mainmenu: lcd is now disabled when writing menu 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 | 2 +- src/mainmenu.s | 5 ++++- src/strings.s | 2 +- src/video.s | 9 +++++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/defs.s b/src/defs.s index 515964c..1dce131 100644 --- a/src/defs.s +++ b/src/defs.s @@ -228,7 +228,7 @@ .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 diff --git a/src/mainmenu.s b/src/mainmenu.s index a1091e5..dfcaf2b 100644 --- a/src/mainmenu.s +++ b/src/mainmenu.s @@ -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 diff --git a/src/strings.s b/src/strings.s index fac3a48..7337f6d 100644 --- a/src/strings.s +++ b/src/strings.s @@ -26,7 +26,7 @@ STR_PANIC: .db 0 STR_TEST: -.str "0123456789ABCDEF" +.str "01234567" .db 0 STR_PRESS_START: diff --git a/src/video.s b/src/video.s index f4f7a47..8301bc6 100644 --- a/src/video.s +++ b/src/video.s @@ -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 -- 2.30.2