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 6
|
---|
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_MenuitemMasterSlaveUserCHS:
|
---|
42 | istruc MENUITEM
|
---|
43 | at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
|
---|
44 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
|
---|
45 | at MENUITEM.szName, dw g_szItemDrvUserCHS
|
---|
46 | at MENUITEM.szQuickInfo, dw g_szNfoDrvUserCHS
|
---|
47 | at MENUITEM.szHelp, dw g_szHelpDrvUserCHS
|
---|
48 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE | FLG_MENUITEM_MODIFY_MENU | FLG_MENUITEM_FLAGVALUE
|
---|
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_szDlgDrvUserCHS
|
---|
52 | at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw g_szMultichoiceBooleanFlag
|
---|
53 | at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForFlagBooleans
|
---|
54 | at MENUITEM.itemValue + ITEM_VALUE.wValueBitmask, dw FLG_DRVPARAMS_USERCHS
|
---|
55 | iend
|
---|
56 |
|
---|
57 | g_MenuitemMasterSlaveCylinders:
|
---|
58 | istruc MENUITEM
|
---|
59 | at MENUITEM.fnActivate, dw Menuitem_ActivateUnsignedInputForMenuitemInDSSI
|
---|
60 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
|
---|
61 | at MENUITEM.szName, dw g_szItemDrvCyls
|
---|
62 | at MENUITEM.szQuickInfo, dw g_szNfoDrvCyls
|
---|
63 | at MENUITEM.szHelp, dw g_szNfoDrvCyls
|
---|
64 | at MENUITEM.bFlags, db NULL
|
---|
65 | at MENUITEM.bType, db TYPE_MENUITEM_UNSIGNED
|
---|
66 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
|
---|
67 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgDrvCyls
|
---|
68 | at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 1
|
---|
69 | at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 16383
|
---|
70 | iend
|
---|
71 |
|
---|
72 | g_MenuitemMasterSlaveHeads:
|
---|
73 | istruc MENUITEM
|
---|
74 | at MENUITEM.fnActivate, dw Menuitem_ActivateUnsignedInputForMenuitemInDSSI
|
---|
75 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
|
---|
76 | at MENUITEM.szName, dw g_szItemDrvHeads
|
---|
77 | at MENUITEM.szQuickInfo, dw g_szNfoDrvHeads
|
---|
78 | at MENUITEM.szHelp, dw g_szNfoDrvHeads
|
---|
79 | at MENUITEM.bFlags, db FLG_MENUITEM_BYTEVALUE
|
---|
80 | at MENUITEM.bType, db TYPE_MENUITEM_UNSIGNED
|
---|
81 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
|
---|
82 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgDrvHeads
|
---|
83 | at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 1
|
---|
84 | at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 16
|
---|
85 | iend
|
---|
86 |
|
---|
87 | g_MenuitemMasterSlaveSectors:
|
---|
88 | istruc MENUITEM
|
---|
89 | at MENUITEM.fnActivate, dw Menuitem_ActivateUnsignedInputForMenuitemInDSSI
|
---|
90 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
|
---|
91 | at MENUITEM.szName, dw g_szItemDrvSect
|
---|
92 | at MENUITEM.szQuickInfo, dw g_szNfoDrvSect
|
---|
93 | at MENUITEM.szHelp, dw g_szNfoDrvSect
|
---|
94 | at MENUITEM.bFlags, db FLG_MENUITEM_BYTEVALUE
|
---|
95 | at MENUITEM.bType, db TYPE_MENUITEM_UNSIGNED
|
---|
96 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
|
---|
97 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgDrvSect
|
---|
98 | at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 1
|
---|
99 | at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 63
|
---|
100 | iend
|
---|
101 |
|
---|
102 |
|
---|
103 | ; Section containing code
|
---|
104 | SECTION .text
|
---|
105 |
|
---|
106 | ;--------------------------------------------------------------------
|
---|
107 | ; MasterSlaveMenu_InitializeToDrvparamsOffsetInBX
|
---|
108 | ; Parameters:
|
---|
109 | ; SS:BP: Menu handle
|
---|
110 | ; Returns:
|
---|
111 | ; Nothing
|
---|
112 | ; Corrupts registers:
|
---|
113 | ; AX
|
---|
114 | ;--------------------------------------------------------------------
|
---|
115 | ALIGN JUMP_ALIGN
|
---|
116 | MasterSlaveMenu_InitializeToDrvparamsOffsetInBX:
|
---|
117 | lea ax, [bx+DRVPARAMS.wFlags]
|
---|
118 | mov [cs:g_MenuitemMasterSlaveBlockModeTransfers+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
|
---|
119 | mov [cs:g_MenuitemMasterSlaveUserCHS+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
|
---|
120 |
|
---|
121 | lea ax, [bx+DRVPARAMS.wCylinders]
|
---|
122 | mov [cs:g_MenuitemMasterSlaveCylinders+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
|
---|
123 |
|
---|
124 | lea ax, [bx+DRVPARAMS.bHeads]
|
---|
125 | mov [cs:g_MenuitemMasterSlaveHeads+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
|
---|
126 |
|
---|
127 | lea ax, [bx+DRVPARAMS.bSect]
|
---|
128 | mov [cs:g_MenuitemMasterSlaveSectors+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
|
---|
129 | ret
|
---|
130 |
|
---|
131 |
|
---|
132 | ;--------------------------------------------------------------------
|
---|
133 | ; MasterSlaveMenu_EnterMenuOrModifyItemVisibility
|
---|
134 | ; Parameters:
|
---|
135 | ; SS:BP: Menu handle
|
---|
136 | ; Returns:
|
---|
137 | ; Nothing
|
---|
138 | ; Corrupts registers:
|
---|
139 | ; All, except BP
|
---|
140 | ;--------------------------------------------------------------------
|
---|
141 | ALIGN JUMP_ALIGN
|
---|
142 | MasterSlaveMenu_EnterMenuOrModifyItemVisibility:
|
---|
143 | push cs
|
---|
144 | pop ds
|
---|
145 | call .EnableOrDisableCHandS
|
---|
146 | mov si, g_MenupageForMasterSlaveMenu
|
---|
147 | jmp Menupage_ChangeToNewMenupageInDSSI
|
---|
148 |
|
---|
149 | ;--------------------------------------------------------------------
|
---|
150 | ; .EnableOrDisableCHandS
|
---|
151 | ; Parameters:
|
---|
152 | ; SS:BP: Menu handle
|
---|
153 | ; Returns:
|
---|
154 | ; Nothing
|
---|
155 | ; Corrupts registers:
|
---|
156 | ; AX, BX
|
---|
157 | ;--------------------------------------------------------------------
|
---|
158 | ALIGN JUMP_ALIGN
|
---|
159 | .EnableOrDisableCHandS:
|
---|
160 | mov bx, [cs:g_MenuitemMasterSlaveUserCHS+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
|
---|
161 | call Buffers_GetRomvarsValueToAXfromOffsetInBX
|
---|
162 | test ax, FLG_DRVPARAMS_USERCHS
|
---|
163 | jz SHORT .DisableCHandS
|
---|
164 |
|
---|
165 | mov bx, g_MenuitemMasterSlaveCylinders
|
---|
166 | call .EnableMenuitemFromCSBX
|
---|
167 | mov bx, g_MenuitemMasterSlaveHeads
|
---|
168 | call .EnableMenuitemFromCSBX
|
---|
169 | mov bx, g_MenuitemMasterSlaveSectors
|
---|
170 | call .EnableMenuitemFromCSBX
|
---|
171 | ret
|
---|
172 |
|
---|
173 | ALIGN JUMP_ALIGN
|
---|
174 | .DisableCHandS:
|
---|
175 | mov bx, g_MenuitemMasterSlaveCylinders
|
---|
176 | call .DisableMenuitemFromCSBX
|
---|
177 | mov bx, g_MenuitemMasterSlaveHeads
|
---|
178 | call .DisableMenuitemFromCSBX
|
---|
179 | mov bx, g_MenuitemMasterSlaveSectors
|
---|
180 | call .DisableMenuitemFromCSBX
|
---|
181 | ret
|
---|
182 |
|
---|
183 | ;--------------------------------------------------------------------
|
---|
184 | ; .EnableMenuitemFromCSBX
|
---|
185 | ; .DisableMenuitemFromCSBX
|
---|
186 | ; Parameters:
|
---|
187 | ; CS:BX: Ptr to MENUITEM
|
---|
188 | ; Returns:
|
---|
189 | ; Nothing
|
---|
190 | ; Corrupts registers:
|
---|
191 | ; Nothing
|
---|
192 | ;--------------------------------------------------------------------
|
---|
193 | ALIGN JUMP_ALIGN
|
---|
194 | .EnableMenuitemFromCSBX:
|
---|
195 | or BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
|
---|
196 | ret
|
---|
197 |
|
---|
198 | ALIGN JUMP_ALIGN
|
---|
199 | .DisableMenuitemFromCSBX:
|
---|
200 | and BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
|
---|
201 | ret
|
---|