From: Lukas Krickl Date: Sat, 30 Aug 2025 18:02:20 +0000 (+0200) Subject: action menu: Added initial text drawing X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=96f441a31f61b9e705e6e0a1adbbcf78f3bdb15f;p=gbrg%2F.git action menu: Added initial text drawing --- diff --git a/src/action_menu.s b/src/action_menu.s index 74fa919..4592490 100644 --- a/src/action_menu.s +++ b/src/action_menu.s @@ -62,6 +62,7 @@ action_menu_init: ; draw the initial status line ld a, [action_menu_cursor] + ld hl, action_menu_str_table call select_menu_draw_status ret diff --git a/src/select_menu.s b/src/select_menu.s index 70b6ac9..20ab07b 100644 --- a/src/select_menu.s +++ b/src/select_menu.s @@ -17,9 +17,27 @@ select_menu_update: ; hl: string ptr table ; a: selection select_menu_draw_status: + push hl + push af + call ui_clear_status_line + pop af + pop hl + add a, a ; * 2 for table offset ld d, 0 ld e, a add hl, de ; hl = string ptr + + ld a, [hl+] + ld d, a + ld a, [hl] + ; hl = the string + ld h, a + ld l, d + + ld de, UI_STATUS_LINE + call puts + call ui_request_redraw + ret diff --git a/src/ui.s b/src/ui.s index 8b9e8b5..e5b4db9 100644 --- a/src/ui.s +++ b/src/ui.s @@ -6,6 +6,10 @@ ; one tile after 'Z' #define UI_WINDOW_BACKGROUND 0xF4 +ui_str_clear: +.str " " +.db 0 + ; inits UI ui_init: ; fill shadow UI with default tile @@ -99,3 +103,10 @@ ui_draw_status_stat: call ui_request_redraw ret + + ; clears the UI status line +ui_clear_status_line: + ld de, UI_STATUS_LINE + ld hl, ui_str_clear + jp puts +