source: xtideuniversalbios/trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MasterSlaveMenu.asm@ 60

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

Changes to Configuration Program v2:

  • Menu structure should now be complete.
File size: 7.9 KB
Line 
1; File name : MasterSlaveMenu.asm
2; Project name : XTIDE Universal BIOS Configurator v2
3; Created date : 3.11.2010
4; Last update : 18.11.2010
5; Author : Tomi Tilli
6; Description : "Master/Slave Drive" menu structs and functions.
7
8; Section containing initialized data
9SECTION .data
10
11ALIGN WORD_ALIGN
12g_MenupageForMasterSlaveMenu:
13istruc MENUPAGE
14 at MENUPAGE.fnEnter, dw MasterSlaveMenu_EnterMenuOrModifyItemVisibility
15 at MENUPAGE.fnBack, dw IdeControllerMenu_EnterMenuOrModifyItemVisibility
16 at MENUPAGE.wMenuitems, dw 6
17iend
18
19g_MenuitemMasterSlaveBackToIdeControllerMenu:
20istruc MENUITEM
21 at MENUITEM.fnActivate, dw IdeControllerMenu_EnterMenuOrModifyItemVisibility
22 at MENUITEM.szName, dw g_szItemDrvBackToIde
23 at MENUITEM.szQuickInfo, dw g_szItemDrvBackToIde
24 at MENUITEM.szHelp, dw g_szItemDrvBackToIde
25 at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE
26 at MENUITEM.bType, db TYPE_MENUITEM_PAGEBACK
27iend
28
29g_MenuitemMasterSlaveBlockModeTransfers:
30istruc MENUITEM
31 at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
32 at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
33 at MENUITEM.szName, dw g_szItemDrvBlockMode
34 at MENUITEM.szQuickInfo, dw g_szNfoDrvBlockMode
35 at MENUITEM.szHelp, dw g_szHelpDrvBlockMode
36 at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE | FLG_MENUITEM_FLAGVALUE
37 at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOISE
38 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
39 at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgDrvBlockMode
40 at MENUITEM.itemValue + ITEM_VALUE.szMultichoise, dw g_szMultichoiseBooleanFlag
41 at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForFlagBooleans
42 at MENUITEM.itemValue + ITEM_VALUE.wValueBitmask, dw FLG_DRVPARAMS_BLOCKMODE
43iend
44
45g_MenuitemMasterSlaveUserCHS:
46istruc MENUITEM
47 at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
48 at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
49 at MENUITEM.szName, dw g_szItemDrvUserCHS
50 at MENUITEM.szQuickInfo, dw g_szNfoDrvUserCHS
51 at MENUITEM.szHelp, dw g_szHelpDrvUserCHS
52 at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE | FLG_MENUITEM_MODIFY_MENU | FLG_MENUITEM_FLAGVALUE
53 at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOISE
54 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
55 at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgDrvUserCHS
56 at MENUITEM.itemValue + ITEM_VALUE.szMultichoise, dw g_szMultichoiseBooleanFlag
57 at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForFlagBooleans
58 at MENUITEM.itemValue + ITEM_VALUE.wValueBitmask, dw FLG_DRVPARAMS_USERCHS
59iend
60
61g_MenuitemMasterSlaveCylinders:
62istruc MENUITEM
63 at MENUITEM.fnActivate, dw Menuitem_ActivateUnsignedInputForMenuitemInDSSI
64 at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
65 at MENUITEM.szName, dw g_szItemDrvCyls
66 at MENUITEM.szQuickInfo, dw g_szNfoDrvCyls
67 at MENUITEM.szHelp, dw g_szNfoDrvCyls
68 at MENUITEM.bFlags, db NULL
69 at MENUITEM.bType, db TYPE_MENUITEM_UNSIGNED
70 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
71 at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgDrvCyls
72 at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 1
73 at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 16383
74iend
75
76g_MenuitemMasterSlaveHeads:
77istruc MENUITEM
78 at MENUITEM.fnActivate, dw Menuitem_ActivateUnsignedInputForMenuitemInDSSI
79 at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
80 at MENUITEM.szName, dw g_szItemDrvHeads
81 at MENUITEM.szQuickInfo, dw g_szNfoDrvHeads
82 at MENUITEM.szHelp, dw g_szNfoDrvHeads
83 at MENUITEM.bFlags, db FLG_MENUITEM_BYTEVALUE
84 at MENUITEM.bType, db TYPE_MENUITEM_UNSIGNED
85 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
86 at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgDrvHeads
87 at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 1
88 at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 16
89iend
90
91g_MenuitemMasterSlaveSectors:
92istruc MENUITEM
93 at MENUITEM.fnActivate, dw Menuitem_ActivateUnsignedInputForMenuitemInDSSI
94 at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteUnsignedValueStringToBufferInESDIfromItemInDSSI
95 at MENUITEM.szName, dw g_szItemDrvSect
96 at MENUITEM.szQuickInfo, dw g_szNfoDrvSect
97 at MENUITEM.szHelp, dw g_szNfoDrvSect
98 at MENUITEM.bFlags, db FLG_MENUITEM_BYTEVALUE
99 at MENUITEM.bType, db TYPE_MENUITEM_UNSIGNED
100 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL
101 at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgDrvSect
102 at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 1
103 at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 63
104iend
105
106
107; Section containing code
108SECTION .text
109
110;--------------------------------------------------------------------
111; MasterSlaveMenu_InitializeToDrvparamsOffsetInBX
112; Parameters:
113; SS:BP: Menu handle
114; Returns:
115; Nothing
116; Corrupts registers:
117; AX
118;--------------------------------------------------------------------
119ALIGN JUMP_ALIGN
120MasterSlaveMenu_InitializeToDrvparamsOffsetInBX:
121 lea ax, [bx+DRVPARAMS.wFlags]
122 mov [cs:g_MenuitemMasterSlaveBlockModeTransfers+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
123 mov [cs:g_MenuitemMasterSlaveUserCHS+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
124
125 lea ax, [bx+DRVPARAMS.wCylinders]
126 mov [cs:g_MenuitemMasterSlaveCylinders+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
127
128 lea ax, [bx+DRVPARAMS.bHeads]
129 mov [cs:g_MenuitemMasterSlaveHeads+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
130
131 lea ax, [bx+DRVPARAMS.bSect]
132 mov [cs:g_MenuitemMasterSlaveSectors+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
133 ret
134
135
136;--------------------------------------------------------------------
137; MasterSlaveMenu_EnterMenuOrModifyItemVisibility
138; Parameters:
139; SS:BP: Menu handle
140; Returns:
141; Nothing
142; Corrupts registers:
143; All, except BP
144;--------------------------------------------------------------------
145ALIGN JUMP_ALIGN
146MasterSlaveMenu_EnterMenuOrModifyItemVisibility:
147 push cs
148 pop ds
149 call .EnableOrDisableCHandS
150 mov si, g_MenupageForMasterSlaveMenu
151 jmp Menupage_ChangeToNewMenupageInDSSI
152
153;--------------------------------------------------------------------
154; .EnableOrDisableCHandS
155; Parameters:
156; SS:BP: Menu handle
157; Returns:
158; Nothing
159; Corrupts registers:
160; AX, BX
161;--------------------------------------------------------------------
162ALIGN JUMP_ALIGN
163.EnableOrDisableCHandS:
164 mov bx, [cs:g_MenuitemMasterSlaveUserCHS+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
165 call Buffers_GetRomvarsValueToAXfromOffsetInBX
166 test ax, FLG_DRVPARAMS_USERCHS
167 jz SHORT .DisableCHandS
168
169 mov bx, g_MenuitemMasterSlaveCylinders
170 call .EnableMenuitemFromCSBX
171 mov bx, g_MenuitemMasterSlaveHeads
172 call .EnableMenuitemFromCSBX
173 mov bx, g_MenuitemMasterSlaveSectors
174 call .EnableMenuitemFromCSBX
175 ret
176
177ALIGN JUMP_ALIGN
178.DisableCHandS:
179 mov bx, g_MenuitemMasterSlaveCylinders
180 call .DisableMenuitemFromCSBX
181 mov bx, g_MenuitemMasterSlaveHeads
182 call .DisableMenuitemFromCSBX
183 mov bx, g_MenuitemMasterSlaveSectors
184 call .DisableMenuitemFromCSBX
185 ret
186
187;--------------------------------------------------------------------
188; .EnableMenuitemFromCSBX
189; .DisableMenuitemFromCSBX
190; Parameters:
191; CS:BX: Ptr to MENUITEM
192; Returns:
193; Nothing
194; Corrupts registers:
195; Nothing
196;--------------------------------------------------------------------
197ALIGN JUMP_ALIGN
198.EnableMenuitemFromCSBX:
199 or BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
200 ret
201
202ALIGN JUMP_ALIGN
203.DisableMenuitemFromCSBX:
204 and BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
205 ret
Note: See TracBrowser for help on using the repository browser.