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

Last change on this file since 598 was 592, checked in by Krister Nordvall, 6 years ago

Changes:

  • The problem with NASM in the previous revision (r591) has been fixed.
  • The colors used by the boot menu and hotkey bar can now be customized by selecting one of a number of pre-defined color themes. Suggestions for additional themes are more than welcome!
  • Large builds are now 10 KB. Small builds are still 8 KB with the exception of the Tiny build which is now 4 KB. In other words, builds are now as small as possible to make it easier to combine them with other BIOSes.
  • Added code to the library to improve drive error handling. XTIDECFG can now handle "Drive Not Ready" errors.
  • Fixed a couple of potential bugs in AtaID.asm (AtaID_GetMaxPioModeToAXandMinCycleTimeToCX); 1) ATA1.bPioMode was treated as a WORD variable. 2) ATA2.bPIOSupp was assumed to be non-zero which would result in PIO mode 3 being returned if the assumption was wrong.
  • Made the same changes in the equivalent function used by BIOSDRVS (DisplayPioModeInformationUsingAtaInfoFromDSBX in AtaInfo.asm).
  • Fixed a bug from r587 in PDC20x30.asm in PDC20x30_GetMaxPioModeToALandMinPioCycleTimeToBX.
  • Fixed a bug from r523 in XTIDECFG where Auto Configure would only set the IRQ on one IDE interface on AT-builds.
  • XTIDECFG will now restore the default settings for the "Serial port virtual device" when reselecting it in the list of device types. This makes it behave consistently for all device types.
  • The eAAM macro is now used regardless if USE_UNDOC_INTEL is defined or not because it is apparently supported on all processors including the NEC V20/V30 CPUs.
  • Renamed the EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS define to EXCLUDE_FROM_XUB.
  • Added a define to exclude unused library code from BIOSDRVS (EXCLUDE_FROM_BIOSDRVS). This makes it a lot smaller than in previous revisions.
  • All unnecessary CLD-instructions are now under a new define 'CLD_NEEDED' which is only enabled for the BIOS. It is disabled for XTIDECFG and BIOSDRVS but can be enabled if needed by adding this define to the respective makefile. This change was made because these unnecessary instructions are wasteful and should never be needed. In fact, they only serve to hide bugs (in other peoples code) which I strongly believe should be avoided. I recommend people making their own BIOSes from source to not use this define as it's extremely unlikely to be needed.
  • Updated the copyright info in SerDrive and changed an URL to point to the new site.
  • Updated the copyright info and version number in BIOSDRVS.
  • Updated the copyright info in XTIDECFG.
  • Optimizations in general.
File size: 6.0 KB
Line 
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
21SECTION .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;--------------------------------------------------------------------
34ALIGN JUMP_ALIGN
35Dialogs_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;--------------------------------------------------------------------
57ALIGN JUMP_ALIGN
58Dialogs_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
69ALIGN JUMP_ALIGN
70Dialogs_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
79ALIGN JUMP_ALIGN
80DisplayMessageDialogWithMessageInCSDXandDialogInputInDSSI:
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;--------------------------------------------------------------------
103ALIGN JUMP_ALIGN
104Dialogs_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;--------------------------------------------------------------------
133ALIGN JUMP_ALIGN
134Dialogs_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;--------------------------------------------------------------------
161ALIGN JUMP_ALIGN
162Dialogs_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;--------------------------------------------------------------------
190ALIGN JUMP_ALIGN
191InitializeDialogInputFromDSSI:
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
Note: See TracBrowser for help on using the repository browser.