diff --git a/event.asm b/event.asm index fd9340d..e574207 100644 --- a/event.asm +++ b/event.asm @@ -8,6 +8,7 @@ const EVENT_TYPE_KEY_UP: 0x00000003 const EVENT_TYPE_MENU_BAR_CLICK: 0x00000004 const EVENT_TYPE_MENU_UPDATE: 0x00000005 const EVENT_TYPE_MENU_CLICK: 0x00000006 +const EVENT_TYPE_MENU_ACK: 0x00000007 const EVENT_TYPE_EMPTY: 0xFFFFFFFF ; block until an event is available diff --git a/fox32rom.def b/fox32rom.def index a2c6282..ee55e3c 100644 --- a/fox32rom.def +++ b/fox32rom.def @@ -106,6 +106,7 @@ const EVENT_TYPE_KEY_UP: 0x00000003 const EVENT_TYPE_MENU_BAR_CLICK: 0x00000004 const EVENT_TYPE_MENU_UPDATE: 0x00000005 const EVENT_TYPE_MENU_CLICK: 0x00000006 +const EVENT_TYPE_MENU_ACK: 0x00000007 const EVENT_TYPE_EMPTY: 0xFFFFFFFF ; keys diff --git a/main.asm b/main.asm index ad712e2..2618dc0 100644 --- a/main.asm +++ b/main.asm @@ -4,7 +4,7 @@ const FOX32ROM_VERSION_MAJOR: 0 const FOX32ROM_VERSION_MINOR: 5 -const FOX32ROM_VERSION_PATCH: 2 +const FOX32ROM_VERSION_PATCH: 3 const SYSTEM_STACK: 0x01FFF800 const BACKGROUND_COLOR: 0xFF674764 diff --git a/menu.asm b/menu.asm index baecf2b..dfed52a 100644 --- a/menu.asm +++ b/menu.asm @@ -239,7 +239,8 @@ menu_update_event_clicked: call get_mouse_button bts r0, 2 ifnz jmp menu_update_event_clicked - ;div r2, 16 ; mouse Y / 16 + + ; add an EVENT_TYPE_MENU_CLICK event 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: selected menu item @@ -249,8 +250,17 @@ menu_update_event_clicked: mov r7, 0 mov r0, EVENT_TYPE_MENU_CLICK call new_event - mov r0, r1 - call close_menu + + ; add an EVENT_TYPE_MENU_ACK event + mov r1, 0 + mov r2, 0 + mov r3, 0 + mov r4, 0 + mov r5, 0 + mov r6, 0 + mov r7, 0 + mov r0, EVENT_TYPE_MENU_ACK + call new_event jmp menu_update_event_end_no_add menu_update_event_end_add: ; readd the event_type_menu_update event to the event queue