1 | ; File name : IdeControllerMenu.asm
|
---|
2 | ; Project name : XTIDE Universal BIOS Configurator v2
|
---|
3 | ; Created date : 2.11.2010
|
---|
4 | ; Last update : 18.11.2010
|
---|
5 | ; Author : Tomi Tilli
|
---|
6 | ; Description : "IDE Controller" menu structs and functions.
|
---|
7 |
|
---|
8 | ; Section containing initialized data
|
---|
9 | SECTION .data
|
---|
10 |
|
---|
11 | ALIGN WORD_ALIGN
|
---|
12 | g_MenupageForIdeControllerMenu:
|
---|
13 | istruc MENUPAGE
|
---|
14 | at MENUPAGE.fnEnter, dw IdeControllerMenu_EnterMenuOrModifyItemVisibility
|
---|
15 | at MENUPAGE.fnBack, dw ConfigurationMenu_EnterMenuOrModifyItemVisibility
|
---|
16 | at MENUPAGE.wMenuitems, dw 8
|
---|
17 | iend
|
---|
18 |
|
---|
19 | g_MenuitemIdeControllerBackToConfigurationMenu:
|
---|
20 | istruc MENUITEM
|
---|
21 | at MENUITEM.fnActivate, dw ConfigurationMenu_EnterMenuOrModifyItemVisibility
|
---|
22 | at MENUITEM.szName, dw g_szItemBackToCfgMenu
|
---|
23 | at MENUITEM.szQuickInfo, dw g_szNfoIdeBackToCfgMenu
|
---|
24 | at MENUITEM.szHelp, dw g_szNfoIdeBackToCfgMenu
|
---|
25 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE
|
---|
26 | at MENUITEM.bType, db TYPE_MENUITEM_PAGEBACK
|
---|
27 | iend
|
---|
28 |
|
---|
29 | g_MenuitemIdeControllerMasterDrive:
|
---|
30 | istruc MENUITEM
|
---|
31 | at MENUITEM.fnActivate, dw MasterDrive
|
---|
32 | at MENUITEM.szName, dw g_szItemIdeMaster
|
---|
33 | at MENUITEM.szQuickInfo, dw g_szNfoIdeMaster
|
---|
34 | at MENUITEM.szHelp, dw g_szNfoIdeMaster
|
---|
35 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE
|
---|
36 | at MENUITEM.bType, db TYPE_MENUITEM_PAGENEXT
|
---|
37 | iend
|
---|
38 |
|
---|
39 | g_MenuitemIdeControllerSlaveDrive:
|
---|
40 | istruc MENUITEM
|
---|
41 | at MENUITEM.fnActivate, dw SlaveDrive
|
---|
42 | at MENUITEM.szName, dw g_szItemIdeSlave
|
---|
43 | at MENUITEM.szQuickInfo, dw g_szNfoIdeSlave
|
---|
44 | at MENUITEM.szHelp, dw g_szNfoIdeSlave
|
---|
45 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE
|
---|
46 | at MENUITEM.bType, db TYPE_MENUITEM_PAGENEXT
|
---|
47 | iend
|
---|
48 |
|
---|
49 | g_MenuitemIdeControllerBusType:
|
---|
50 | istruc MENUITEM
|
---|
51 | at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
|
---|
52 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
|
---|
53 | at MENUITEM.szName, dw g_szItemIdeBusType
|
---|
54 | at MENUITEM.szQuickInfo, dw g_szNfoIdeBusType
|
---|
55 | at MENUITEM.szHelp, dw g_szNfoIdeBusType
|
---|
56 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE | FLG_MENUITEM_BYTEVALUE
|
---|
57 | at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOISE
|
---|
58 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
|
---|
59 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgBusType
|
---|
60 | at MENUITEM.itemValue + ITEM_VALUE.szMultichoise, dw g_szMultichoiseCfgBusType
|
---|
61 | at MENUITEM.itemValue + ITEM_VALUE.rgwChoiseToValueLookup, dw g_rgwChoiseToValueLookupForBusType
|
---|
62 | at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForBusType
|
---|
63 | iend
|
---|
64 |
|
---|
65 | g_MenuitemIdeControllerCommandBlockAddress:
|
---|
66 | istruc MENUITEM
|
---|
67 | at MENUITEM.fnActivate, dw Menuitem_ActivateHexInputForMenuitemInDSSI
|
---|
68 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteHexValueStringToBufferInESDIfromItemInDSSI
|
---|
69 | at MENUITEM.szName, dw g_szItemIdeCmdPort
|
---|
70 | at MENUITEM.szQuickInfo, dw g_szNfoIdeCmdPort
|
---|
71 | at MENUITEM.szHelp, dw g_szHelpIdeCmdPort
|
---|
72 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE
|
---|
73 | at MENUITEM.bType, db TYPE_MENUITEM_HEX
|
---|
74 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
|
---|
75 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgIdeCmdPort
|
---|
76 | at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 0
|
---|
77 | at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw -1
|
---|
78 | iend
|
---|
79 |
|
---|
80 | g_MenuitemIdeControllerControlBlockAddress:
|
---|
81 | istruc MENUITEM
|
---|
82 | at MENUITEM.fnActivate, dw Menuitem_ActivateHexInputForMenuitemInDSSI
|
---|
83 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteHexValueStringToBufferInESDIfromItemInDSSI
|
---|
84 | at MENUITEM.szName, dw g_szItemIdeCtrlPort
|
---|
85 | at MENUITEM.szQuickInfo, dw g_szNfoIdeCtrlPort
|
---|
86 | at MENUITEM.szHelp, dw g_szHelpIdeCtrlPort
|
---|
87 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE
|
---|
88 | at MENUITEM.bType, db TYPE_MENUITEM_HEX
|
---|
89 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
|
---|
90 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgIdeCtrlPort
|
---|
91 | at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 0
|
---|
92 | at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw -1
|
---|
93 | iend
|
---|
94 |
|
---|
95 | g_MenuitemIdeControllerEnableInterrupt:
|
---|
96 | istruc MENUITEM
|
---|
97 | at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
|
---|
98 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
|
---|
99 | at MENUITEM.szName, dw g_szItemIdeEnIRQ
|
---|
100 | at MENUITEM.szQuickInfo, dw g_szNfoIdeEnIRQ
|
---|
101 | at MENUITEM.szHelp, dw g_szHelpIdeEnIRQ
|
---|
102 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE | FLG_MENUITEM_MODIFY_MENU | FLG_MENUITEM_FLAGVALUE
|
---|
103 | at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOISE
|
---|
104 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
|
---|
105 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgIdeEnIRQ
|
---|
106 | at MENUITEM.itemValue + ITEM_VALUE.szMultichoise, dw g_szMultichoiseBooleanFlag
|
---|
107 | at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForFlagBooleans
|
---|
108 | at MENUITEM.itemValue + ITEM_VALUE.wValueBitmask, dw 15
|
---|
109 | iend
|
---|
110 |
|
---|
111 | g_MenuitemIdeControllerIdeIRQ:
|
---|
112 | istruc MENUITEM
|
---|
113 | at MENUITEM.fnActivate, dw Menuitem_ActivateUnsignedInputForMenuitemInDSSI
|
---|
114 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
|
---|
115 | at MENUITEM.szName, dw g_szItemIdeIRQ
|
---|
116 | at MENUITEM.szQuickInfo, dw g_szNfoIdeIRQ
|
---|
117 | at MENUITEM.szHelp, dw g_szHelpIdeIRQ
|
---|
118 | at MENUITEM.bFlags, db FLG_MENUITEM_BYTEVALUE
|
---|
119 | at MENUITEM.bType, db TYPE_MENUITEM_UNSIGNED
|
---|
120 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
|
---|
121 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgIdeIRQ
|
---|
122 | at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 2
|
---|
123 | at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 15
|
---|
124 | iend
|
---|
125 |
|
---|
126 | g_rgwChoiseToValueLookupForBusType:
|
---|
127 | dw BUS_TYPE_8_DUAL
|
---|
128 | dw BUS_TYPE_8_SINGLE
|
---|
129 | dw BUS_TYPE_16
|
---|
130 | dw BUS_TYPE_32
|
---|
131 | g_rgszValueToStringLookupForBusType:
|
---|
132 | dw g_szValueCfgBusTypeDual8b
|
---|
133 | dw g_szValueCfgBusType16b
|
---|
134 | dw g_szValueCfgBusType32b
|
---|
135 | dw g_szValueCfgBusTypeSingle8b
|
---|
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.bBusType]
|
---|
159 | mov [cs:g_MenuitemIdeControllerBusType+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 ax, ax
|
---|
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
|
---|