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

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

Changes to Configurator v2:

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