source: xtideuniversalbios/trunk/Assembly_Library/Inc/MenuEvents.inc @ 492

Last change on this file since 492 was 492, checked in by gregli@…, 11 years ago

Removed the dependency between MODULE_BOOT_MENU and MODULE_HOTKEYS. With these changes, 0, 1, or 2 of them can be included in a build. This change also means that the hotkeys don't work while the menu is up. But the most important hotkey there was for Rom Boot, and that has been added to the menu as a choice proper. Lots of changes across the board in the hotkeys code - even if we eventually back this change out (becaue, for example we want hotkeys to work in the menu) we should probably start from this base and add that functionality back in, as these changes results in approximately 120 bytes of savings and includes new functionality, such as the Rom Boot menu item and the Com Detect hotkey.

File size: 3.3 KB
Line 
1; File name     :   MenuEvents.inc
2; Project name  :   Assembly Library
3; Created date  :   13.7.2010
4; Last update   :   18.10.2010
5; Author        :   Tomi Tilli
6; Description   :   Defines for Menu events send to the user.
7%ifndef MENUEVENTS_INC
8%define MENUEVENTS_INC
9
10;--------------------------------------------------------------------
11; Events to be processed in user implemented handler.
12;   Common parameters for all events:
13;       BX:         Menu event (anything from MENUEVENT struct)
14;       SS:BP:      Menu library handle
15;   Common return values for all events:
16;       CF:         Set if event processed
17;                   Cleared if event not processed
18;   Corrupts registers:
19;       All
20;--------------------------------------------------------------------
21
22;
23; There are two ways to use MENUEVENT:
24;
25; 1. If the program needs two different menus, include the definition of the MENUEVENT structure below,
26;    instantiate with members that point to the routines that make up the menu.
27;
28; 2. If the program needs only one menu, %define MENUEVENT_INLINE_OFFSETS before this include file,
29;    and define (through EQU statements) each of the entry points as offsets from a base address. 
30;
31
32;
33; If user level idle processing is desired, %define this symbol and .IdleProcessing will be called.
34; Otherwise, the code and structure entry will be omitted.  Note that INCLUDE_MENU_DIALOGS requires
35; the idle processing (if that is the case, it is turned on here).
36;
37;%define MENUEVENT_IDLEPROCESSING_ENABLE
38;
39
40%ifdef INCLUDE_MENU_DIALOGS
41%define MENUEVENT_IDLEPROCESSING_ENABLE
42%endif
43
44%ifndef MENUEVENT_INLINE_OFFSETS
45
46struc MENUEVENT
47    ; Parameters:
48    ;   DS:SI:      Ptr to MENUINIT struct to initialize
49    ; Returns:
50    ;   DS:SI:      Ptr to initialized MENUINIT struct
51    .InitializeMenuinitFromDSSI     resb    2
52MENUEVENT_InitializeMenuinitFromDSSI    equ     MENUEVENT.InitializeMenuinitFromDSSI
53
54    ; Parameters:
55    ;   None
56    ; Returns:
57    ;   CF:         Set to exit menu
58    ;               Clear to cancel exit
59    .ExitMenu                       resb    2
60MENUEVENT_ExitMenu                  equ     MENUEVENT.ExitMenu
61
62%ifdef MENUEVENT_IDLEPROCESSING_ENABLE
63    ; Parameters:
64    ;   None
65    ; See the definition of MENUEVENT_IDLEPROCESSING_ENABLE below.
66    .IdleProcessing                 resb    2
67MENUEVENT_IdleProcessing            equ     MENUEVENT.IdleProcessing
68%endif
69
70    ; Parameters:
71    ;   CX:         Index of new highlighted item
72    ;   DX:         Index of previously highlighted item or NO_ITEM_HIGHLIGHTED
73    .ItemHighlightedFromCX          resb    2
74MENUEVENT_ItemHighlightedFromCX     equ     MENUEVENT.ItemHighlightedFromCX
75
76    ; Parameters:
77    ;   CX:         Index of selected item
78    .ItemSelectedFromCX             resb    2
79MENUEVENT_ItemSelectedFromCX        equ     MENUEVENT.ItemSelectedFromCX
80
81    ; Parameters:
82    ;   AL:         ASCII character for the key
83    ;   AH:         Keyboard library scan code for the key
84    .KeyStrokeInAX                  resb    2
85MENUEVENT_KeyStrokeInAX             equ     MENUEVENT.KeyStrokeInAX
86
87    ; Parameters:
88    ;   CX:         Index of highlighted item
89    ;   Cursor has been positioned to the beginning of first line
90    .RefreshTitle                   resb    2
91    .RefreshInformation             resb    2
92MENUEVENT_RefreshTitle              equ     MENUEVENT.RefreshTitle
93MENUEVENT_RefreshInformation        equ     MENUEVENT.RefreshInformation
94
95    ; Parameters:
96    ;   CX:         Index of item to refresh
97    ;   Cursor has been positioned to the beginning of item line
98    .RefreshItemFromCX              resb    2
99MENUEVENT_RefreshItemFromCX         equ     MENUEVENT.RefreshItemFromCX
100endstruc
101
102%endif ; MENUEVENTS_INLINE_OFFSETS
103
104%endif ; MENUEVENTS_INC
Note: See TracBrowser for help on using the repository browser.