source: xtideuniversalbios/trunk/Assembly_Library/Src/Menu/MenuEvent.asm @ 41

Last change on this file since 41 was 41, checked in by aitotat, 14 years ago

Initial commit for Assembly Library.

File size: 4.9 KB
Line 
1; File name     :   MenuEvent.asm
2; Project name  :   Assembly Library
3; Created date  :   13.7.2010
4; Last update   :   11.8.2010
5; Author        :   Tomi Tilli
6; Description   :   Functions for initializing menu system.
7
8; Section containing code
9SECTION .text
10
11;--------------------------------------------------------------------
12; MenuEvent_InitializeMenuinit
13;   Parameters
14;       SS:BP:  Ptr to MENU
15;   Returns:
16;       DS:SI:  Ptr to MENU with MENUINIT initialized from user handler
17;       CF:     Set if event processed
18;               Cleared if event not processed
19;   Corrupts registers:
20;       AX, BX, DX
21;--------------------------------------------------------------------
22ALIGN JUMP_ALIGN
23MenuEvent_InitializeMenuinit:
24    push    ss
25    pop     ds
26    mov     si, bp
27    mov     bx, MENUEVENT.InitializeMenuinitFromDSSI
28    jmp     SHORT MenuEvent_SendFromBX
29
30
31;--------------------------------------------------------------------
32; MenuEvent_ExitMenu
33;   Parameters
34;       SS:BP:  Ptr to MENU
35;   Returns:
36;       CF:     Set if event processed
37;               Cleared if event not processed
38;   Corrupts registers:
39;       AX, BX, DX
40;--------------------------------------------------------------------
41ALIGN JUMP_ALIGN
42MenuEvent_ExitMenu:
43    mov     bx, MENUEVENT.ExitMenu
44    jmp     SHORT MenuEvent_SendFromBX
45
46
47;--------------------------------------------------------------------
48; MenuEvent_IdleProcessing
49;   Parameters
50;       SS:BP:  Ptr to MENU
51;   Returns:
52;       CF:     Set if event processed
53;               Cleared if event not processed
54;   Corrupts registers:
55;       AX, BX, DX
56;--------------------------------------------------------------------
57ALIGN JUMP_ALIGN
58MenuEvent_IdleProcessing:
59    mov     bx, MENUEVENT.IdleProcessing
60    jmp     SHORT MenuEvent_SendFromBX
61
62
63;--------------------------------------------------------------------
64; MenuEvent_RefreshTitle
65; MenuEvent_RefreshInformation
66;   Parameters
67;       Cursor will be positioned to beginning of window
68;   Returns:
69;       CF:     Set if event processed
70;               Cleared if event not processed
71;   Corrupts registers:
72;       AX, BX, DX
73;--------------------------------------------------------------------
74ALIGN JUMP_ALIGN
75MenuEvent_RefreshTitle:
76    mov     bx, MENUEVENT.RefreshTitle
77    jmp     SHORT MenuEvent_SendFromBX
78ALIGN JUMP_ALIGN
79MenuEvent_RefreshInformation:
80    mov     bx, MENUEVENT.RefreshInformation
81    jmp     SHORT MenuEvent_SendFromBX
82
83
84;--------------------------------------------------------------------
85; MenuEvent_RefreshItemFromCX
86;   Parameters
87;       CX:     Index of item to refresh
88;       Cursor has been positioned to the beginning of item line
89;   Returns:
90;       CF:     Set if event processed
91;               Cleared if event not processed
92;   Corrupts registers:
93;       AX, BX, DX
94;--------------------------------------------------------------------
95ALIGN JUMP_ALIGN
96MenuEvent_RefreshItemFromCX:
97    mov     bx, MENUEVENT.RefreshItemFromCX
98    jmp     SHORT MenuEvent_SendFromBX
99
100
101;--------------------------------------------------------------------
102; MenuEvent_HighlightItemFromCX
103;   Parameters
104;       CX:     Index of item to highlight
105;   Returns:
106;       Nothing
107;   Corrupts registers:
108;       AX, BX, DX, SI, DI
109;--------------------------------------------------------------------
110ALIGN JUMP_ALIGN
111MenuEvent_HighlightItemFromCX:
112    mov     dx, cx
113    xchg    dx, [bp+MENU.wHighlightedItem]
114    push    dx
115
116    mov     bx, MENUEVENT.ItemHighlightedFromCX
117    call    MenuEvent_SendFromBX
118
119    pop     ax
120    call    MenuText_RefreshItemFromAX
121    mov     ax, [bp+MENU.wHighlightedItem]
122    jmp     MenuText_RefreshItemFromAX
123
124
125;--------------------------------------------------------------------
126; MenuEvent_KeyStrokeInAX
127;   Parameters
128;       AL:     ASCII character for the key
129;       AH:     Keyboard library scan code for the key
130;   Returns:
131;       CF:     Set if event processed
132;               Cleared if event not processed
133;   Corrupts registers:
134;       AX, BX, DX
135;--------------------------------------------------------------------
136ALIGN JUMP_ALIGN
137MenuEvent_KeyStrokeInAX:
138    mov     bx, MENUEVENT.KeyStrokeInAX
139    jmp     SHORT MenuEvent_SendFromBX
140
141
142;--------------------------------------------------------------------
143; MenuEvent_ItemSelectedFromCX
144;   Parameters
145;       CX:     Index of selected item
146;   Returns:
147;       CF:     Set if event processed
148;               Cleared if event not processed
149;   Corrupts registers:
150;       AX, BX, DX
151;--------------------------------------------------------------------
152ALIGN JUMP_ALIGN
153MenuEvent_ItemSelectedFromCX:
154    mov     bx, MENUEVENT.ItemSelectedFromCX
155    jmp     SHORT MenuEvent_SendFromBX
156
157
158;--------------------------------------------------------------------
159; MenuEvent_SendFromBX
160;   Parameters
161;       BX:                 Menu event to send
162;       SS:BP:              Ptr to MENU
163;       Other registers:    Event specific parameters
164;   Returns:
165;       AX, DX:             Event specific return values
166;       CF:                 Set if event processed
167;                           Cleared if event not processed
168;   Corrupts registers:
169;       BX
170;--------------------------------------------------------------------
171ALIGN JUMP_ALIGN
172MenuEvent_SendFromBX:
173    push    es
174    push    ds
175    push    di
176    push    si
177    push    cx
178    call    [bp+MENU.fnEventHandler]
179    pop     cx
180    pop     si
181    pop     di
182    pop     ds
183    pop     es
184    ret
Note: See TracBrowser for help on using the repository browser.