1 | ; Project name : XTIDE Universal BIOS Configurator v2
|
---|
2 | ; Description : "Master/Slave Drive" menu structs and functions.
|
---|
3 |
|
---|
4 | ; Section containing initialized data
|
---|
5 | SECTION .data
|
---|
6 |
|
---|
7 | ALIGN WORD_ALIGN
|
---|
8 | g_MenupageForMasterSlaveMenu:
|
---|
9 | istruc MENUPAGE
|
---|
10 | at MENUPAGE.fnEnter, dw MasterSlaveMenu_EnterMenuOrModifyItemVisibility
|
---|
11 | at MENUPAGE.fnBack, dw IdeControllerMenu_EnterMenuOrModifyItemVisibility
|
---|
12 | at MENUPAGE.wMenuitems, dw 9
|
---|
13 | iend
|
---|
14 |
|
---|
15 | g_MenuitemMasterSlaveBackToIdeControllerMenu:
|
---|
16 | istruc MENUITEM
|
---|
17 | at MENUITEM.fnActivate, dw IdeControllerMenu_EnterMenuOrModifyItemVisibility
|
---|
18 | at MENUITEM.szName, dw g_szItemDrvBackToIde
|
---|
19 | at MENUITEM.szQuickInfo, dw g_szItemDrvBackToIde
|
---|
20 | at MENUITEM.szHelp, dw g_szItemDrvBackToIde
|
---|
21 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE
|
---|
22 | at MENUITEM.bType, db TYPE_MENUITEM_PAGEBACK
|
---|
23 | iend
|
---|
24 |
|
---|
25 | g_MenuitemMasterSlaveBlockModeTransfers:
|
---|
26 | istruc MENUITEM
|
---|
27 | at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
|
---|
28 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
|
---|
29 | at MENUITEM.szName, dw g_szItemDrvBlockMode
|
---|
30 | at MENUITEM.szQuickInfo, dw g_szNfoDrvBlockMode
|
---|
31 | at MENUITEM.szHelp, dw g_szHelpDrvBlockMode
|
---|
32 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE | FLG_MENUITEM_FLAGVALUE
|
---|
33 | at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE
|
---|
34 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
|
---|
35 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgDrvBlockMode
|
---|
36 | at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw g_szMultichoiceBooleanFlag
|
---|
37 | at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForFlagBooleans
|
---|
38 | at MENUITEM.itemValue + ITEM_VALUE.wValueBitmask, dw FLG_DRVPARAMS_BLOCKMODE
|
---|
39 | iend
|
---|
40 |
|
---|
41 | g_MenuitemMasterSlaveWriteCache:
|
---|
42 | istruc MENUITEM
|
---|
43 | at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
|
---|
44 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromUnshiftedItemInDSSI
|
---|
45 | at MENUITEM.szName, dw g_szItemDrvWriteCache
|
---|
46 | at MENUITEM.szQuickInfo, dw g_szNfoDrvWriteCache
|
---|
47 | at MENUITEM.szHelp, dw g_szHelpDrvWriteCache
|
---|
48 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE | FLG_MENUITEM_MASKVALUE
|
---|
49 | at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE
|
---|
50 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
|
---|
51 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgDrvWriteCache
|
---|
52 | at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw g_szMultichoiseWrCache
|
---|
53 | at MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup, dw g_rgwChoiceToValueLookupForWriteCache
|
---|
54 | at MENUITEM.itemValue + ITEM_VALUE.rgszChoiceToStringLookup, dw g_rgszChoiceToStringLookupForWriteCache
|
---|
55 | at MENUITEM.itemValue + ITEM_VALUE.wValueBitmask, dw MASK_DRVPARAMS_WRITECACHE
|
---|
56 | iend
|
---|
57 |
|
---|
58 | g_MenuitemMasterSlaveUserCHS:
|
---|
59 | istruc MENUITEM
|
---|
60 | at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
|
---|
61 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
|
---|
62 | at MENUITEM.szName, dw g_szItemDrvUserCHS
|
---|
63 | at MENUITEM.szQuickInfo, dw g_szNfoDrvUserCHS
|
---|
64 | at MENUITEM.szHelp, dw g_szHelpDrvUserCHS
|
---|
65 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE | FLG_MENUITEM_MODIFY_MENU | FLG_MENUITEM_FLAGVALUE
|
---|
66 | at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE
|
---|
67 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
|
---|
68 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgDrvUserCHS
|
---|
69 | at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw g_szMultichoiceBooleanFlag
|
---|
70 | at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForFlagBooleans
|
---|
71 | at MENUITEM.itemValue + ITEM_VALUE.wValueBitmask, dw FLG_DRVPARAMS_USERCHS
|
---|
72 | at MENUITEM.itemValue + ITEM_VALUE.fnValueWriter, dw MasterSlaveMenu_WriteCHSFlag
|
---|
73 | iend
|
---|
74 |
|
---|
75 | g_MenuitemMasterSlaveCylinders:
|
---|
76 | istruc MENUITEM
|
---|
77 | at MENUITEM.fnActivate, dw Menuitem_ActivateUnsignedInputForMenuitemInDSSI
|
---|
78 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
|
---|
79 | at MENUITEM.szName, dw g_szItemDrvCyls
|
---|
80 | at MENUITEM.szQuickInfo, dw g_szNfoDrvCyls
|
---|
81 | at MENUITEM.szHelp, dw g_szNfoDrvCyls
|
---|
82 | at MENUITEM.bFlags, db NULL
|
---|
83 | at MENUITEM.bType, db TYPE_MENUITEM_UNSIGNED
|
---|
84 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
|
---|
85 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgDrvCyls
|
---|
86 | at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 1
|
---|
87 | at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 16383
|
---|
88 | %define MASTERSLAVE_CYLINDERS_DEFAULT 65
|
---|
89 | iend
|
---|
90 |
|
---|
91 | g_MenuitemMasterSlaveHeads:
|
---|
92 | istruc MENUITEM
|
---|
93 | at MENUITEM.fnActivate, dw Menuitem_ActivateUnsignedInputForMenuitemInDSSI
|
---|
94 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
|
---|
95 | at MENUITEM.szName, dw g_szItemDrvHeads
|
---|
96 | at MENUITEM.szQuickInfo, dw g_szNfoDrvHeads
|
---|
97 | at MENUITEM.szHelp, dw g_szNfoDrvHeads
|
---|
98 | at MENUITEM.bFlags, db FLG_MENUITEM_BYTEVALUE
|
---|
99 | at MENUITEM.bType, db TYPE_MENUITEM_UNSIGNED
|
---|
100 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
|
---|
101 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgDrvHeads
|
---|
102 | at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 1
|
---|
103 | at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 16
|
---|
104 | %define MASTERSLAVE_HEADS_DEFAULT 16
|
---|
105 | iend
|
---|
106 |
|
---|
107 | g_MenuitemMasterSlaveSectors:
|
---|
108 | istruc MENUITEM
|
---|
109 | at MENUITEM.fnActivate, dw Menuitem_ActivateUnsignedInputForMenuitemInDSSI
|
---|
110 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
|
---|
111 | at MENUITEM.szName, dw g_szItemDrvSect
|
---|
112 | at MENUITEM.szQuickInfo, dw g_szNfoDrvSect
|
---|
113 | at MENUITEM.szHelp, dw g_szNfoDrvSect
|
---|
114 | at MENUITEM.bFlags, db FLG_MENUITEM_BYTEVALUE
|
---|
115 | at MENUITEM.bType, db TYPE_MENUITEM_UNSIGNED
|
---|
116 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
|
---|
117 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgDrvSect
|
---|
118 | at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 1
|
---|
119 | at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 63
|
---|
120 | %define MASTERSLAVE_SECTORS_DEFAULT 63
|
---|
121 | iend
|
---|
122 |
|
---|
123 | g_MenuitemMasterSlaveUserLBA:
|
---|
124 | istruc MENUITEM
|
---|
125 | at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
|
---|
126 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
|
---|
127 | at MENUITEM.szName, dw g_szItemDrvUserLBA
|
---|
128 | at MENUITEM.szQuickInfo, dw g_szNfoDrvUserLBA
|
---|
129 | at MENUITEM.szHelp, dw g_szHelpDrvUserLBA
|
---|
130 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE | FLG_MENUITEM_MODIFY_MENU | FLG_MENUITEM_FLAGVALUE
|
---|
131 | at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE
|
---|
132 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
|
---|
133 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgDrvUserLBA
|
---|
134 | at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw g_szMultichoiceBooleanFlag
|
---|
135 | at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForFlagBooleans
|
---|
136 | at MENUITEM.itemValue + ITEM_VALUE.wValueBitmask, dw FLG_DRVPARAMS_USERLBA
|
---|
137 | at MENUITEM.itemValue + ITEM_VALUE.fnValueWriter, dw MasterSlaveMenu_WriteLBAFlag
|
---|
138 | iend
|
---|
139 |
|
---|
140 | g_MenuitemMasterSlaveUserLbaValue:
|
---|
141 | istruc MENUITEM
|
---|
142 | at MENUITEM.fnActivate, dw Menuitem_ActivateUnsignedInputForMenuitemInDSSI
|
---|
143 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
|
---|
144 | at MENUITEM.szName, dw g_szItemDrvLbaSectors
|
---|
145 | at MENUITEM.szQuickInfo, dw g_szNfoDrvLbaSectors
|
---|
146 | at MENUITEM.szHelp, dw g_szNfoDrvLbaSectors
|
---|
147 | at MENUITEM.bFlags, db NULL
|
---|
148 | at MENUITEM.bType, db TYPE_MENUITEM_UNSIGNED
|
---|
149 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
|
---|
150 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgDrvLbaSectors
|
---|
151 | at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 1 ; 512 MiB
|
---|
152 | at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 10000000h / (1024 * 1024) ; Limit to 28-bit LBA
|
---|
153 | at MENUITEM.itemValue + ITEM_VALUE.fnValueReader, dw ValueReaderForUserLbaValue
|
---|
154 | at MENUITEM.itemValue + ITEM_VALUE.fnValueWriter, dw ValueWriterForUserLbaValue
|
---|
155 | %define MASTERSLAVE_USERLBA_DEFAULT 1
|
---|
156 | iend
|
---|
157 |
|
---|
158 |
|
---|
159 | g_rgwChoiceToValueLookupForWriteCache:
|
---|
160 | dw DEFAULT_WRITE_CACHE
|
---|
161 | dw DISABLE_WRITE_CACHE
|
---|
162 | dw ENABLE_WRITE_CACHE
|
---|
163 |
|
---|
164 | g_rgszChoiceToStringLookupForWriteCache:
|
---|
165 | dw g_szValueBootDispModeDefault
|
---|
166 | dw g_szValueDrvWrCaDis
|
---|
167 | dw g_szValueDrvWrCaEn
|
---|
168 |
|
---|
169 |
|
---|
170 | ; Section containing code
|
---|
171 | SECTION .text
|
---|
172 |
|
---|
173 | ;--------------------------------------------------------------------
|
---|
174 | ; MasterSlaveMenu_InitializeToDrvparamsOffsetInBX
|
---|
175 | ; Parameters:
|
---|
176 | ; SS:BP: Menu handle
|
---|
177 | ; Returns:
|
---|
178 | ; Nothing
|
---|
179 | ; Corrupts registers:
|
---|
180 | ; AX
|
---|
181 | ;--------------------------------------------------------------------
|
---|
182 | ALIGN JUMP_ALIGN
|
---|
183 | MasterSlaveMenu_InitializeToDrvparamsOffsetInBX:
|
---|
184 | lea ax, [bx+DRVPARAMS.wFlags]
|
---|
185 | mov [cs:g_MenuitemMasterSlaveBlockModeTransfers+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
|
---|
186 | mov [cs:g_MenuitemMasterSlaveWriteCache+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
|
---|
187 | mov [cs:g_MenuitemMasterSlaveUserCHS+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
|
---|
188 | mov [cs:g_MenuitemMasterSlaveUserLBA+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
|
---|
189 |
|
---|
190 | lea ax, [bx+DRVPARAMS.wCylinders]
|
---|
191 | mov [cs:g_MenuitemMasterSlaveCylinders+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
|
---|
192 |
|
---|
193 | lea ax, [bx+DRVPARAMS.bHeads]
|
---|
194 | mov [cs:g_MenuitemMasterSlaveHeads+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
|
---|
195 |
|
---|
196 | lea ax, [bx+DRVPARAMS.bSect]
|
---|
197 | mov [cs:g_MenuitemMasterSlaveSectors+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
|
---|
198 |
|
---|
199 | lea ax, [bx+DRVPARAMS.dwMaximumLBA]
|
---|
200 | mov [cs:g_MenuitemMasterSlaveUserLbaValue+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
|
---|
201 | ret
|
---|
202 |
|
---|
203 |
|
---|
204 | ;--------------------------------------------------------------------
|
---|
205 | ; MasterSlaveMenu_EnterMenuOrModifyItemVisibility
|
---|
206 | ; Parameters:
|
---|
207 | ; SS:BP: Menu handle
|
---|
208 | ; Returns:
|
---|
209 | ; Nothing
|
---|
210 | ; Corrupts registers:
|
---|
211 | ; All, except BP
|
---|
212 | ;--------------------------------------------------------------------
|
---|
213 | ALIGN JUMP_ALIGN
|
---|
214 | MasterSlaveMenu_EnterMenuOrModifyItemVisibility:
|
---|
215 | push cs
|
---|
216 | pop ds
|
---|
217 | call .EnableOrDisableUserCHSandLBA
|
---|
218 | call .EnableOrDisableCHandS
|
---|
219 | call .EnableOrDisableUserLbaValue
|
---|
220 | mov si, g_MenupageForMasterSlaveMenu
|
---|
221 | jmp Menupage_ChangeToNewMenupageInDSSI
|
---|
222 |
|
---|
223 |
|
---|
224 | ;--------------------------------------------------------------------
|
---|
225 | ; .EnableOrDisableUserCHSandLBA
|
---|
226 | ; Parameters:
|
---|
227 | ; SS:BP: Menu handle
|
---|
228 | ; Returns:
|
---|
229 | ; Nothing
|
---|
230 | ; Corrupts registers:
|
---|
231 | ; AX, BX
|
---|
232 | ;--------------------------------------------------------------------
|
---|
233 | ALIGN JUMP_ALIGN
|
---|
234 | .EnableOrDisableUserCHSandLBA:
|
---|
235 | mov bx, [g_MenuitemMasterSlaveUserLBA+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
|
---|
236 | call Buffers_GetRomvarsValueToAXfromOffsetInBX
|
---|
237 | test ax, FLG_DRVPARAMS_USERLBA
|
---|
238 | jnz SHORT .DisableCHSandEnableLBA
|
---|
239 | test ax, FLG_DRVPARAMS_USERCHS
|
---|
240 | jnz SHORT .EnableCHSandDisableLBA
|
---|
241 |
|
---|
242 | ; Enable both
|
---|
243 | mov bx, g_MenuitemMasterSlaveUserCHS
|
---|
244 | call .EnableMenuitemFromCSBX
|
---|
245 | mov bx, g_MenuitemMasterSlaveUserLBA
|
---|
246 | jmp .EnableMenuitemFromCSBX
|
---|
247 |
|
---|
248 | ALIGN JUMP_ALIGN
|
---|
249 | .EnableCHSandDisableLBA:
|
---|
250 | mov bx, g_MenuitemMasterSlaveUserCHS
|
---|
251 | call .EnableMenuitemFromCSBX
|
---|
252 | mov bx, g_MenuitemMasterSlaveUserLBA
|
---|
253 | jmp .DisableMenuitemFromCSBX
|
---|
254 |
|
---|
255 | ALIGN JUMP_ALIGN
|
---|
256 | .DisableCHSandEnableLBA:
|
---|
257 | mov bx, g_MenuitemMasterSlaveUserLBA
|
---|
258 | call .EnableMenuitemFromCSBX
|
---|
259 | mov bx, g_MenuitemMasterSlaveUserCHS
|
---|
260 | jmp .DisableMenuitemFromCSBX
|
---|
261 |
|
---|
262 |
|
---|
263 | ;--------------------------------------------------------------------
|
---|
264 | ; .EnableOrDisableCHandS
|
---|
265 | ; Parameters:
|
---|
266 | ; SS:BP: Menu handle
|
---|
267 | ; Returns:
|
---|
268 | ; Nothing
|
---|
269 | ; Corrupts registers:
|
---|
270 | ; AX, BX
|
---|
271 | ;--------------------------------------------------------------------
|
---|
272 | ALIGN JUMP_ALIGN
|
---|
273 | .EnableOrDisableCHandS:
|
---|
274 | mov bx, [cs:g_MenuitemMasterSlaveUserCHS+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
|
---|
275 | call Buffers_GetRomvarsValueToAXfromOffsetInBX
|
---|
276 | test ax, FLG_DRVPARAMS_USERCHS
|
---|
277 | jz SHORT .DisableCHandS
|
---|
278 | test ax, FLG_DRVPARAMS_USERLBA
|
---|
279 | jnz SHORT .DisableCHandS
|
---|
280 |
|
---|
281 | mov bx, g_MenuitemMasterSlaveCylinders
|
---|
282 | call .EnableMenuitemFromCSBX
|
---|
283 | mov bx, g_MenuitemMasterSlaveHeads
|
---|
284 | call .EnableMenuitemFromCSBX
|
---|
285 | mov bx, g_MenuitemMasterSlaveSectors
|
---|
286 | jmp SHORT .EnableMenuitemFromCSBX
|
---|
287 |
|
---|
288 | ALIGN JUMP_ALIGN
|
---|
289 | .DisableCHandS:
|
---|
290 | mov bx, g_MenuitemMasterSlaveCylinders
|
---|
291 | call .DisableMenuitemFromCSBX
|
---|
292 | mov bx, g_MenuitemMasterSlaveHeads
|
---|
293 | call .DisableMenuitemFromCSBX
|
---|
294 | mov bx, g_MenuitemMasterSlaveSectors
|
---|
295 | jmp SHORT .DisableMenuitemFromCSBX
|
---|
296 |
|
---|
297 |
|
---|
298 | ;--------------------------------------------------------------------
|
---|
299 | ; .EnableOrDisableUserLbaValue
|
---|
300 | ; Parameters:
|
---|
301 | ; SS:BP: Menu handle
|
---|
302 | ; Returns:
|
---|
303 | ; Nothing
|
---|
304 | ; Corrupts registers:
|
---|
305 | ; AX, BX
|
---|
306 | ;--------------------------------------------------------------------
|
---|
307 | ALIGN JUMP_ALIGN
|
---|
308 | .EnableOrDisableUserLbaValue:
|
---|
309 | mov bx, [cs:g_MenuitemMasterSlaveUserLBA+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
|
---|
310 | call Buffers_GetRomvarsValueToAXfromOffsetInBX
|
---|
311 | mov bx, g_MenuitemMasterSlaveUserLbaValue
|
---|
312 | test ax, FLG_DRVPARAMS_USERCHS
|
---|
313 | jnz SHORT .DisableMenuitemFromCSBX
|
---|
314 | test ax, FLG_DRVPARAMS_USERLBA
|
---|
315 | jz SHORT .DisableMenuitemFromCSBX
|
---|
316 | ; Fall to .EnableMenuitemFromCSBX
|
---|
317 |
|
---|
318 |
|
---|
319 | ;--------------------------------------------------------------------
|
---|
320 | ; .EnableMenuitemFromCSBX
|
---|
321 | ; .DisableMenuitemFromCSBX
|
---|
322 | ; Parameters:
|
---|
323 | ; CS:BX: Ptr to MENUITEM
|
---|
324 | ; Returns:
|
---|
325 | ; Nothing
|
---|
326 | ; Corrupts registers:
|
---|
327 | ; Nothing
|
---|
328 | ;--------------------------------------------------------------------
|
---|
329 | ALIGN JUMP_ALIGN
|
---|
330 | .EnableMenuitemFromCSBX:
|
---|
331 | or BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
|
---|
332 | ret
|
---|
333 |
|
---|
334 | ALIGN JUMP_ALIGN
|
---|
335 | .DisableMenuitemFromCSBX:
|
---|
336 | and BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
|
---|
337 | ret
|
---|
338 |
|
---|
339 |
|
---|
340 | ;--------------------------------------------------------------------
|
---|
341 | ; MENUITEM value reader functions
|
---|
342 | ; Parameters:
|
---|
343 | ; AX: Value from MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset
|
---|
344 | ; DS:SI: Ptr to MENUITEM
|
---|
345 | ; ES:DI: Ptr to value variable
|
---|
346 | ; Returns:
|
---|
347 | ; AX: Value with possible modifications
|
---|
348 | ; Corrupts registers:
|
---|
349 | ; Nothing
|
---|
350 | ;--------------------------------------------------------------------
|
---|
351 | ALIGN JUMP_ALIGN
|
---|
352 | ValueReaderForUserLbaValue:
|
---|
353 | push dx
|
---|
354 |
|
---|
355 | mov ax, [es:di]
|
---|
356 | mov dx, [es:di+2] ; DX:AX now holds user defined LBA28 limit
|
---|
357 | add ax, BYTE 1 ; Increment by one
|
---|
358 | adc dx, BYTE 0
|
---|
359 |
|
---|
360 | xchg ax, dx ; SHR 16
|
---|
361 | eSHIFT_IM ax, 4, shr ; SHR 4 => AX = DX:AX / (1024*1024)
|
---|
362 |
|
---|
363 | pop dx
|
---|
364 | ret
|
---|
365 |
|
---|
366 |
|
---|
367 | ;--------------------------------------------------------------------
|
---|
368 | ; MENUITEM value writer functions
|
---|
369 | ; Parameters:
|
---|
370 | ; AX: Value to be written to MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset
|
---|
371 | ; DS:SI: Ptr to MENUITEM
|
---|
372 | ; ES:DI: Ptr to value variable
|
---|
373 | ; Returns:
|
---|
374 | ; AX: Value to be stored
|
---|
375 | ; Corrupts registers:
|
---|
376 | ; Nothing
|
---|
377 | ;--------------------------------------------------------------------
|
---|
378 | ALIGN JUMP_ALIGN
|
---|
379 | ValueWriterForUserLbaValue:
|
---|
380 | push dx
|
---|
381 |
|
---|
382 | xor dx, dx
|
---|
383 | eSHIFT_IM ax, 4, shl
|
---|
384 | xchg dx, ax ; DX:AX now holds AX * 1024 * 1024
|
---|
385 |
|
---|
386 | sub ax, BYTE 1 ; Decrement DX:AX by one
|
---|
387 | sbb dx, BYTE 0 ; (necessary since maximum LBA28 sector count is 0FFF FFFFh)
|
---|
388 |
|
---|
389 | mov [es:di+2], dx ; Store DX by ourselves
|
---|
390 | pop dx
|
---|
391 | ret ; AX will be stored by our menu system
|
---|
392 |
|
---|
393 | ;
|
---|
394 | ; No change to CHS flag, but we use this opportunity to change defaults stored in the CHS values if we are
|
---|
395 | ; changing in/out of user CHS settings (since we use these bytes in different ways with the LBA setting).
|
---|
396 | ;
|
---|
397 | ALIGN JUMP_ALIGN
|
---|
398 | MasterSlaveMenu_WriteCHSFlag:
|
---|
399 | test word [es:di], FLG_DRVPARAMS_USERCHS
|
---|
400 | jnz .alreadySet
|
---|
401 |
|
---|
402 | push ax
|
---|
403 | push di
|
---|
404 | push si
|
---|
405 |
|
---|
406 | mov ax, MASTERSLAVE_CYLINDERS_DEFAULT
|
---|
407 | mov si, g_MenuitemMasterSlaveCylinders
|
---|
408 | call Menuitem_StoreValueFromAXtoMenuitemInDSSI
|
---|
409 |
|
---|
410 | mov ax, MASTERSLAVE_HEADS_DEFAULT
|
---|
411 | mov si, g_MenuitemMasterSlaveHeads
|
---|
412 | call Menuitem_StoreValueFromAXtoMenuitemInDSSI
|
---|
413 |
|
---|
414 | mov ax, MASTERSLAVE_SECTORS_DEFAULT
|
---|
415 | mov si, g_MenuitemMasterSlaveSectors
|
---|
416 | call Menuitem_StoreValueFromAXtoMenuitemInDSSI
|
---|
417 |
|
---|
418 | pop si
|
---|
419 | pop di
|
---|
420 | pop ax
|
---|
421 |
|
---|
422 | .alreadySet:
|
---|
423 | ret
|
---|
424 |
|
---|
425 | ;
|
---|
426 | ; No change to LBA flag, but we use this opportunity to change defaults stored in the LBA value if we are
|
---|
427 | ; changing in/out of user LBA settings (since we use these bytes in different ways with the CHS setting).
|
---|
428 | ;
|
---|
429 | ALIGN JUMP_ALIGN
|
---|
430 | MasterSlaveMenu_WriteLBAFlag:
|
---|
431 | test word [es:di], FLG_DRVPARAMS_USERLBA
|
---|
432 | jnz .alreadySet
|
---|
433 |
|
---|
434 | push ax
|
---|
435 | push di
|
---|
436 | push si
|
---|
437 |
|
---|
438 | mov ax, MASTERSLAVE_USERLBA_DEFAULT
|
---|
439 | mov si, g_MenuitemMasterSlaveUserLbaValue
|
---|
440 | call Menuitem_StoreValueFromAXtoMenuitemInDSSI
|
---|
441 |
|
---|
442 | pop si
|
---|
443 | pop di
|
---|
444 | pop ax
|
---|
445 |
|
---|
446 | .alreadySet:
|
---|
447 | ret
|
---|