Add EVENT_TYPE_MENU_ACK

main
Ry 2022-12-25 14:49:42 -08:00
parent 05e40bd6cd
commit 7df0521e98
4 changed files with 16 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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