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

Last change on this file since 196 was 189, checked in by gregli@…, 13 years ago

Additional space optimizations, including making IdleProcessing an option in MENUEVENT. Note the fall-through from one file to another, but that there are assembler checks to ensure the proper linkage is maintained. First version of StringsCompress.pl, a perl script to make StringsCompressed.asm from Strings.asm.

File size: 3.1 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 ; See the definition of MENUEVENT_IDLEPROCESSING_ENABLE below.
54 .IdleProcessing resb 2
55%define MENUEVENT_IdleProcessing MENUEVENT.IdleProcessing
56
57 ; Parameters:
58 ; CX: Index of new highlighted item
59 ; DX: Index of previously highlighted item or NO_ITEM_HIGHLIGHTED
60 .ItemHighlightedFromCX resb 2
61%define MENUEVENT_ItemHighlightedFromCX MENUEVENT.ItemHighlightedFromCX
62
63 ; Parameters:
64 ; CX: Index of selected item
65 .ItemSelectedFromCX resb 2
66%define MENUEVENT_ItemSelectedFromCX MENUEVENT.ItemSelectedFromCX
67
68 ; Parameters:
69 ; AL: ASCII character for the key
70 ; AH: Keyboard library scan code for the key
71 .KeyStrokeInAX resb 2
72%define MENUEVENT_KeyStrokeInAX MENUEVENT.KeyStrokeInAX
73
74 ; Parameters:
75 ; CX: Index of highlighted item
76 ; Cursor has been positioned to the beginning of first line
77 .RefreshTitle resb 2
78 .RefreshInformation resb 2
79%define MENUEVENT_RefreshTitle MENUEVENT.RefreshTitle
80%define MENUEVENT_RefreshInformation MENUEVENT.RefreshInformation
81
82 ; Parameters:
83 ; CX: Index of item to refresh
84 ; Cursor has been positioned to the beginning of item line
85 .RefreshItemFromCX resb 2
86%define MENUEVENT_RefreshItemFromCX MENUEVENT.RefreshItemFromCX
87endstruc
88
89%endif ; MENUEVENTS_INLINE_OFFSETS
90
91;
92; If user level idle processing is desired, %define this symbol and .IdleProcessing will be called.
93;
94;%define MENUEVENT_IDLEPROCESSING_ENABLE
95
96%endif ; MENUEVENTS_INC
Note: See TracBrowser for help on using the repository browser.