source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MainMenu.asm@ 113

Last change on this file since 113 was 108, checked in by krille_n_@…, 14 years ago

Fixed a spelling mistake and cleaned the source some. No changes to the actual code.

File size: 7.6 KB
Line 
1; Project name : XTIDE Universal BIOS Configurator v2
2; Description : Main menu structs and functions.
3
4; Section containing initialized data
5SECTION .data
6
7ALIGN WORD_ALIGN
8g_MenupageForMainMenu:
9istruc MENUPAGE
10 at MENUPAGE.fnEnter, dw MainMenu_EnterMenuOrModifyItemVisibility
11 at MENUPAGE.fnBack, dw ExitToDos
12 at MENUPAGE.wMenuitems, dw 6
13iend
14
15g_MenuitemMainMenuExitToDos:
16istruc MENUITEM
17 at MENUITEM.fnActivate, dw ExitToDos
18 at MENUITEM.szName, dw g_szItemMainExitToDOS
19 at MENUITEM.szQuickInfo, dw g_szNfoMainExitToDOS
20 at MENUITEM.szHelp, dw g_szNfoMainExitToDOS
21 at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE
22 at MENUITEM.bType, db TYPE_MENUITEM_PAGEBACK
23iend
24
25g_MenuitemMainMenuLoadBiosFromFile:
26istruc MENUITEM
27 at MENUITEM.fnActivate, dw LoadBiosFromFile
28 at MENUITEM.szName, dw g_szItemMainLoadFile
29 at MENUITEM.szQuickInfo, dw g_szNfoMainLoadFile
30 at MENUITEM.szHelp, dw g_szNfoMainLoadFile
31 at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE
32 at MENUITEM.bType, db TYPE_MENUITEM_ACTION
33iend
34
35g_MenuitemMainMenuLoadXtideUniversalBiosFromRom:
36istruc MENUITEM
37 at MENUITEM.fnActivate, dw LoadXtideUniversalBiosFromRom
38 at MENUITEM.szName, dw g_szItemMainLoadROM
39 at MENUITEM.szQuickInfo, dw g_szNfoMainLoadROM
40 at MENUITEM.szHelp, dw g_szNfoMainLoadROM
41 at MENUITEM.bFlags, db NULL
42 at MENUITEM.bType, db TYPE_MENUITEM_ACTION
43iend
44
45g_MenuitemMainMenuLoadOldSettingsFromEeprom:
46istruc MENUITEM
47 at MENUITEM.fnActivate, dw LoadOldSettingsFromEeprom
48 at MENUITEM.szName, dw g_szItemMainLoadStngs
49 at MENUITEM.szQuickInfo, dw g_szNfoMainLoadStngs
50 at MENUITEM.szHelp, dw g_szNfoMainLoadStngs
51 at MENUITEM.bFlags, db NULL
52 at MENUITEM.bType, db TYPE_MENUITEM_ACTION
53iend
54
55g_MenuitemMainMenuConfigureXtideUniversalBios:
56istruc MENUITEM
57 at MENUITEM.fnActivate, dw ConfigurationMenu_EnterMenuOrModifyItemVisibility
58 at MENUITEM.szName, dw g_szItemMainConfigure
59 at MENUITEM.szQuickInfo, dw g_szNfoMainConfigure
60 at MENUITEM.szHelp, dw g_szNfoMainConfigure
61 at MENUITEM.bFlags, db NULL
62 at MENUITEM.bType, db TYPE_MENUITEM_PAGENEXT
63iend
64
65g_MenuitemMainMenuFlashEeprom:
66istruc MENUITEM
67 at MENUITEM.fnActivate, dw FlashMenu_EnterMenuOrModifyItemVisibility
68 at MENUITEM.szName, dw g_szItemMainFlash
69 at MENUITEM.szQuickInfo, dw g_szNfoMainFlash
70 at MENUITEM.szHelp, dw g_szNfoMainFlash
71 at MENUITEM.bFlags, db NULL
72 at MENUITEM.bType, db TYPE_MENUITEM_PAGENEXT
73iend
74
75%if FALSE
76g_Menuitem:
77istruc MENUITEM
78 at MENUITEM.fnActivate, dw NULL
79 at MENUITEM.fnFormatValue, dw NULL
80 at MENUITEM.szName, dw NULL
81 at MENUITEM.szQuickInfo, dw NULL
82 at MENUITEM.szHelp, dw NULL
83 at MENUITEM.bFlags, db NULL
84 at MENUITEM.bType, db NULL
85 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
86 at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw NULL
87 at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw NULL
88 at MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup, dw NULL
89 at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw NULL
90 at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw NULL
91 at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw NULL
92 at MENUITEM.itemValue + ITEM_VALUE.wValueBitmask, dw NULL
93iend
94%endif
95
96
97; Section containing code
98SECTION .text
99
100;--------------------------------------------------------------------
101; MainMenu_EnterMenuOrModifyItemVisibility
102; Parameters:
103; SS:BP: Menu handle
104; Returns:
105; Nothing
106; Corrupts registers:
107; All, except BP
108;--------------------------------------------------------------------
109ALIGN JUMP_ALIGN
110MainMenu_EnterMenuOrModifyItemVisibility:
111 push cs
112 pop ds
113 call .EnableOrDisableXtideRomItems
114 call .EnableOrDisableConfigureXtideUniversalBios
115 call .EnableOrDisableFlashEeprom
116 mov si, g_MenupageForMainMenu
117 jmp Menupage_ChangeToNewMenupageInDSSI
118
119;--------------------------------------------------------------------
120; .EnableOrDisableXtideRomItems
121; Parameters:
122; DS: CFGVARS segment
123; Returns:
124; Nothing
125; Corrupts registers:
126; AX, BX, CX, SI, DI, ES
127;--------------------------------------------------------------------
128ALIGN JUMP_ALIGN
129.EnableOrDisableXtideRomItems:
130 call EEPROM_FindXtideUniversalBiosROMtoESDI
131 jnc SHORT .DisableAllRomItems
132 or BYTE [g_MenuitemMainMenuLoadXtideUniversalBiosFromRom+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
133 call Buffers_IsXtideUniversalBiosLoaded
134 jne SHORT .DisableLoadSettingFromRom
135 or BYTE [g_MenuitemMainMenuLoadOldSettingsFromEeprom+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
136 ret
137
138ALIGN JUMP_ALIGN
139.DisableAllRomItems:
140 and BYTE [g_MenuitemMainMenuLoadXtideUniversalBiosFromRom+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
141.DisableLoadSettingFromRom:
142 and BYTE [g_MenuitemMainMenuLoadOldSettingsFromEeprom+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
143 ret
144
145;--------------------------------------------------------------------
146; .EnableOrDisableConfigureXtideUniversalBios
147; Parameters:
148; DS: CFGVARS segment
149; Returns:
150; Nothing
151; Corrupts registers:
152; CX, SI, DI, ES
153;--------------------------------------------------------------------
154ALIGN JUMP_ALIGN
155.EnableOrDisableConfigureXtideUniversalBios:
156 call Buffers_IsXtideUniversalBiosLoaded
157 jne SHORT .DisableConfigureXtideUniversalBios
158 or BYTE [g_MenuitemMainMenuConfigureXtideUniversalBios+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
159 ret
160
161ALIGN JUMP_ALIGN
162.DisableConfigureXtideUniversalBios:
163 and BYTE [g_MenuitemMainMenuConfigureXtideUniversalBios+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
164 ret
165
166;--------------------------------------------------------------------
167; .EnableOrDisableFlashEeprom
168; Parameters:
169; DS: CFGVARS segment
170; Returns:
171; Nothing
172; Corrupts registers:
173; Nothing
174;--------------------------------------------------------------------
175ALIGN JUMP_ALIGN
176.EnableOrDisableFlashEeprom:
177 test WORD [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED
178 jz SHORT .DisableFlashEeprom
179 or BYTE [g_MenuitemMainMenuFlashEeprom+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
180 ret
181
182ALIGN JUMP_ALIGN
183.DisableFlashEeprom:
184 and BYTE [g_MenuitemMainMenuFlashEeprom+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
185 ret
186
187
188
189;--------------------------------------------------------------------
190; MENUITEM activation functions (.fnActivate)
191; Parameters:
192; SS:BP: Ptr to MENU
193; Returns:
194; Nothing
195; Corrupts registers:
196; All, except segments
197;--------------------------------------------------------------------
198ALIGN JUMP_ALIGN
199ExitToDos:
200 CALL_MENU_LIBRARY Close
201 ret
202
203
204ALIGN JUMP_ALIGN
205LoadBiosFromFile:
206 call Buffers_SaveChangesIfFileLoaded
207 mov cx, FILE_DIALOG_IO_size
208 call Memory_ReserveCXbytesFromStackToDSSI
209 call Dialogs_DisplayFileDialogWithDialogIoInDSSI
210 cmp BYTE [si+FILE_DIALOG_IO.bUserCancellation], TRUE
211 je SHORT .CancelFileLoading
212
213 add si, BYTE FILE_DIALOG_IO.szFile
214 call BiosFile_LoadFileFromDSSItoRamBuffer
215 call MainMenu_EnterMenuOrModifyItemVisibility
216.CancelFileLoading:
217 add sp, BYTE FILE_DIALOG_IO_size
218 ret
219
220
221ALIGN JUMP_ALIGN
222LoadXtideUniversalBiosFromRom:
223 call Buffers_SaveChangesIfFileLoaded
224 call EEPROM_LoadXtideUniversalBiosFromRomToRamBufferAndReturnSizeInDXCX
225 mov ax, FLG_CFGVARS_ROMLOADED
226 call Buffers_NewBiosWithSizeInDXCXandSourceInAXhasBeenLoadedForConfiguration
227 mov dx, g_szDlgMainLoadROM
228 jmp Dialogs_DisplayNotificationFromCSDX
229
230
231ALIGN JUMP_ALIGN
232LoadOldSettingsFromEeprom:
233 call Buffers_SaveChangesIfFileLoaded
234 call EEPROM_LoadOldSettingsFromRomToRamBuffer
235 and WORD [g_cfgVars+CFGVARS.wFlags], ~FLG_CFGVARS_UNSAVED
236 mov dx, g_szDlgMainLoadStngs
237 jmp Dialogs_DisplayNotificationFromCSDX
Note: See TracBrowser for help on using the repository browser.