source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Dialogs.asm@ 100

Last change on this file since 100 was 65, checked in by Tomi Tilli, 14 years ago

Changes to XTIDE Universal BIOS Configurator v2:

  • All necessary features should now be implemented.
File size: 5.9 KB
Line 
1; File name : Dialogs.asm
2; Project name : XTIDE Univeral BIOS Configurator v2
3; Created date : 10.10.2010
4; Last update : 2.12.2010
5; Author : Tomi Tilli
6; Description : Functions for displaying dialogs.
7
8; Section containing code
9SECTION .text
10
11;--------------------------------------------------------------------
12; Dialogs_DisplayHelpFromCSDXwithTitleInCSDI
13; Parameters:
14; CS:DX: Ptr to help string to display
15; CS:DI: Ptr to title string for help dialog
16; SS:BP: Menu handle
17; Returns:
18; Nothing
19; Corrupts registers:
20; AX
21;--------------------------------------------------------------------
22ALIGN JUMP_ALIGN
23Dialogs_DisplayHelpFromCSDXwithTitleInCSDI:
24 push ds
25 push si
26 push di
27 push cx
28
29 mov cx, DIALOG_INPUT_size
30 call Memory_ReserveCXbytesFromStackToDSSI
31 call InitializeDialogInputFromDSSI
32 mov [si+DIALOG_INPUT.fszTitle], di
33 jmp SHORT DisplayMessageDialogWithMessageInCSDXandDialogInputInDSSI
34
35;--------------------------------------------------------------------
36; Dialogs_DisplayNotificationFromCSDX
37; Dialogs_DisplayErrorFromCSDX
38; Parameters:
39; CS:DX: Ptr to notification string to display
40; SS:BP: Menu handle
41; Returns:
42; Nothing
43; Corrupts registers:
44; AX
45;--------------------------------------------------------------------
46ALIGN JUMP_ALIGN
47Dialogs_DisplayNotificationFromCSDX:
48 push ds
49 push si
50 push di
51 push cx
52
53 mov cx, DIALOG_INPUT_size
54 call Memory_ReserveCXbytesFromStackToDSSI
55 call InitializeDialogInputFromDSSI
56 mov WORD [si+DIALOG_INPUT.fszTitle], g_szNotificationDialog
57 jmp SHORT DisplayMessageDialogWithMessageInCSDXandDialogInputInDSSI
58
59ALIGN JUMP_ALIGN
60Dialogs_DisplayErrorFromCSDX:
61 push ds
62 push si
63 push di
64 push cx
65
66 mov cx, DIALOG_INPUT_size
67 call Memory_ReserveCXbytesFromStackToDSSI
68 mov WORD [si+DIALOG_INPUT.fszTitle], g_szErrorDialog
69ALIGN JUMP_ALIGN
70DisplayMessageDialogWithMessageInCSDXandDialogInputInDSSI:
71 call InitializeDialogInputFromDSSI
72 mov [si+DIALOG_INPUT.fszItems], dx
73 CALL_MENU_LIBRARY DisplayMessageWithInputInDSSI
74
75 add sp, BYTE DIALOG_INPUT_size
76 pop cx
77 pop di
78 pop si
79 pop ds
80 ret
81
82
83;--------------------------------------------------------------------
84; Dialogs_DisplayFileDialogWithDialogIoInDSSI
85; Parameters:
86; DS:SI: Ptr to FILE_DIALOG_IO
87; SS:BP: Menu handle
88; Returns:
89; Nothing
90; Corrupts registers:
91; AX, DI
92;--------------------------------------------------------------------
93ALIGN JUMP_ALIGN
94Dialogs_DisplayFileDialogWithDialogIoInDSSI:
95 push es
96
97 call Buffers_GetFileDialogItemBufferToESDI
98 mov WORD [si+FILE_DIALOG_IO.fszTitle], g_szDlgFileTitle
99 mov [si+FILE_DIALOG_IO.fszTitle+2], cs
100 mov [si+FILE_DIALOG_IO.fszItemBuffer], di
101 mov [si+FILE_DIALOG_IO.fszItemBuffer+2], es
102 mov BYTE [si+FILE_DIALOG_IO.bDialogFlags], FLG_FILEDIALOG_DRIVES
103 mov BYTE [si+FILE_DIALOG_IO.bFileAttributes], FLG_FILEATTR_DIRECTORY | FLG_FILEATTR_ARCHIVE
104 mov WORD [si+FILE_DIALOG_IO.fpFileFilterString], g_szDlgFileFilter
105 mov [si+FILE_DIALOG_IO.fpFileFilterString+2], cs
106 CALL_MENU_LIBRARY GetFileNameWithIoInDSSI
107
108 pop es
109 ret
110
111
112;--------------------------------------------------------------------
113; Dialogs_DisplayQuitDialog
114; Dialogs_DisplaySaveChangesDialog
115; Parameters:
116; SS:BP: Menu handle
117; Returns:
118; ZF: Set if user wants to do the action
119; Cleared if user wants to cancel
120; Corrupts registers:
121; AX, CX
122;--------------------------------------------------------------------
123ALIGN JUMP_ALIGN
124Dialogs_DisplayQuitDialog:
125 push ds
126
127 mov cx, DIALOG_INPUT_size
128 call Memory_ReserveCXbytesFromStackToDSSI
129 call InitializeDialogInputFromDSSI
130 mov WORD [si+DIALOG_INPUT.fszTitle], g_szDlgExitToDos
131 mov WORD [si+DIALOG_INPUT.fszItems], g_szMultichoiseBooleanFlag
132 CALL_MENU_LIBRARY GetSelectionToAXwithInputInDSSI
133 add sp, BYTE DIALOG_INPUT_size
134 cmp ax, BYTE 1 ; 1 = YES
135
136 pop ds
137 ret
138
139
140ALIGN JUMP_ALIGN
141Dialogs_DisplaySaveChangesDialog:
142 push ds
143
144 mov cx, DIALOG_INPUT_size
145 call Memory_ReserveCXbytesFromStackToDSSI
146 call InitializeDialogInputFromDSSI
147 mov WORD [si+DIALOG_INPUT.fszTitle], g_szDlgSaveChanges
148 mov WORD [si+DIALOG_INPUT.fszItems], g_szMultichoiseBooleanFlag
149 CALL_MENU_LIBRARY GetSelectionToAXwithInputInDSSI
150 add sp, BYTE DIALOG_INPUT_size
151 cmp ax, BYTE 1 ; 1 = YES
152
153 pop ds
154 ret
155
156
157;--------------------------------------------------------------------
158; Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX
159; Parameters:
160; DS:BX: Ptr to FLASHVARS
161; DS:SI: Ptr to PROGRESS_DIALOG_IO
162; SS:BP: Menu handle
163; Returns:
164; Nothing
165; Corrupts registers:
166; AX, DX, DI
167;--------------------------------------------------------------------
168ALIGN JUMP_ALIGN
169Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX:
170 call .InitializeProgressDialogIoInDSSIwithFlashvarsInDSBX
171 mov dx, ds
172 mov ax, bx
173 CALL_MENU_LIBRARY StartProgressTaskWithIoInDSSIandParamInDXAX
174 ret
175
176ALIGN JUMP_ALIGN
177.InitializeProgressDialogIoInDSSIwithFlashvarsInDSBX:
178 call InitializeDialogInputFromDSSI
179 mov WORD [si+DIALOG_INPUT.fszTitle], g_szEEPROM
180
181 xor ax, ax
182 mov [si+PROGRESS_DIALOG_IO.wCurrentProgressValue], ax
183 mov dx, [bx+FLASHVARS.wPagesToFlash]
184 mov [si+PROGRESS_DIALOG_IO.wMaxProgressValue], dx
185 mov [si+PROGRESS_DIALOG_IO.wMinProgressValue], ax
186 mov WORD [si+PROGRESS_DIALOG_IO.fnTaskWithParamInDSSI], Flash_EepromWithFlashvarsInDSSI
187 mov [si+PROGRESS_DIALOG_IO.fnTaskWithParamInDSSI+2], cs
188 ret
189
190
191;--------------------------------------------------------------------
192; InitializeDialogInputFromDSSI
193; Parameters:
194; DS:SI: Ptr to DIALOG_INPUT
195; Returns:
196; Nothing
197; Corrupts registers:
198; Nothing
199;--------------------------------------------------------------------
200ALIGN JUMP_ALIGN
201InitializeDialogInputFromDSSI:
202 mov [si+DIALOG_INPUT.fszTitle+2], cs
203 mov [si+DIALOG_INPUT.fszItems+2], cs
204 mov WORD [si+DIALOG_INPUT.fszInfo], g_szGenericDialogInfo
205 mov [si+DIALOG_INPUT.fszInfo+2], cs
206 ret
Note: See TracBrowser for help on using the repository browser.