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 | mov [si+DIALOG_INPUT.fszTitle], di
|
---|
44 | jmp SHORT DisplayMessageDialogWithMessageInCSDXandDialogInputInDSSI
|
---|
45 |
|
---|
46 | ;--------------------------------------------------------------------
|
---|
47 | ; Dialogs_DisplayNotificationFromCSDX
|
---|
48 | ; Dialogs_DisplayErrorFromCSDX
|
---|
49 | ; Parameters:
|
---|
50 | ; CS:DX: Ptr to notification string to display
|
---|
51 | ; SS:BP: Menu handle
|
---|
52 | ; Returns:
|
---|
53 | ; Nothing
|
---|
54 | ; Corrupts registers:
|
---|
55 | ; AX
|
---|
56 | ;--------------------------------------------------------------------
|
---|
57 | ALIGN JUMP_ALIGN
|
---|
58 | Dialogs_DisplayNotificationFromCSDX:
|
---|
59 | push ds
|
---|
60 | push si
|
---|
61 | push di
|
---|
62 | push cx
|
---|
63 |
|
---|
64 | mov cx, DIALOG_INPUT_size
|
---|
65 | call Memory_ReserveCXbytesFromStackToDSSI
|
---|
66 | mov WORD [si+DIALOG_INPUT.fszTitle], g_szNotificationDialog
|
---|
67 | jmp SHORT DisplayMessageDialogWithMessageInCSDXandDialogInputInDSSI
|
---|
68 |
|
---|
69 | ALIGN JUMP_ALIGN
|
---|
70 | Dialogs_DisplayErrorFromCSDX:
|
---|
71 | push ds
|
---|
72 | push si
|
---|
73 | push di
|
---|
74 | push cx
|
---|
75 |
|
---|
76 | mov cx, DIALOG_INPUT_size
|
---|
77 | call Memory_ReserveCXbytesFromStackToDSSI
|
---|
78 | mov WORD [si+DIALOG_INPUT.fszTitle], g_szErrorDialog
|
---|
79 | ALIGN JUMP_ALIGN
|
---|
80 | DisplayMessageDialogWithMessageInCSDXandDialogInputInDSSI:
|
---|
81 | call InitializeDialogInputFromDSSI
|
---|
82 | mov [si+DIALOG_INPUT.fszItems], dx
|
---|
83 | CALL_MENU_LIBRARY DisplayMessageWithInputInDSSI
|
---|
84 |
|
---|
85 | add sp, BYTE DIALOG_INPUT_size
|
---|
86 | pop cx
|
---|
87 | pop di
|
---|
88 | pop si
|
---|
89 | pop ds
|
---|
90 | ret
|
---|
91 |
|
---|
92 |
|
---|
93 | ;--------------------------------------------------------------------
|
---|
94 | ; Dialogs_DisplayFileDialogWithDialogIoInDSSI
|
---|
95 | ; Parameters:
|
---|
96 | ; DS:SI: Ptr to FILE_DIALOG_IO
|
---|
97 | ; SS:BP: Menu handle
|
---|
98 | ; Returns:
|
---|
99 | ; Nothing
|
---|
100 | ; Corrupts registers:
|
---|
101 | ; AX, DI
|
---|
102 | ;--------------------------------------------------------------------
|
---|
103 | ALIGN JUMP_ALIGN
|
---|
104 | Dialogs_DisplayFileDialogWithDialogIoInDSSI:
|
---|
105 | push es
|
---|
106 |
|
---|
107 | call Buffers_GetFileDialogItemBufferToESDI
|
---|
108 | mov WORD [si+FILE_DIALOG_IO.fszTitle], g_szDlgFileTitle
|
---|
109 | mov [si+FILE_DIALOG_IO.fszTitle+2], cs
|
---|
110 | mov [si+FILE_DIALOG_IO.fszItemBuffer], di
|
---|
111 | mov [si+FILE_DIALOG_IO.fszItemBuffer+2], es
|
---|
112 | mov BYTE [si+FILE_DIALOG_IO.bDialogFlags], FLG_FILEDIALOG_DRIVES
|
---|
113 | mov BYTE [si+FILE_DIALOG_IO.bFileAttributes], FLG_FILEATTR_DIRECTORY | FLG_FILEATTR_ARCHIVE
|
---|
114 | mov WORD [si+FILE_DIALOG_IO.fpFileFilterString], g_szDlgFileFilter
|
---|
115 | mov [si+FILE_DIALOG_IO.fpFileFilterString+2], cs
|
---|
116 | CALL_MENU_LIBRARY GetFileNameWithIoInDSSI
|
---|
117 |
|
---|
118 | pop es
|
---|
119 | ret
|
---|
120 |
|
---|
121 |
|
---|
122 | ;--------------------------------------------------------------------
|
---|
123 | ; Dialogs_DisplayYesNoResponseDialogWithTitleStringInBX
|
---|
124 | ; Parameters:
|
---|
125 | ; BX: Offset to dialog title string
|
---|
126 | ; SS:BP: Menu handle
|
---|
127 | ; Returns:
|
---|
128 | ; ZF: Set if user wants to do the action
|
---|
129 | ; Cleared if user wants to cancel
|
---|
130 | ; Corrupts registers:
|
---|
131 | ; AX, CX
|
---|
132 | ;--------------------------------------------------------------------
|
---|
133 | ALIGN JUMP_ALIGN
|
---|
134 | Dialogs_DisplayYesNoResponseDialogWithTitleStringInBX:
|
---|
135 | push ds
|
---|
136 |
|
---|
137 | mov cx, DIALOG_INPUT_size
|
---|
138 | call Memory_ReserveCXbytesFromStackToDSSI
|
---|
139 | call InitializeDialogInputFromDSSI
|
---|
140 | mov [si+DIALOG_INPUT.fszTitle], bx
|
---|
141 | mov WORD [si+DIALOG_INPUT.fszItems], g_szMultichoiceBooleanFlag
|
---|
142 | CALL_MENU_LIBRARY GetSelectionToAXwithInputInDSSI
|
---|
143 | add sp, BYTE DIALOG_INPUT_size
|
---|
144 | dec ax ; -1 = NO, 0 = YES
|
---|
145 |
|
---|
146 | pop ds
|
---|
147 | ret
|
---|
148 |
|
---|
149 |
|
---|
150 | ;--------------------------------------------------------------------
|
---|
151 | ; Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX
|
---|
152 | ; Parameters:
|
---|
153 | ; DS:BX: Ptr to FLASHVARS
|
---|
154 | ; DS:SI: Ptr to PROGRESS_DIALOG_IO
|
---|
155 | ; SS:BP: Menu handle
|
---|
156 | ; Returns:
|
---|
157 | ; Nothing
|
---|
158 | ; Corrupts registers:
|
---|
159 | ; AX, DX, DI
|
---|
160 | ;--------------------------------------------------------------------
|
---|
161 | ALIGN JUMP_ALIGN
|
---|
162 | Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX:
|
---|
163 | ; Initialize progress dialog I/O in DS:SI with flashvars in DS:BX
|
---|
164 | call InitializeDialogInputFromDSSI
|
---|
165 | mov WORD [si+DIALOG_INPUT.fszTitle], g_szFlashTitle
|
---|
166 |
|
---|
167 | xor ax, ax
|
---|
168 | mov [si+PROGRESS_DIALOG_IO.wCurrentProgressValue], ax
|
---|
169 | mov dx, [bx+FLASHVARS.wPagesToFlash]
|
---|
170 | mov [si+PROGRESS_DIALOG_IO.wMaxProgressValue], dx
|
---|
171 | mov [si+PROGRESS_DIALOG_IO.wMinProgressValue], ax
|
---|
172 | mov WORD [si+PROGRESS_DIALOG_IO.fnTaskWithParamInDSSI], Flash_EepromWithFlashvarsInDSSI
|
---|
173 | mov [si+PROGRESS_DIALOG_IO.fnTaskWithParamInDSSI+2], cs
|
---|
174 | ; Init done
|
---|
175 |
|
---|
176 | mov dx, ds
|
---|
177 | mov ax, bx
|
---|
178 | JMP_MENU_LIBRARY StartProgressTaskWithIoInDSSIandParamInDXAX
|
---|
179 |
|
---|
180 |
|
---|
181 | ;--------------------------------------------------------------------
|
---|
182 | ; InitializeDialogInputFromDSSI
|
---|
183 | ; Parameters:
|
---|
184 | ; DS:SI: Ptr to DIALOG_INPUT
|
---|
185 | ; Returns:
|
---|
186 | ; Nothing
|
---|
187 | ; Corrupts registers:
|
---|
188 | ; Nothing
|
---|
189 | ;--------------------------------------------------------------------
|
---|
190 | ALIGN JUMP_ALIGN
|
---|
191 | InitializeDialogInputFromDSSI:
|
---|
192 | mov [si+DIALOG_INPUT.fszTitle+2], cs
|
---|
193 | mov [si+DIALOG_INPUT.fszItems+2], cs
|
---|
194 | mov WORD [si+DIALOG_INPUT.fszInfo], g_szGenericDialogInfo
|
---|
195 | mov [si+DIALOG_INPUT.fszInfo+2], cs
|
---|
196 | ret
|
---|