From 292f460ce1b3ac2a8b510858c40d418af42418a1 Mon Sep 17 00:00:00 2001 From: ry755 Date: Fri, 11 Feb 2022 20:47:19 -0800 Subject: [PATCH] fox32rom: Rename the "event stack" to "event queue" everywhere --- menu.asm | 2 +- mouse.asm | 4 ++-- submenu.asm | 18 +++++++++--------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/menu.asm b/menu.asm index 00001ee..300adfd 100644 --- a/menu.asm +++ b/menu.asm @@ -167,7 +167,7 @@ menu_bar_click_event_found_item: call draw_menu_bar_root_items call draw_submenu_items - ; push a submenu_update_event_type event to the event stack + ; add a submenu_update_event_type event to the event queue mov r1, r0 ; event parameter 0: pointer to menu bar root struct mov r2, r30 ; event parameter 1: selected root menu item mov r3, 0xFFFFFFFF ; event parameter 2: hovering submenu item (or 0xFFFFFFFF for none) diff --git a/mouse.asm b/mouse.asm index 9e564bf..5f6f47b 100644 --- a/mouse.asm +++ b/mouse.asm @@ -25,7 +25,7 @@ get_mouse_button: ret -; updates the cursor position and pushes a mouse_click_event_type event to the event stack if the mouse button was clicked +; updates the cursor position and adds a mouse_click_event_type event to the event queue if the mouse button was clicked ; this should only be called by system_vsync_handler mouse_update: push r0 @@ -71,7 +71,7 @@ mouse_update: cmp r3, 0 ifnz jmp mouse_update_end - ; otherwise, just push a standard mouse click event to the event stack + ; otherwise, just add a standard mouse click event to the event queue mov r2, r1 ; copy Y position to event parameter 1 mov r1, r0 ; copy X position to event parameter 0 mov r3, 0 diff --git a/submenu.asm b/submenu.asm index f017e79..038c871 100644 --- a/submenu.asm +++ b/submenu.asm @@ -178,7 +178,7 @@ close_submenu: ; r3: hovering submenu item (or 0xFFFFFFFF for none) ; outputs: ; none -; the event is pushed back onto the event stack if the submenu is still open +; the event is added back into the event queue if the submenu is still open submenu_update_event: push r0 push r1 @@ -196,17 +196,17 @@ submenu_update_event: mov r10, r3 ; r10: hovering submenu item (or 0xFFFFFFFF for none) ; check if the submenu overlay is enabled - ; if the submenu was closed then exit without repushing the update event to the event stack + ; if the submenu was closed then exit without readding the update event to the event queue in r0, 0x8000031D cmp r0, 0 - ifz jmp submenu_update_event_end_no_push + ifz jmp submenu_update_event_end_no_add ; get the current mouse position and check if the submenu overlay covers that position ; if the mouse is not in the submenu, then there is nothing to do call get_mouse_position mov r2, 29 call check_if_enabled_overlay_covers_position - ifnz jmp submenu_update_event_end_push + ifnz jmp submenu_update_event_end_add ; make the mouse position relative to the submenu overlay mov r2, 29 @@ -229,7 +229,7 @@ submenu_update_event_no_redraw: bts r0, 1 ifnz jmp submenu_update_event_clicked - jmp submenu_update_event_end_push + jmp submenu_update_event_end_add submenu_update_event_clicked: ;div r2, 16 ; mouse Y / 16 mov r1, r8 ; event parameter 0: pointer to menu bar root struct @@ -243,9 +243,9 @@ submenu_update_event_clicked: call new_event mov r0, r1 call close_submenu - jmp submenu_update_event_end_no_push -submenu_update_event_end_push: - ; repush the submenu_update_event_type event to the event stack + jmp submenu_update_event_end_no_add +submenu_update_event_end_add: + ; readd the submenu_update_event_type event to the event queue mov r1, r8 ; event parameter 0: pointer to menu bar root struct mov r2, r9 ; event parameter 1: selected root menu item mov r3, r10 ; event parameter 2: hovering submenu item (or 0xFFFFFFFF for none) @@ -255,7 +255,7 @@ submenu_update_event_end_push: mov r7, 0 mov r0, SUBMENU_UPDATE_EVENT_TYPE call new_event -submenu_update_event_end_no_push: +submenu_update_event_end_no_add: pop r9 pop r8 pop r7