source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm@ 182

Last change on this file since 182 was 153, checked in by Tomi Tilli, 14 years ago

Changes to Configurator v2:

  • Updated for latest XTIDE Universal BIOS.
File size: 9.5 KB
Line 
1; Project name : XTIDE Universal BIOS Configurator v2
2; Description : "IDE Controller" menu structs and functions.
3
4; Section containing initialized data
5SECTION .data
6
7ALIGN WORD_ALIGN
8g_MenupageForIdeControllerMenu:
9istruc MENUPAGE
10 at MENUPAGE.fnEnter, dw IdeControllerMenu_EnterMenuOrModifyItemVisibility
11 at MENUPAGE.fnBack, dw ConfigurationMenu_EnterMenuOrModifyItemVisibility
12 at MENUPAGE.wMenuitems, dw 8
13iend
14
15g_MenuitemIdeControllerBackToConfigurationMenu:
16istruc 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
23iend
24
25g_MenuitemIdeControllerMasterDrive:
26istruc 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
33iend
34
35g_MenuitemIdeControllerSlaveDrive:
36istruc 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
43iend
44
45g_MenuitemIdeControllerDevice:
46istruc 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
59iend
60
61g_MenuitemIdeControllerCommandBlockAddress:
62istruc 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
74iend
75
76g_MenuitemIdeControllerControlBlockAddress:
77istruc 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
89iend
90
91g_MenuitemIdeControllerEnableInterrupt:
92istruc 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
105iend
106
107g_MenuitemIdeControllerIdeIRQ:
108istruc 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
120iend
121
122g_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
129g_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
139SECTION .text
140
141;--------------------------------------------------------------------
142; IdeControllerMenu_InitializeToIdevarsOffsetInBX
143; Parameters:
144; SS:BP: Menu handle
145; Returns:
146; Nothing
147; Corrupts registers:
148; AX
149;--------------------------------------------------------------------
150ALIGN JUMP_ALIGN
151IdeControllerMenu_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;--------------------------------------------------------------------
182ALIGN JUMP_ALIGN
183IdeControllerMenu_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;--------------------------------------------------------------------
199ALIGN 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;--------------------------------------------------------------------
218ALIGN JUMP_ALIGN
219.EnableMenuitemFromCSBX:
220 or BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
221 ret
222
223ALIGN 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;--------------------------------------------------------------------
238ALIGN JUMP_ALIGN
239MasterDrive:
240 mov bx, [cs:g_MenuitemIdeControllerMasterDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
241 jmp SHORT DisplayMasterSlaveMenu
242
243ALIGN JUMP_ALIGN
244SlaveDrive:
245 mov bx, [cs:g_MenuitemIdeControllerSlaveDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
246 ; Fall to DisplayMasterSlaveMenu
247
248ALIGN JUMP_ALIGN
249DisplayMasterSlaveMenu:
250 call MasterSlaveMenu_InitializeToDrvparamsOffsetInBX
251 jmp MasterSlaveMenu_EnterMenuOrModifyItemVisibility
Note: See TracBrowser for help on using the repository browser.