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