1 | ; Project name : XTIDE Universal BIOS Configurator v2
|
---|
2 | ; Description : "IDE Controller" menu structs and functions.
|
---|
3 |
|
---|
4 | ; Section containing initialized data
|
---|
5 | SECTION .data
|
---|
6 |
|
---|
7 | ALIGN WORD_ALIGN
|
---|
8 | g_MenupageForIdeControllerMenu:
|
---|
9 | istruc MENUPAGE
|
---|
10 | at MENUPAGE.fnEnter, dw IdeControllerMenu_EnterMenuOrModifyItemVisibility
|
---|
11 | at MENUPAGE.fnBack, dw ConfigurationMenu_EnterMenuOrModifyItemVisibility
|
---|
12 | at MENUPAGE.wMenuitems, dw 8
|
---|
13 | iend
|
---|
14 |
|
---|
15 | g_MenuitemIdeControllerBackToConfigurationMenu:
|
---|
16 | istruc MENUITEM
|
---|
17 | at MENUITEM.fnActivate, dw ConfigurationMenu_EnterMenuOrModifyItemVisibility
|
---|
18 | at MENUITEM.szName, dw g_szItemBackToCfgMenu
|
---|
19 | at MENUITEM.szQuickInfo, dw g_szNfoIdeBackToCfgMenu
|
---|
20 | at MENUITEM.szHelp, dw g_szNfoIdeBackToCfgMenu
|
---|
21 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE
|
---|
22 | at MENUITEM.bType, db TYPE_MENUITEM_PAGEBACK
|
---|
23 | iend
|
---|
24 |
|
---|
25 | g_MenuitemIdeControllerMasterDrive:
|
---|
26 | istruc MENUITEM
|
---|
27 | at MENUITEM.fnActivate, dw MasterDrive
|
---|
28 | at MENUITEM.szName, dw g_szItemIdeMaster
|
---|
29 | at MENUITEM.szQuickInfo, dw g_szNfoIdeMaster
|
---|
30 | at MENUITEM.szHelp, dw g_szNfoIdeMaster
|
---|
31 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE
|
---|
32 | at MENUITEM.bType, db TYPE_MENUITEM_PAGENEXT
|
---|
33 | iend
|
---|
34 |
|
---|
35 | g_MenuitemIdeControllerSlaveDrive:
|
---|
36 | istruc MENUITEM
|
---|
37 | at MENUITEM.fnActivate, dw SlaveDrive
|
---|
38 | at MENUITEM.szName, dw g_szItemIdeSlave
|
---|
39 | at MENUITEM.szQuickInfo, dw g_szNfoIdeSlave
|
---|
40 | at MENUITEM.szHelp, dw g_szNfoIdeSlave
|
---|
41 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE
|
---|
42 | at MENUITEM.bType, db TYPE_MENUITEM_PAGENEXT
|
---|
43 | iend
|
---|
44 |
|
---|
45 | g_MenuitemIdeControllerDevice:
|
---|
46 | istruc MENUITEM
|
---|
47 | at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
|
---|
48 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
|
---|
49 | at MENUITEM.szName, dw g_szItemIdeDevice
|
---|
50 | at MENUITEM.szQuickInfo, dw g_szNfoIdeDevice
|
---|
51 | at MENUITEM.szHelp, dw g_szNfoIdeDevice
|
---|
52 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE | FLG_MENUITEM_BYTEVALUE
|
---|
53 | at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE
|
---|
54 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
|
---|
55 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgDevice
|
---|
56 | at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw g_szMultichoiceCfgDevice
|
---|
57 | at MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup, dw g_rgwChoiceToValueLookupForDevice
|
---|
58 | at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForDevice
|
---|
59 | iend
|
---|
60 |
|
---|
61 | g_MenuitemIdeControllerCommandBlockAddress:
|
---|
62 | istruc MENUITEM
|
---|
63 | at MENUITEM.fnActivate, dw Menuitem_ActivateHexInputForMenuitemInDSSI
|
---|
64 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteHexValueStringToBufferInESDIfromItemInDSSI
|
---|
65 | at MENUITEM.szName, dw g_szItemIdeCmdPort
|
---|
66 | at MENUITEM.szQuickInfo, dw g_szNfoIdeCmdPort
|
---|
67 | at MENUITEM.szHelp, dw g_szHelpIdeCmdPort
|
---|
68 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE
|
---|
69 | at MENUITEM.bType, db TYPE_MENUITEM_HEX
|
---|
70 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
|
---|
71 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgIdeCmdPort
|
---|
72 | at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 0
|
---|
73 | at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw -1
|
---|
74 | iend
|
---|
75 |
|
---|
76 | g_MenuitemIdeControllerControlBlockAddress:
|
---|
77 | istruc MENUITEM
|
---|
78 | at MENUITEM.fnActivate, dw Menuitem_ActivateHexInputForMenuitemInDSSI
|
---|
79 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteHexValueStringToBufferInESDIfromItemInDSSI
|
---|
80 | at MENUITEM.szName, dw g_szItemIdeCtrlPort
|
---|
81 | at MENUITEM.szQuickInfo, dw g_szNfoIdeCtrlPort
|
---|
82 | at MENUITEM.szHelp, dw g_szHelpIdeCtrlPort
|
---|
83 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE
|
---|
84 | at MENUITEM.bType, db TYPE_MENUITEM_HEX
|
---|
85 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
|
---|
86 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgIdeCtrlPort
|
---|
87 | at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 0
|
---|
88 | at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw -1
|
---|
89 | iend
|
---|
90 |
|
---|
91 | g_MenuitemIdeControllerEnableInterrupt:
|
---|
92 | istruc MENUITEM
|
---|
93 | at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
|
---|
94 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
|
---|
95 | at MENUITEM.szName, dw g_szItemIdeEnIRQ
|
---|
96 | at MENUITEM.szQuickInfo, dw g_szNfoIdeEnIRQ
|
---|
97 | at MENUITEM.szHelp, dw g_szHelpIdeEnIRQ
|
---|
98 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE | FLG_MENUITEM_MODIFY_MENU | FLG_MENUITEM_FLAGVALUE
|
---|
99 | at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE
|
---|
100 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
|
---|
101 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgIdeEnIRQ
|
---|
102 | at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw g_szMultichoiceBooleanFlag
|
---|
103 | at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForFlagBooleans
|
---|
104 | at MENUITEM.itemValue + ITEM_VALUE.wValueBitmask, dw 15
|
---|
105 | iend
|
---|
106 |
|
---|
107 | g_MenuitemIdeControllerIdeIRQ:
|
---|
108 | istruc MENUITEM
|
---|
109 | at MENUITEM.fnActivate, dw Menuitem_ActivateUnsignedInputForMenuitemInDSSI
|
---|
110 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
|
---|
111 | at MENUITEM.szName, dw g_szItemIdeIRQ
|
---|
112 | at MENUITEM.szQuickInfo, dw g_szNfoIdeIRQ
|
---|
113 | at MENUITEM.szHelp, dw g_szHelpIdeIRQ
|
---|
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_szDlgIdeIRQ
|
---|
118 | at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 2
|
---|
119 | at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 15
|
---|
120 | iend
|
---|
121 |
|
---|
122 | g_rgwChoiceToValueLookupForDevice:
|
---|
123 | dw DEVICE_8BIT_DUAL_PORT_XTIDE
|
---|
124 | dw DEVICE_XTIDE_WITH_REVERSED_A3_AND_A0
|
---|
125 | dw DEVICE_8BIT_SINGLE_PORT
|
---|
126 | dw DEVICE_16BIT_ATA
|
---|
127 | dw DEVICE_32BIT_ATA
|
---|
128 | dw DEVICE_SERIAL_PORT
|
---|
129 | g_rgszValueToStringLookupForDevice:
|
---|
130 | dw g_szValueCfgDeviceDual8b
|
---|
131 | dw g_szValueCfgDeviceMod
|
---|
132 | dw g_szValueCfgDeviceSingle8b
|
---|
133 | dw g_szValueCfgDevice16b
|
---|
134 | dw g_szValueCfgDevice32b
|
---|
135 | dw g_szValueCfgDeviceSerial
|
---|
136 |
|
---|
137 |
|
---|
138 | ; Section containing code
|
---|
139 | SECTION .text
|
---|
140 |
|
---|
141 | ;--------------------------------------------------------------------
|
---|
142 | ; IdeControllerMenu_InitializeToIdevarsOffsetInBX
|
---|
143 | ; Parameters:
|
---|
144 | ; SS:BP: Menu handle
|
---|
145 | ; Returns:
|
---|
146 | ; Nothing
|
---|
147 | ; Corrupts registers:
|
---|
148 | ; AX
|
---|
149 | ;--------------------------------------------------------------------
|
---|
150 | ALIGN JUMP_ALIGN
|
---|
151 | IdeControllerMenu_InitializeToIdevarsOffsetInBX:
|
---|
152 | lea ax, [bx+IDEVARS.drvParamsMaster]
|
---|
153 | mov [cs:g_MenuitemIdeControllerMasterDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
|
---|
154 |
|
---|
155 | lea ax, [bx+IDEVARS.drvParamsSlave]
|
---|
156 | mov [cs:g_MenuitemIdeControllerSlaveDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
|
---|
157 |
|
---|
158 | lea ax, [bx+IDEVARS.bDevice]
|
---|
159 | mov [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
|
---|
160 |
|
---|
161 | lea ax, [bx+IDEVARS.wPort]
|
---|
162 | mov [cs:g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
|
---|
163 |
|
---|
164 | lea ax, [bx+IDEVARS.wPortCtrl]
|
---|
165 | mov [cs:g_MenuitemIdeControllerControlBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
|
---|
166 |
|
---|
167 | lea ax, [bx+IDEVARS.bIRQ]
|
---|
168 | mov [cs:g_MenuitemIdeControllerEnableInterrupt+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
|
---|
169 | mov [cs:g_MenuitemIdeControllerIdeIRQ+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
|
---|
170 | ret
|
---|
171 |
|
---|
172 |
|
---|
173 | ;--------------------------------------------------------------------
|
---|
174 | ; IdeControllerMenu_EnterMenuOrModifyItemVisibility
|
---|
175 | ; Parameters:
|
---|
176 | ; SS:BP: Menu handle
|
---|
177 | ; Returns:
|
---|
178 | ; Nothing
|
---|
179 | ; Corrupts registers:
|
---|
180 | ; All, except BP
|
---|
181 | ;--------------------------------------------------------------------
|
---|
182 | ALIGN JUMP_ALIGN
|
---|
183 | IdeControllerMenu_EnterMenuOrModifyItemVisibility:
|
---|
184 | push cs
|
---|
185 | pop ds
|
---|
186 | call .EnableOrDisableIRQ
|
---|
187 | mov si, g_MenupageForIdeControllerMenu
|
---|
188 | jmp Menupage_ChangeToNewMenupageInDSSI
|
---|
189 |
|
---|
190 | ;--------------------------------------------------------------------
|
---|
191 | ; .EnableOrDisableIRQ
|
---|
192 | ; Parameters:
|
---|
193 | ; SS:BP: Menu handle
|
---|
194 | ; Returns:
|
---|
195 | ; Nothing
|
---|
196 | ; Corrupts registers:
|
---|
197 | ; AX, BX
|
---|
198 | ;--------------------------------------------------------------------
|
---|
199 | ALIGN JUMP_ALIGN
|
---|
200 | .EnableOrDisableIRQ:
|
---|
201 | mov bx, [cs:g_MenuitemIdeControllerEnableInterrupt+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
|
---|
202 | call Buffers_GetRomvarsValueToAXfromOffsetInBX
|
---|
203 | mov bx, g_MenuitemIdeControllerIdeIRQ
|
---|
204 | test al, al
|
---|
205 | jz SHORT .DisableMenuitemFromCSBX
|
---|
206 | ; Fall to .EnableMenuitemFromCSBX
|
---|
207 |
|
---|
208 | ;--------------------------------------------------------------------
|
---|
209 | ; .EnableMenuitemFromCSBX
|
---|
210 | ; .DisableMenuitemFromCSBX
|
---|
211 | ; Parameters:
|
---|
212 | ; CS:BX: Ptr to MENUITEM
|
---|
213 | ; Returns:
|
---|
214 | ; Nothing
|
---|
215 | ; Corrupts registers:
|
---|
216 | ; Nothing
|
---|
217 | ;--------------------------------------------------------------------
|
---|
218 | ALIGN JUMP_ALIGN
|
---|
219 | .EnableMenuitemFromCSBX:
|
---|
220 | or BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
|
---|
221 | ret
|
---|
222 |
|
---|
223 | ALIGN JUMP_ALIGN
|
---|
224 | .DisableMenuitemFromCSBX:
|
---|
225 | and BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
|
---|
226 | ret
|
---|
227 |
|
---|
228 |
|
---|
229 | ;--------------------------------------------------------------------
|
---|
230 | ; MENUITEM activation functions (.fnActivate)
|
---|
231 | ; Parameters:
|
---|
232 | ; SS:BP: Ptr to MENU
|
---|
233 | ; Returns:
|
---|
234 | ; Nothing
|
---|
235 | ; Corrupts registers:
|
---|
236 | ; All, except segments
|
---|
237 | ;--------------------------------------------------------------------
|
---|
238 | ALIGN JUMP_ALIGN
|
---|
239 | MasterDrive:
|
---|
240 | mov bx, [cs:g_MenuitemIdeControllerMasterDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
|
---|
241 | jmp SHORT DisplayMasterSlaveMenu
|
---|
242 |
|
---|
243 | ALIGN JUMP_ALIGN
|
---|
244 | SlaveDrive:
|
---|
245 | mov bx, [cs:g_MenuitemIdeControllerSlaveDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
|
---|
246 | ; Fall to DisplayMasterSlaveMenu
|
---|
247 |
|
---|
248 | ALIGN JUMP_ALIGN
|
---|
249 | DisplayMasterSlaveMenu:
|
---|
250 | call MasterSlaveMenu_InitializeToDrvparamsOffsetInBX
|
---|
251 | jmp MasterSlaveMenu_EnterMenuOrModifyItemVisibility
|
---|