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

Last change on this file since 174 was 170, checked in by krille_n_@…, 13 years ago

Changes to all parts of the project:

  • Minor size optimizations
  • Commented away some ALIGN JUMP_ALIGN directives in the Int13h handler (they are either in init procedures, procedures that are rarely called or are unnecessary due to conditional assembly)
  • Fixed what appears to be a typo in EBIOS.inc
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 jmp Dialogs_DisplayQuitAndSaveChangesDialogsSharedEnding
128
129
130ALIGN JUMP_ALIGN
131Dialogs_DisplaySaveChangesDialog:
132 push ds
133
134 mov cx, DIALOG_INPUT_size
135 call Memory_ReserveCXbytesFromStackToDSSI
136 call InitializeDialogInputFromDSSI
137 mov WORD [si+DIALOG_INPUT.fszTitle], g_szDlgSaveChanges
138Dialogs_DisplayQuitAndSaveChangesDialogsSharedEnding:
139 mov WORD [si+DIALOG_INPUT.fszItems], g_szMultichoiceBooleanFlag
140 CALL_MENU_LIBRARY GetSelectionToAXwithInputInDSSI
141 add sp, BYTE DIALOG_INPUT_size
142 cmp ax, BYTE 1 ; 1 = YES
143
144 pop ds
145 ret
146
147
148;--------------------------------------------------------------------
149; Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX
150; Parameters:
151; DS:BX: Ptr to FLASHVARS
152; DS:SI: Ptr to PROGRESS_DIALOG_IO
153; SS:BP: Menu handle
154; Returns:
155; Nothing
156; Corrupts registers:
157; AX, DX, DI
158;--------------------------------------------------------------------
159ALIGN JUMP_ALIGN
160Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX:
161 call .InitializeProgressDialogIoInDSSIwithFlashvarsInDSBX
162 mov dx, ds
163 mov ax, bx
164 CALL_MENU_LIBRARY StartProgressTaskWithIoInDSSIandParamInDXAX
165 ret
166
167ALIGN JUMP_ALIGN
168.InitializeProgressDialogIoInDSSIwithFlashvarsInDSBX:
169 call InitializeDialogInputFromDSSI
170 mov WORD [si+DIALOG_INPUT.fszTitle], g_szFlashTitle
171
172 xor ax, ax
173 mov [si+PROGRESS_DIALOG_IO.wCurrentProgressValue], ax
174 mov dx, [bx+FLASHVARS.wPagesToFlash]
175 mov [si+PROGRESS_DIALOG_IO.wMaxProgressValue], dx
176 mov [si+PROGRESS_DIALOG_IO.wMinProgressValue], ax
177 mov WORD [si+PROGRESS_DIALOG_IO.fnTaskWithParamInDSSI], Flash_EepromWithFlashvarsInDSSI
178 mov [si+PROGRESS_DIALOG_IO.fnTaskWithParamInDSSI+2], cs
179 ret
180
181
182;--------------------------------------------------------------------
183; InitializeDialogInputFromDSSI
184; Parameters:
185; DS:SI: Ptr to DIALOG_INPUT
186; Returns:
187; Nothing
188; Corrupts registers:
189; Nothing
190;--------------------------------------------------------------------
191ALIGN JUMP_ALIGN
192InitializeDialogInputFromDSSI:
193 mov [si+DIALOG_INPUT.fszTitle+2], cs
194 mov [si+DIALOG_INPUT.fszItems+2], cs
195 mov WORD [si+DIALOG_INPUT.fszInfo], g_szGenericDialogInfo
196 mov [si+DIALOG_INPUT.fszInfo+2], cs
197 ret
Note: See TracBrowser for help on using the repository browser.