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

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

Changes to Configuration Program v2:

  • Menu structure should now be complete.
File size: 9.5 KB
Line 
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
9SECTION .data
10
11ALIGN WORD_ALIGN
12g_MenupageForIdeControllerMenu:
13istruc MENUPAGE
14 at MENUPAGE.fnEnter, dw IdeControllerMenu_EnterMenuOrModifyItemVisibility
15 at MENUPAGE.fnBack, dw ConfigurationMenu_EnterMenuOrModifyItemVisibility
16 at MENUPAGE.wMenuitems, dw 8
17iend
18
19g_MenuitemIdeControllerBackToConfigurationMenu:
20istruc 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
27iend
28
29g_MenuitemIdeControllerMasterDrive:
30istruc 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
37iend
38
39g_MenuitemIdeControllerSlaveDrive:
40istruc 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
47iend
48
49g_MenuitemIdeControllerBusType:
50istruc 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
63iend
64
65g_MenuitemIdeControllerCommandBlockAddress:
66istruc 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
78iend
79
80g_MenuitemIdeControllerControlBlockAddress:
81istruc 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
93iend
94
95g_MenuitemIdeControllerEnableInterrupt:
96istruc 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
109iend
110
111g_MenuitemIdeControllerIdeIRQ:
112istruc 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
124iend
125
126g_rgwChoiseToValueLookupForBusType:
127 dw BUS_TYPE_8_DUAL
128 dw BUS_TYPE_8_SINGLE
129 dw BUS_TYPE_16
130 dw BUS_TYPE_32
131g_rgszValueToStringLookupForBusType:
132 dw g_szValueCfgBusTypeDual8b
133 dw g_szValueCfgBusType16b
134 dw g_szValueCfgBusType32b
135 dw g_szValueCfgBusTypeSingle8b
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.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;--------------------------------------------------------------------
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 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;--------------------------------------------------------------------
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.