1 | ; File name : FlashMenu.asm
|
---|
2 | ; Project name : XTIDE Universal BIOS Configurator v2
|
---|
3 | ; Created date : 19.11.2010
|
---|
4 | ; Last update : 19.11.2010
|
---|
5 | ; Author : Tomi Tilli
|
---|
6 | ; Description : "Flash EEPROM" menu structs and functions.
|
---|
7 |
|
---|
8 | ; Section containing initialized data
|
---|
9 | SECTION .data
|
---|
10 |
|
---|
11 | ALIGN WORD_ALIGN
|
---|
12 | g_MenupageForFlashMenu:
|
---|
13 | istruc MENUPAGE
|
---|
14 | at MENUPAGE.fnEnter, dw FlashMenu_EnterMenuOrModifyItemVisibility
|
---|
15 | at MENUPAGE.fnBack, dw MainMenu_EnterMenuOrModifyItemVisibility
|
---|
16 | at MENUPAGE.wMenuitems, dw 7
|
---|
17 | iend
|
---|
18 |
|
---|
19 | g_MenuitemFlashBackToMainMenu:
|
---|
20 | istruc MENUITEM
|
---|
21 | at MENUITEM.fnActivate, dw MainMenu_EnterMenuOrModifyItemVisibility
|
---|
22 | at MENUITEM.szName, dw g_szItemCfgBackToMain
|
---|
23 | at MENUITEM.szQuickInfo, dw g_szItemCfgBackToMain
|
---|
24 | at MENUITEM.szHelp, dw g_szItemCfgBackToMain
|
---|
25 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE
|
---|
26 | at MENUITEM.bType, db TYPE_MENUITEM_PAGEBACK
|
---|
27 | iend
|
---|
28 |
|
---|
29 | g_MenuitemFlashStartFlashing:
|
---|
30 | istruc MENUITEM
|
---|
31 | at MENUITEM.fnActivate, dw StartFlashing
|
---|
32 | at MENUITEM.szName, dw g_szItemFlashStart
|
---|
33 | at MENUITEM.szQuickInfo, dw g_szNfoFlashStart
|
---|
34 | at MENUITEM.szHelp, dw g_szNfoFlashStart
|
---|
35 | at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE
|
---|
36 | at MENUITEM.bType, db TYPE_MENUITEM_ACTION
|
---|
37 | iend
|
---|
38 |
|
---|
39 | g_MenuitemFlashEepromType:
|
---|
40 | istruc MENUITEM
|
---|
41 | at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
|
---|
42 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
|
---|
43 | at MENUITEM.szName, dw g_szItemFlashEepromType
|
---|
44 | at MENUITEM.szQuickInfo, dw g_szNfoFlashEepromType
|
---|
45 | at MENUITEM.szHelp, dw g_szNfoFlashEepromType
|
---|
46 | at MENUITEM.bFlags, db FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_VISIBLE
|
---|
47 | at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOISE
|
---|
48 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw CFGVARS.bEepromType
|
---|
49 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgFlashEepromType
|
---|
50 | at MENUITEM.itemValue + ITEM_VALUE.szMultichoise, dw g_szMultichoiseEepromType
|
---|
51 | at MENUITEM.itemValue + ITEM_VALUE.rgwChoiseToValueLookup, dw g_rgwChoiseToValueLookupForEepromType
|
---|
52 | at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForEepromType
|
---|
53 | iend
|
---|
54 |
|
---|
55 | g_MenuitemFlashSdpCommand:
|
---|
56 | istruc MENUITEM
|
---|
57 | at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
|
---|
58 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
|
---|
59 | at MENUITEM.szName, dw g_szItemFlashSDP
|
---|
60 | at MENUITEM.szQuickInfo, dw g_szNfoFlashSDP
|
---|
61 | at MENUITEM.szHelp, dw g_szHelpFlashSDP
|
---|
62 | at MENUITEM.bFlags, db FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_VISIBLE
|
---|
63 | at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOISE
|
---|
64 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw CFGVARS.bSdpCommand
|
---|
65 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgFlashSDP
|
---|
66 | at MENUITEM.itemValue + ITEM_VALUE.szMultichoise, dw g_szMultichoiseSdpCommand
|
---|
67 | at MENUITEM.itemValue + ITEM_VALUE.rgwChoiseToValueLookup, dw g_rgwChoiseToValueLookupForSdpCommand
|
---|
68 | at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForSdpCommand
|
---|
69 | iend
|
---|
70 |
|
---|
71 | g_MenuitemFlashPageSize:
|
---|
72 | istruc MENUITEM
|
---|
73 | at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
|
---|
74 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
|
---|
75 | at MENUITEM.szName, dw g_szItemFlashPageSize
|
---|
76 | at MENUITEM.szQuickInfo, dw g_szNfoFlashPageSize
|
---|
77 | at MENUITEM.szHelp, dw g_szHelpFlashPageSize
|
---|
78 | at MENUITEM.bFlags, db FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_VISIBLE
|
---|
79 | at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOISE
|
---|
80 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw CFGVARS.bEepromPageSize
|
---|
81 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgFlashPageSize
|
---|
82 | at MENUITEM.itemValue + ITEM_VALUE.szMultichoise, dw g_szMultichoisePageSize
|
---|
83 | at MENUITEM.itemValue + ITEM_VALUE.rgwChoiseToValueLookup, dw g_rgwChoiseToValueLookupForPageSize
|
---|
84 | at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForPageSize
|
---|
85 | iend
|
---|
86 |
|
---|
87 | g_MenuitemFlashEepromAddress:
|
---|
88 | istruc MENUITEM
|
---|
89 | at MENUITEM.fnActivate, dw Menuitem_ActivateHexInputForMenuitemInDSSI
|
---|
90 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteHexValueStringToBufferInESDIfromItemInDSSI
|
---|
91 | at MENUITEM.szName, dw g_szItemFlashAddr
|
---|
92 | at MENUITEM.szQuickInfo, dw g_szNfoFlashAddr
|
---|
93 | at MENUITEM.szHelp, dw g_szNfoFlashAddr
|
---|
94 | at MENUITEM.bFlags, db FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_VISIBLE
|
---|
95 | at MENUITEM.bType, db TYPE_MENUITEM_HEX
|
---|
96 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw CFGVARS.wEepromSegment
|
---|
97 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgFlashAddr
|
---|
98 | at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 0C000h
|
---|
99 | at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 0F800h
|
---|
100 | iend
|
---|
101 |
|
---|
102 | g_MenuitemFlashGenerateChecksum:
|
---|
103 | istruc MENUITEM
|
---|
104 | at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiseSelectionForMenuitemInDSSI
|
---|
105 | at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromShiftedItemInDSSI
|
---|
106 | at MENUITEM.szName, dw g_szItemFlashChecksum
|
---|
107 | at MENUITEM.szQuickInfo, dw g_szNfoFlashChecksum
|
---|
108 | at MENUITEM.szHelp, dw g_szHelpFlashChecksum
|
---|
109 | at MENUITEM.bFlags, db FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_VISIBLE | FLG_MENUITEM_FLAGVALUE
|
---|
110 | at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOISE
|
---|
111 | at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw CFGVARS.wFlags
|
---|
112 | at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgFlashChecksum
|
---|
113 | at MENUITEM.itemValue + ITEM_VALUE.szMultichoise, dw g_szMultichoiseBooleanFlag
|
---|
114 | at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForFlagBooleans
|
---|
115 | at MENUITEM.itemValue + ITEM_VALUE.wValueBitmask, dw FLG_CFGVARS_CHECKSUM
|
---|
116 | iend
|
---|
117 |
|
---|
118 | g_rgwChoiseToValueLookupForEepromType:
|
---|
119 | dw EEPROM_TYPE.2816_2kiB
|
---|
120 | dw EEPROM_TYPE.2832_4kiB
|
---|
121 | dw EEPROM_TYPE.2864_8kiB
|
---|
122 | dw EEPROM_TYPE.28128_16kiB
|
---|
123 | dw EEPROM_TYPE.28256_32kiB
|
---|
124 | dw EEPROM_TYPE.28512_64kiB
|
---|
125 | g_rgszValueToStringLookupForEepromType:
|
---|
126 | dw g_szValueFlash2816
|
---|
127 | dw g_szValueFlash2832
|
---|
128 | dw g_szValueFlash2864
|
---|
129 | dw g_szValueFlash28128
|
---|
130 | dw g_szValueFlash28256
|
---|
131 | dw g_szValueFlash28512
|
---|
132 |
|
---|
133 | g_rgwChoiseToValueLookupForSdpCommand:
|
---|
134 | dw SDP_COMMAND.none
|
---|
135 | dw SDP_COMMAND.enable
|
---|
136 | dw SDP_COMMAND.disable
|
---|
137 | g_rgszValueToStringLookupForSdpCommand:
|
---|
138 | dw g_szValueFlashNone
|
---|
139 | dw g_szValueFlashEnable
|
---|
140 | dw g_szValueFlashDisable
|
---|
141 |
|
---|
142 | g_rgwChoiseToValueLookupForPageSize:
|
---|
143 | dw EEPROM_PAGE_SIZE.1_byte
|
---|
144 | dw EEPROM_PAGE_SIZE.2_bytes
|
---|
145 | dw EEPROM_PAGE_SIZE.4_bytes
|
---|
146 | dw EEPROM_PAGE_SIZE.8_bytes
|
---|
147 | dw EEPROM_PAGE_SIZE.16_bytes
|
---|
148 | dw EEPROM_PAGE_SIZE.32_bytes
|
---|
149 | dw EEPROM_PAGE_SIZE.64_bytes
|
---|
150 | g_rgszValueToStringLookupForPageSize:
|
---|
151 | dw g_szValueFlash1byte
|
---|
152 | dw g_szValueFlash2bytes
|
---|
153 | dw g_szValueFlash4bytes
|
---|
154 | dw g_szValueFlash8bytes
|
---|
155 | dw g_szValueFlash16bytes
|
---|
156 | dw g_szValueFlash32bytes
|
---|
157 | dw g_szValueFlash64bytes
|
---|
158 |
|
---|
159 |
|
---|
160 | ; Section containing code
|
---|
161 | SECTION .text
|
---|
162 |
|
---|
163 | ;--------------------------------------------------------------------
|
---|
164 | ; MainMenu_EnterMenuOrModifyItemVisibility
|
---|
165 | ; Parameters:
|
---|
166 | ; SS:BP: Menu handle
|
---|
167 | ; Returns:
|
---|
168 | ; Nothing
|
---|
169 | ; Corrupts registers:
|
---|
170 | ; All, except BP
|
---|
171 | ;--------------------------------------------------------------------
|
---|
172 | ALIGN JUMP_ALIGN
|
---|
173 | FlashMenu_EnterMenuOrModifyItemVisibility:
|
---|
174 | push cs
|
---|
175 | pop ds
|
---|
176 | mov si, g_MenupageForFlashMenu
|
---|
177 | jmp Menupage_ChangeToNewMenupageInDSSI
|
---|
178 |
|
---|
179 |
|
---|
180 | ;--------------------------------------------------------------------
|
---|
181 | ; MENUITEM activation functions (.fnActivate)
|
---|
182 | ; Parameters:
|
---|
183 | ; SS:BP: Ptr to MENU
|
---|
184 | ; Returns:
|
---|
185 | ; Nothing
|
---|
186 | ; Corrupts registers:
|
---|
187 | ; All, except segments
|
---|
188 | ;--------------------------------------------------------------------
|
---|
189 | ALIGN JUMP_ALIGN
|
---|
190 | StartFlashing:
|
---|
191 | ret
|
---|