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

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

Changes to Configurator v2:

  • Updated for v1.2.0_wip BIOS.
  • IRQ selection is now properly hidden when disabling IRQ.
  • Load BIOS from ROM should now properly appear on main menu.
File size: 9.4 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_MenuitemIdeControllerBusType:
46istruc MENUITEM
47 at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI
48 at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
49 at MENUITEM.szName, dw g_szItemIdeBusType
50 at MENUITEM.szQuickInfo, dw g_szNfoIdeBusType
51 at MENUITEM.szHelp, dw g_szNfoIdeBusType
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_szDlgBusType
56 at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw g_szMultichoiceCfgBusType
57 at MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup, dw g_rgwChoiceToValueLookupForBusType
58 at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForBusType
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_rgwChoiceToValueLookupForBusType:
123 dw BUS_TYPE_8_DUAL
124 dw BUS_TYPE_8_SINGLE
125 dw BUS_TYPE_16
126 dw BUS_TYPE_32
127g_rgszValueToStringLookupForBusType:
128 dw g_szValueCfgBusTypeDual8b
129 dw g_szValueCfgBusType16b
130 dw g_szValueCfgBusType32b
131 dw g_szValueCfgBusTypeSingle8b
132
133
134; Section containing code
135SECTION .text
136
137;--------------------------------------------------------------------
138; IdeControllerMenu_InitializeToIdevarsOffsetInBX
139; Parameters:
140; SS:BP: Menu handle
141; Returns:
142; Nothing
143; Corrupts registers:
144; AX
145;--------------------------------------------------------------------
146ALIGN JUMP_ALIGN
147IdeControllerMenu_InitializeToIdevarsOffsetInBX:
148 lea ax, [bx+IDEVARS.drvParamsMaster]
149 mov [cs:g_MenuitemIdeControllerMasterDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
150
151 lea ax, [bx+IDEVARS.drvParamsSlave]
152 mov [cs:g_MenuitemIdeControllerSlaveDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
153
154 lea ax, [bx+IDEVARS.bBusType]
155 mov [cs:g_MenuitemIdeControllerBusType+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
156
157 lea ax, [bx+IDEVARS.wPort]
158 mov [cs:g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
159
160 lea ax, [bx+IDEVARS.wPortCtrl]
161 mov [cs:g_MenuitemIdeControllerControlBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
162
163 lea ax, [bx+IDEVARS.bIRQ]
164 mov [cs:g_MenuitemIdeControllerEnableInterrupt+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
165 mov [cs:g_MenuitemIdeControllerIdeIRQ+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
166 ret
167
168
169;--------------------------------------------------------------------
170; IdeControllerMenu_EnterMenuOrModifyItemVisibility
171; Parameters:
172; SS:BP: Menu handle
173; Returns:
174; Nothing
175; Corrupts registers:
176; All, except BP
177;--------------------------------------------------------------------
178ALIGN JUMP_ALIGN
179IdeControllerMenu_EnterMenuOrModifyItemVisibility:
180 push cs
181 pop ds
182 call .EnableOrDisableIRQ
183 mov si, g_MenupageForIdeControllerMenu
184 jmp Menupage_ChangeToNewMenupageInDSSI
185
186;--------------------------------------------------------------------
187; .EnableOrDisableIRQ
188; Parameters:
189; SS:BP: Menu handle
190; Returns:
191; Nothing
192; Corrupts registers:
193; AX, BX
194;--------------------------------------------------------------------
195ALIGN JUMP_ALIGN
196.EnableOrDisableIRQ:
197 mov bx, [cs:g_MenuitemIdeControllerEnableInterrupt+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
198 call Buffers_GetRomvarsValueToAXfromOffsetInBX
199 mov bx, g_MenuitemIdeControllerIdeIRQ
200 test al, al
201 jz SHORT .DisableMenuitemFromCSBX
202 ; Fall to .EnableMenuitemFromCSBX
203
204;--------------------------------------------------------------------
205; .EnableMenuitemFromCSBX
206; .DisableMenuitemFromCSBX
207; Parameters:
208; CS:BX: Ptr to MENUITEM
209; Returns:
210; Nothing
211; Corrupts registers:
212; Nothing
213;--------------------------------------------------------------------
214ALIGN JUMP_ALIGN
215.EnableMenuitemFromCSBX:
216 or BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
217 ret
218
219ALIGN JUMP_ALIGN
220.DisableMenuitemFromCSBX:
221 and BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
222 ret
223
224
225;--------------------------------------------------------------------
226; MENUITEM activation functions (.fnActivate)
227; Parameters:
228; SS:BP: Ptr to MENU
229; Returns:
230; Nothing
231; Corrupts registers:
232; All, except segments
233;--------------------------------------------------------------------
234ALIGN JUMP_ALIGN
235MasterDrive:
236 mov bx, [cs:g_MenuitemIdeControllerMasterDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
237 jmp SHORT DisplayMasterSlaveMenu
238
239ALIGN JUMP_ALIGN
240SlaveDrive:
241 mov bx, [cs:g_MenuitemIdeControllerSlaveDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
242 ; Fall to DisplayMasterSlaveMenu
243
244ALIGN JUMP_ALIGN
245DisplayMasterSlaveMenu:
246 call MasterSlaveMenu_InitializeToDrvparamsOffsetInBX
247 jmp MasterSlaveMenu_EnterMenuOrModifyItemVisibility
Note: See TracBrowser for help on using the repository browser.