source: xtideuniversalbios/trunk/Configurator/Src/Menupages/DrvParamsMenu.asm@ 15

Last change on this file since 15 was 2, checked in by Tomi Tilli, 15 years ago
File size: 6.9 KB
Line 
1; File name : DrvParamsMenu.asm
2; Project name : XTIDE Univeral BIOS Configurator
3; Created date : 26.4.2010
4; Last update : 27.4.2010
5; Author : Tomi Tilli
6; Description : Menu for configuring DRVPARAMS.
7
8; Section containing initialized data
9SECTION .data
10
11; -Back to previous menu
12; Block Mode Transfers (Y)
13; User Specified CHS (Y)
14; Cylinders (16383)
15; Heads (16)
16; Sectors per track (63)
17
18ALIGN WORD_ALIGN
19g_MenuPageDrvParams:
20istruc MENUPAGE
21 at MENUPAGE.bItemCnt, db 6
22iend
23istruc MENUPAGEITEM ; Back to previous menu
24 at MENUPAGEITEM.fnActivate, dw MainPageItem_ActivateLeaveSubmenu
25 at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
26 at MENUPAGEITEM.szName, dw g_szPreviousMenu
27 at MENUPAGEITEM.szInfo, dw g_szNfoDrvBack
28 at MENUPAGEITEM.szHelp, dw g_szNfoDrvBack
29 at MENUPAGEITEM.bFlags, db FLG_MENUPAGEITEM_VISIBLE
30 at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_BACK
31iend
32g_MenuPageItemDrvBlockMode:
33istruc MENUPAGEITEM ; Block Mode Transfers
34 at MENUPAGEITEM.fnActivate, dw MenuPageItem_GetBoolFromUser
35 at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
36 at MENUPAGEITEM.wValueMask, dw FLG_DRVPARAMS_BLOCKMODE
37 at MENUPAGEITEM.szName, dw g_szItemDrvBlockMode
38 at MENUPAGEITEM.szInfo, dw g_szNfoDrvBlockMode
39 at MENUPAGEITEM.szHelp, dw g_szHelpDrvBlockMode
40 at MENUPAGEITEM.szDialog, dw g_szDlgDrvBlockMode
41 at MENUPAGEITEM.bFlags, db FLG_MENUPAGEITEM_VISIBLE
42 at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_FLAG
43iend
44g_MenuPageItemDrvUserCHS:
45istruc MENUPAGEITEM ; User Specified CHS
46 at MENUPAGEITEM.fnActivate, dw DrvParamsMenu_ActivateUserCHS
47 at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
48 at MENUPAGEITEM.wValueMask, dw FLG_DRVPARAMS_USERCHS
49 at MENUPAGEITEM.szName, dw g_szItemDrvUserCHS
50 at MENUPAGEITEM.szInfo, dw g_szNfoDrvUserCHS
51 at MENUPAGEITEM.szHelp, dw g_szHelpDrvUserCHS
52 at MENUPAGEITEM.szDialog, dw g_szDlgDrvUserCHS
53 at MENUPAGEITEM.bFlags, db FLG_MENUPAGEITEM_VISIBLE
54 at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_FLAG
55iend
56g_MenuPageItemDrvCyls:
57istruc MENUPAGEITEM ; Cylinders
58 at MENUPAGEITEM.fnActivate, dw MenuPageItem_GetWordFromUser
59 at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
60 at MENUPAGEITEM.wValueMin, dw 1
61 at MENUPAGEITEM.wValueMax, dw 16383
62 at MENUPAGEITEM.szName, dw g_szItemDrvCyls
63 at MENUPAGEITEM.szInfo, dw g_szNfoDrvCyls
64 at MENUPAGEITEM.szHelp, dw g_szNfoDrvCyls
65 at MENUPAGEITEM.szDialog, dw g_szDlgDrvCyls
66 at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_UNSIGNED_WORD
67iend
68g_MenuPageItemDrvHeads:
69istruc MENUPAGEITEM ; Heads
70 at MENUPAGEITEM.fnActivate, dw MenuPageItem_GetByteFromUser
71 at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
72 at MENUPAGEITEM.wValueMin, dw 1
73 at MENUPAGEITEM.wValueMax, dw 16
74 at MENUPAGEITEM.szName, dw g_szItemDrvHeads
75 at MENUPAGEITEM.szInfo, dw g_szNfoDrvHeads
76 at MENUPAGEITEM.szHelp, dw g_szNfoDrvHeads
77 at MENUPAGEITEM.szDialog, dw g_szDlgDrvHeads
78 at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_UNSIGNED_BYTE
79iend
80g_MenuPageItemDrvSect:
81istruc MENUPAGEITEM ; Sectors per track
82 at MENUPAGEITEM.fnActivate, dw MenuPageItem_GetByteFromUser
83 at MENUPAGEITEM.fnNameFormat, dw MenuPageItemFormat_NameForAnyType
84 at MENUPAGEITEM.wValueMin, dw 1
85 at MENUPAGEITEM.wValueMax, dw 63
86 at MENUPAGEITEM.szName, dw g_szItemDrvSect
87 at MENUPAGEITEM.szInfo, dw g_szNfoDrvSect
88 at MENUPAGEITEM.szHelp, dw g_szNfoDrvSect
89 at MENUPAGEITEM.szDialog, dw g_szDlgDrvSect
90 at MENUPAGEITEM.bType, db TYPE_MENUPAGEITEM_UNSIGNED_BYTE
91iend
92
93
94; Section containing code
95SECTION .text
96
97;--------------------------------------------------------------------
98; Stores DRVPARAMS specific pointers to MENUPAGEITEM structs.
99;
100; DrvParamsMenu_SetDrvParamsOffset
101; Parameters:
102; AX: Offset to DRVPARAMS
103; DS: CS
104; Returns:
105; Nothing
106; Corrupts registers:
107; BX, CX
108;--------------------------------------------------------------------
109ALIGN JUMP_ALIGN
110DrvParamsMenu_SetDrvParamsOffset:
111 eMOVZX cx, BYTE [g_MenuPageDrvParams+MENUPAGE.bItemCnt]
112 dec cx
113 mov bx, g_MenuPageItemDrvBlockMode+MENUPAGEITEM.pValue
114ALIGN JUMP_ALIGN
115.StoreIdevarsLoop:
116 mov [bx], ax
117 add bx, MENUPAGEITEM_size
118 loop .StoreIdevarsLoop
119
120 ; Add offsets to values
121 add WORD [g_MenuPageItemDrvBlockMode+MENUPAGEITEM.pValue], BYTE DRVPARAMS.wFlags
122 add WORD [g_MenuPageItemDrvUserCHS+MENUPAGEITEM.pValue], BYTE DRVPARAMS.wFlags
123 add WORD [g_MenuPageItemDrvCyls+MENUPAGEITEM.pValue], BYTE DRVPARAMS.wCylinders
124 add WORD [g_MenuPageItemDrvHeads+MENUPAGEITEM.pValue], BYTE DRVPARAMS.bHeads
125 add WORD [g_MenuPageItemDrvSect+MENUPAGEITEM.pValue], BYTE DRVPARAMS.bSect
126 ret
127
128
129;--------------------------------------------------------------------
130; DrvParamsMenu_ActivateUserCHS
131; Parameters:
132; DS:SI Ptr to MENUPAGE
133; DS:DI Ptr to MENUPAGEITEM
134; SS:BP: Ptr to MENUVARS
135; Returns:
136; CF: Set if menuitem changed
137; Cleared if no changes
138; Corrupts registers:
139; AX, BX, CX, DX
140;--------------------------------------------------------------------
141ALIGN JUMP_ALIGN
142DrvParamsMenu_ActivateUserCHS:
143 call MenuPageItem_GetBoolFromUser
144 jc SHORT DrvParamsMenu_SetMenuitemVisibilityAndDrawChanges
145 ret
146
147
148;--------------------------------------------------------------------
149; DrvParamsMenu_SetMenuitemVisibilityAndDrawChanges
150; Parameters:
151; DS:SI: Ptr to MENUPAGE
152; SS:BP: Ptr to MENUVARS
153; Returns:
154; CF: Cleared since no need to draw changes
155; Corrupts registers:
156; AX, BX, CX, DX
157;--------------------------------------------------------------------
158ALIGN JUMP_ALIGN
159DrvParamsMenu_SetMenuitemVisibilityAndDrawChanges:
160 call DrvParamsMenu_SetMenuitemVisibility
161 call MenuPage_InvalidateItemCount
162 clc ; No need to redraw Full Mode menuitem
163 ret
164
165;--------------------------------------------------------------------
166; Enables or disables menuitems based on current configuration.
167;
168; DrvParamsMenu_SetMenuitemVisibility
169; Parameters:
170; DS: CS
171; Returns:
172; Nothing
173; Corrupts registers:
174; BX
175;--------------------------------------------------------------------
176ALIGN JUMP_ALIGN
177DrvParamsMenu_SetMenuitemVisibility:
178 jmp SHORT DrvParamsMenu_SetChsVisibility
179
180ALIGN JUMP_ALIGN
181DrvParamsMenu_SetChsVisibility:
182 mov bx, [g_MenuPageItemDrvUserCHS+MENUPAGEITEM.pValue]
183 test WORD [bx], FLG_DRVPARAMS_USERCHS
184 jz SHORT .DisableUserCHS
185 or BYTE [g_MenuPageItemDrvCyls+MENUPAGEITEM.bFlags], FLG_MENUPAGEITEM_VISIBLE
186 or BYTE [g_MenuPageItemDrvHeads+MENUPAGEITEM.bFlags], FLG_MENUPAGEITEM_VISIBLE
187 or BYTE [g_MenuPageItemDrvSect+MENUPAGEITEM.bFlags], FLG_MENUPAGEITEM_VISIBLE
188 ret
189ALIGN JUMP_ALIGN
190.DisableUserCHS:
191 and BYTE [g_MenuPageItemDrvCyls+MENUPAGEITEM.bFlags], ~FLG_MENUPAGEITEM_VISIBLE
192 and BYTE [g_MenuPageItemDrvHeads+MENUPAGEITEM.bFlags], ~FLG_MENUPAGEITEM_VISIBLE
193 and BYTE [g_MenuPageItemDrvSect+MENUPAGEITEM.bFlags], ~FLG_MENUPAGEITEM_VISIBLE
194 ret
Note: See TracBrowser for help on using the repository browser.