source: xtideuniversalbios/tags/v2.0.0_beta_3/Assembly_Library/Src/Menu/Dialog/DialogMessage.asm@ 514

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

WIDE checkin... Added copyright and license information to sorce files, as per the GPL instructions for usage.

File size: 4.1 KB
Line 
1; File name : DialogMessage.asm
2; Project name : Assembly Library
3; Created date : 6.8.2010
4; Last update : 18.11.2010
5; Author : Tomi Tilli
6; Description : Displays message dialog.
7
8;
9; XTIDE Universal BIOS and Associated Tools
10; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team.
11;
12; This program is free software; you can redistribute it and/or modify
13; it under the terms of the GNU General Public License as published by
14; the Free Software Foundation; either version 2 of the License, or
15; (at your option) any later version.
16;
17; This program is distributed in the hope that it will be useful,
18; but WITHOUT ANY WARRANTY; without even the implied warranty of
19; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20; GNU General Public License for more details.
21; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22;
23
24
25; Section containing code
26SECTION .text
27
28;--------------------------------------------------------------------
29; DialogMessage_DisplayMessageWithInputInDSSI
30; Parameters:
31; DS:SI: Ptr to DIALOG_INPUT
32; SS:BP: Ptr to parent MENU
33; Returns:
34; Nothing
35; Corrupts registers:
36; AX, BX, CX, DX, SI, DI
37;--------------------------------------------------------------------
38ALIGN JUMP_ALIGN
39DialogMessage_DisplayMessageWithInputInDSSI:
40 mov bx, MessageEventHandler
41 jmp Dialog_DisplayWithDialogInputInDSSIandHandlerInBX
42
43
44;--------------------------------------------------------------------
45; MessageEventHandler
46; Common parameters for all events:
47; BX: Menu event (anything from MENUEVENT struct)
48; SS:BP: Ptr to DIALOG
49; Common return values for all events:
50; CF: Set if event processed
51; Cleared if event not processed
52; Corrupts registers:
53; All
54;--------------------------------------------------------------------
55ALIGN JUMP_ALIGN
56MessageEventHandler:
57 jmp [cs:bx+.rgfnEventHandlers]
58
59
60ALIGN JUMP_ALIGN
61.InitializeMenuinitFromDSSI:
62 or BYTE [bp+MENU.bFlags], FLG_MENU_USER_HANDLES_SCROLLING | FLG_MENU_NOHIGHLIGHT
63 xor ax, ax ; Cannot be NO_ITEM_HIGHLIGHTED because of scrolling
64 jmp Dialog_EventInitializeMenuinitFromDSSIwithHighlightedItemInAX
65
66
67ALIGN JUMP_ALIGN
68.KeyStrokeInAX:
69 call ProcessMessageScrollingKeysFromAX
70 stc
71 ret
72
73
74ALIGN WORD_ALIGN
75.rgfnEventHandlers:
76istruc MENUEVENT
77 at MENUEVENT.InitializeMenuinitFromDSSI, dw .InitializeMenuinitFromDSSI
78 at MENUEVENT.ExitMenu, dw Dialog_EventExitMenu
79 at MENUEVENT.IdleProcessing, dw Dialog_EventNotHandled
80 at MENUEVENT.ItemHighlightedFromCX, dw Dialog_EventNotHandled
81 at MENUEVENT.ItemSelectedFromCX, dw Dialog_EventAnyThatClosesDialog
82 at MENUEVENT.KeyStrokeInAX, dw .KeyStrokeInAX
83 at MENUEVENT.RefreshTitle, dw Dialog_EventRefreshTitle
84 at MENUEVENT.RefreshInformation, dw Dialog_EventRefreshInformation
85 at MENUEVENT.RefreshItemFromCX, dw Dialog_EventRefreshItemFromCX
86iend
87
88
89;--------------------------------------------------------------------
90; ProcessMessageScrollingKeysFromAX
91; Parameters
92; AL: ASCII character
93; AH: BIOS scan code
94; SS:BP: Ptr to DIALOG
95; Returns:
96; Nothing
97; Corrupts registers:
98; BX, CX, DX, SI, DI
99;--------------------------------------------------------------------
100ALIGN JUMP_ALIGN
101ProcessMessageScrollingKeysFromAX:
102 cmp ah, MENU_KEY_UP
103 je SHORT .DecrementLines
104 cmp ah, MENU_KEY_DOWN
105 je SHORT .IncrementLines
106 jmp MenuLoop_ProcessScrollingKeysFromAX
107
108ALIGN JUMP_ALIGN
109.DecrementLines:
110 cmp WORD [bp+MENUINIT.wHighlightedItem], BYTE 0
111 je SHORT .AlreadyAtTheTopOrBottom
112
113 mov ax, [bp+MENU.wFirstVisibleItem]
114 mov [bp+MENUINIT.wHighlightedItem], ax
115 mov ah, MENU_KEY_UP
116 jmp MenuLoop_ProcessScrollingKeysFromAX
117
118ALIGN JUMP_ALIGN
119.IncrementLines:
120 mov ax, [bp+MENUINIT.wItems]
121 dec ax ; Last possible item to highlight
122 cmp [bp+MENUINIT.wHighlightedItem], ax
123 jae SHORT .AlreadyAtTheTopOrBottom
124
125 call MenuScrollbars_GetLastVisibleItemOnPageToAX
126 mov [bp+MENUINIT.wHighlightedItem], ax
127 mov ah, MENU_KEY_DOWN
128 jmp MenuLoop_ProcessScrollingKeysFromAX
129
130ALIGN JUMP_ALIGN
131.AlreadyAtTheTopOrBottom:
132 ret
Note: See TracBrowser for help on using the repository browser.