From 2997fb7c85b3e6b1d4e4b436698400b4635a57dd Mon Sep 17 00:00:00 2001 From: Ry Date: Fri, 14 Oct 2022 21:34:51 -0700 Subject: [PATCH] launcher: Add "Quit Launcher" menu item --- launcher/main.asm | 5 ++++ launcher/menu.asm | 76 +++++++++++++++++++++++++---------------------- 2 files changed, 46 insertions(+), 35 deletions(-) diff --git a/launcher/main.asm b/launcher/main.asm index 42f452a..e6c11a5 100644 --- a/launcher/main.asm +++ b/launcher/main.asm @@ -45,6 +45,11 @@ event_loop: call yield_task jmp event_loop +quit_launcher: + call disable_menu_bar + call end_current_task + jmp hang + allocate_error: mov r0, allocate_error_str mov r1, 16 diff --git a/launcher/menu.asm b/launcher/menu.asm index 0df755d..ca19341 100644 --- a/launcher/menu.asm +++ b/launcher/menu.asm @@ -49,11 +49,16 @@ system_menu_click_event: ; r2 contains the clicked root menu ; r3 contains the clicked menu item + ; about cmp r3, 0 ifz jmp about_dialog - ; shut down + ; quit launcher cmp r3, 1 + ifz jmp quit_launcher + + ; shut down + cmp r3, 2 ifz icl ifz halt @@ -64,42 +69,43 @@ menu_items_root: data.32 menu_items_system_list data.32 menu_items_system_name ; pointer to menu list, pointer to menu name data.32 menu_items_launcher_list data.32 menu_items_launcher_name ; pointer to menu list, pointer to menu name menu_items_system_name: - data.8 6 data.str "System" data.8 0x00 ; text length, text, null-terminator + data.8 6 data.str "System" data.8 0x00 ; text length, text, null-terminator menu_items_launcher_name: - data.8 8 data.str "Launcher" data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str "Launcher" data.8 0x00 ; text length, text, null-terminator menu_items_system_list: - data.8 2 ; number of items - data.8 11 ; menu width (usually longest item + 2) - data.8 5 data.str "About" data.8 0x00 ; text length, text, null-terminator - data.8 9 data.str "Shut Down" data.8 0x00 ; text length, text, null-terminator + data.8 3 ; number of items + data.8 15 ; menu width (usually longest item + 2) + data.8 5 data.str "About" data.8 0x00 ; text length, text, null-terminator + data.8 13 data.str "Quit Launcher" data.8 0x00 ; text length, text, null-terminator + data.8 9 data.str "Shut Down" data.8 0x00 ; text length, text, null-terminator menu_items_launcher_list: ; reserve enough room for up to 28 items data.8 1 ; number of items data.8 10 ; menu width (usually longest item + 2) - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator - data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator + data.8 8 data.str " " data.8 0x00 ; text length, text, null-terminator