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

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

Space optimization, added option to inline offsets for MENUEVENT structure, for situations (such as the XTIDE bios) where only one menu is needed. Ifdef'd change (set in main.asm) so either method can be used.

File size: 2.9 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;    Entry points must be within 256 bytes of the base (only a byte is used to pass the offset).
31;
32
33%ifndef MENUEVENT_INLINE_OFFSETS
34
35struc MENUEVENT
36    ; Parameters:
37    ;   DS:SI:      Ptr to MENUINIT struct to initialize
38    ; Returns:
39    ;   DS:SI:      Ptr to initialized MENUINIT struct
40    .InitializeMenuinitFromDSSI     resb    2
41%define MENUEVENT_InitializeMenuinitFromDSSI MENUEVENT.InitializeMenuinitFromDSSI
42
43    ; Parameters:
44    ;   None
45    ; Returns:
46    ;   CF:         Set to exit menu
47    ;               Clear to cancel exit
48    .ExitMenu                       resb    2
49%define MENUEVENT_ExitMenu MENUEVENT.ExitMenu
50
51    ; Parameters:
52    ;   None
53    .IdleProcessing                 resb    2
54%define MENUEVENT_IdleProcessing MENUEVENT.IdleProcessing
55
56    ; Parameters:
57    ;   CX:         Index of new highlighted item
58    ;   DX:         Index of previously highlighted item or NO_ITEM_HIGHLIGHTED
59    .ItemHighlightedFromCX          resb    2
60%define MENUEVENT_ItemHighlightedFromCX MENUEVENT.ItemHighlightedFromCX
61
62    ; Parameters:
63    ;   CX:         Index of selected item
64    .ItemSelectedFromCX             resb    2
65%define MENUEVENT_ItemSelectedFromCX MENUEVENT.ItemSelectedFromCX
66
67    ; Parameters:
68    ;   AL:         ASCII character for the key
69    ;   AH:         Keyboard library scan code for the key
70    .KeyStrokeInAX                  resb    2
71%define MENUEVENT_KeyStrokeInAX MENUEVENT.KeyStrokeInAX
72
73    ; Parameters:
74    ;   CX:         Index of highlighted item
75    ;   Cursor has been positioned to the beginning of first line
76    .RefreshTitle                   resb    2
77    .RefreshInformation             resb    2
78%define MENUEVENT_RefreshTitle MENUEVENT.RefreshTitle
79%define MENUEVENT_RefreshInformation MENUEVENT.RefreshInformation
80
81    ; Parameters:
82    ;   CX:         Index of item to refresh
83    ;   Cursor has been positioned to the beginning of item line
84    .RefreshItemFromCX              resb    2
85%define MENUEVENT_RefreshItemFromCX MENUEVENT.RefreshItemFromCX
86endstruc
87
88%endif ; MENUEVENTS_INLINE_OFFSETS
89
90%endif ; MENUEVENTS_INC
Note: See TracBrowser for help on using the repository browser.