1 | ; Project name : XTIDE Univeral BIOS Configurator v2
|
---|
2 | ; Description : Functions for displaying dialogs.
|
---|
3 |
|
---|
4 | ;
|
---|
5 | ; XTIDE Universal BIOS and Associated Tools
|
---|
6 | ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2013 by XTIDE Universal BIOS Team.
|
---|
7 | ;
|
---|
8 | ; This program is free software; you can redistribute it and/or modify
|
---|
9 | ; it under the terms of the GNU General Public License as published by
|
---|
10 | ; the Free Software Foundation; either version 2 of the License, or
|
---|
11 | ; (at your option) any later version.
|
---|
12 | ;
|
---|
13 | ; This program is distributed in the hope that it will be useful,
|
---|
14 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
15 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
16 | ; GNU General Public License for more details.
|
---|
17 | ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
---|
18 | ;
|
---|
19 |
|
---|
20 | ; Section containing code
|
---|
21 | SECTION .text
|
---|
22 |
|
---|
23 | ;--------------------------------------------------------------------
|
---|
24 | ; Dialogs_DisplayHelpFromCSDXwithTitleInCSDI
|
---|
25 | ; Parameters:
|
---|
26 | ; CS:DX: Ptr to help string to display
|
---|
27 | ; CS:DI: Ptr to title string for help dialog
|
---|
28 | ; SS:BP: Menu handle
|
---|
29 | ; Returns:
|
---|
30 | ; Nothing
|
---|
31 | ; Corrupts registers:
|
---|
32 | ; AX
|
---|
33 | ;--------------------------------------------------------------------
|
---|
34 | ALIGN JUMP_ALIGN
|
---|
35 | Dialogs_DisplayHelpFromCSDXwithTitleInCSDI:
|
---|
36 | push ds
|
---|
37 | push si
|
---|
38 | push di
|
---|
39 | push cx
|
---|
40 |
|
---|
41 | mov cx, DIALOG_INPUT_size
|
---|
42 | call Memory_ReserveCXbytesFromStackToDSSI
|
---|
43 | call InitializeDialogInputFromDSSI
|
---|
44 | mov [si+DIALOG_INPUT.fszTitle], di
|
---|
45 | jmp SHORT DisplayMessageDialogWithMessageInCSDXandDialogInputInDSSI
|
---|
46 |
|
---|
47 | ;--------------------------------------------------------------------
|
---|
48 | ; Dialogs_DisplayNotificationFromCSDX
|
---|
49 | ; Dialogs_DisplayErrorFromCSDX
|
---|
50 | ; Parameters:
|
---|
51 | ; CS:DX: Ptr to notification string to display
|
---|
52 | ; SS:BP: Menu handle
|
---|
53 | ; Returns:
|
---|
54 | ; Nothing
|
---|
55 | ; Corrupts registers:
|
---|
56 | ; AX
|
---|
57 | ;--------------------------------------------------------------------
|
---|
58 | ALIGN JUMP_ALIGN
|
---|
59 | Dialogs_DisplayNotificationFromCSDX:
|
---|
60 | push ds
|
---|
61 | push si
|
---|
62 | push di
|
---|
63 | push cx
|
---|
64 |
|
---|
65 | mov cx, DIALOG_INPUT_size
|
---|
66 | call Memory_ReserveCXbytesFromStackToDSSI
|
---|
67 | call InitializeDialogInputFromDSSI
|
---|
68 | mov WORD [si+DIALOG_INPUT.fszTitle], g_szNotificationDialog
|
---|
69 | jmp SHORT DisplayMessageDialogWithMessageInCSDXandDialogInputInDSSI
|
---|
70 |
|
---|
71 | ALIGN JUMP_ALIGN
|
---|
72 | Dialogs_DisplayErrorFromCSDX:
|
---|
73 | push ds
|
---|
74 | push si
|
---|
75 | push di
|
---|
76 | push cx
|
---|
77 |
|
---|
78 | mov cx, DIALOG_INPUT_size
|
---|
79 | call Memory_ReserveCXbytesFromStackToDSSI
|
---|
80 | mov WORD [si+DIALOG_INPUT.fszTitle], g_szErrorDialog
|
---|
81 | ALIGN JUMP_ALIGN
|
---|
82 | DisplayMessageDialogWithMessageInCSDXandDialogInputInDSSI:
|
---|
83 | call InitializeDialogInputFromDSSI
|
---|
84 | mov [si+DIALOG_INPUT.fszItems], dx
|
---|
85 | CALL_MENU_LIBRARY DisplayMessageWithInputInDSSI
|
---|
86 |
|
---|
87 | add sp, BYTE DIALOG_INPUT_size
|
---|
88 | pop cx
|
---|
89 | pop di
|
---|
90 | pop si
|
---|
91 | pop ds
|
---|
92 | ret
|
---|
93 |
|
---|
94 |
|
---|
95 | ;--------------------------------------------------------------------
|
---|
96 | ; Dialogs_DisplayFileDialogWithDialogIoInDSSI
|
---|
97 | ; Parameters:
|
---|
98 | ; DS:SI: Ptr to FILE_DIALOG_IO
|
---|
99 | ; SS:BP: Menu handle
|
---|
100 | ; Returns:
|
---|
101 | ; Nothing
|
---|
102 | ; Corrupts registers:
|
---|
103 | ; AX, DI
|
---|
104 | ;--------------------------------------------------------------------
|
---|
105 | ALIGN JUMP_ALIGN
|
---|
106 | Dialogs_DisplayFileDialogWithDialogIoInDSSI:
|
---|
107 | push es
|
---|
108 |
|
---|
109 | call Buffers_GetFileDialogItemBufferToESDI
|
---|
110 | mov WORD [si+FILE_DIALOG_IO.fszTitle], g_szDlgFileTitle
|
---|
111 | mov [si+FILE_DIALOG_IO.fszTitle+2], cs
|
---|
112 | mov [si+FILE_DIALOG_IO.fszItemBuffer], di
|
---|
113 | mov [si+FILE_DIALOG_IO.fszItemBuffer+2], es
|
---|
114 | mov BYTE [si+FILE_DIALOG_IO.bDialogFlags], FLG_FILEDIALOG_DRIVES
|
---|
115 | mov BYTE [si+FILE_DIALOG_IO.bFileAttributes], FLG_FILEATTR_DIRECTORY | FLG_FILEATTR_ARCHIVE
|
---|
116 | mov WORD [si+FILE_DIALOG_IO.fpFileFilterString], g_szDlgFileFilter
|
---|
117 | mov [si+FILE_DIALOG_IO.fpFileFilterString+2], cs
|
---|
118 | CALL_MENU_LIBRARY GetFileNameWithIoInDSSI
|
---|
119 |
|
---|
120 | pop es
|
---|
121 | ret
|
---|
122 |
|
---|
123 |
|
---|
124 | ;--------------------------------------------------------------------
|
---|
125 | ; Dialogs_DisplayQuitDialog
|
---|
126 | ; Dialogs_DisplaySaveChangesDialog
|
---|
127 | ; Parameters:
|
---|
128 | ; SS:BP: Menu handle
|
---|
129 | ; Returns:
|
---|
130 | ; ZF: Set if user wants to do the action
|
---|
131 | ; Cleared if user wants to cancel
|
---|
132 | ; Corrupts registers:
|
---|
133 | ; AX, CX
|
---|
134 | ;--------------------------------------------------------------------
|
---|
135 | ALIGN JUMP_ALIGN
|
---|
136 | Dialogs_DisplayQuitDialog:
|
---|
137 | push ds
|
---|
138 |
|
---|
139 | mov cx, DIALOG_INPUT_size
|
---|
140 | call Memory_ReserveCXbytesFromStackToDSSI
|
---|
141 | call InitializeDialogInputFromDSSI
|
---|
142 | mov WORD [si+DIALOG_INPUT.fszTitle], g_szDlgExitToDos
|
---|
143 | jmp Dialogs_DisplayQuitAndSaveChangesDialogsSharedEnding
|
---|
144 |
|
---|
145 |
|
---|
146 | ALIGN JUMP_ALIGN
|
---|
147 | Dialogs_DisplaySaveChangesDialog:
|
---|
148 | push ds
|
---|
149 |
|
---|
150 | mov cx, DIALOG_INPUT_size
|
---|
151 | call Memory_ReserveCXbytesFromStackToDSSI
|
---|
152 | call InitializeDialogInputFromDSSI
|
---|
153 | mov WORD [si+DIALOG_INPUT.fszTitle], g_szDlgSaveChanges
|
---|
154 | Dialogs_DisplayQuitAndSaveChangesDialogsSharedEnding:
|
---|
155 | mov WORD [si+DIALOG_INPUT.fszItems], g_szMultichoiceBooleanFlag
|
---|
156 | CALL_MENU_LIBRARY GetSelectionToAXwithInputInDSSI
|
---|
157 | add sp, BYTE DIALOG_INPUT_size
|
---|
158 | cmp ax, BYTE 1 ; 1 = YES
|
---|
159 |
|
---|
160 | pop ds
|
---|
161 | ret
|
---|
162 |
|
---|
163 |
|
---|
164 | ;--------------------------------------------------------------------
|
---|
165 | ; Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX
|
---|
166 | ; Parameters:
|
---|
167 | ; DS:BX: Ptr to FLASHVARS
|
---|
168 | ; DS:SI: Ptr to PROGRESS_DIALOG_IO
|
---|
169 | ; SS:BP: Menu handle
|
---|
170 | ; Returns:
|
---|
171 | ; Nothing
|
---|
172 | ; Corrupts registers:
|
---|
173 | ; AX, DX, DI
|
---|
174 | ;--------------------------------------------------------------------
|
---|
175 | ALIGN JUMP_ALIGN
|
---|
176 | Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX:
|
---|
177 | ; Initialize progress dialog I/O in DS:SI with flashvars in DS:BX
|
---|
178 | call InitializeDialogInputFromDSSI
|
---|
179 | mov WORD [si+DIALOG_INPUT.fszTitle], g_szFlashTitle
|
---|
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 | ; Init done
|
---|
189 |
|
---|
190 | mov dx, ds
|
---|
191 | mov ax, bx
|
---|
192 | JMP_MENU_LIBRARY StartProgressTaskWithIoInDSSIandParamInDXAX
|
---|
193 |
|
---|
194 |
|
---|
195 | ;--------------------------------------------------------------------
|
---|
196 | ; InitializeDialogInputFromDSSI
|
---|
197 | ; Parameters:
|
---|
198 | ; DS:SI: Ptr to DIALOG_INPUT
|
---|
199 | ; Returns:
|
---|
200 | ; Nothing
|
---|
201 | ; Corrupts registers:
|
---|
202 | ; Nothing
|
---|
203 | ;--------------------------------------------------------------------
|
---|
204 | ALIGN JUMP_ALIGN
|
---|
205 | InitializeDialogInputFromDSSI:
|
---|
206 | mov [si+DIALOG_INPUT.fszTitle+2], cs
|
---|
207 | mov [si+DIALOG_INPUT.fszItems+2], cs
|
---|
208 | mov WORD [si+DIALOG_INPUT.fszInfo], g_szGenericDialogInfo
|
---|
209 | mov [si+DIALOG_INPUT.fszInfo+2], cs
|
---|
210 | ret
|
---|