Changeset 65 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages
- Timestamp:
- Dec 5, 2010, 6:52:11 PM (14 years ago)
- google:author:
- aitotat
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm
r63 r65 2 2 ; Project name : XTIDE Universal BIOS Configurator v2 3 3 ; Created date : 19.11.2010 4 ; Last update : 19.11.20104 ; Last update : 5.12.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : "Flash EEPROM" menu structs and functions. … … 78 78 at MENUITEM.bFlags, db FLG_MENUITEM_PROGRAMVAR | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_VISIBLE 79 79 at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOISE 80 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw CFGVARS.bEepromPage Size80 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw CFGVARS.bEepromPage 81 81 at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgFlashPageSize 82 82 at MENUITEM.itemValue + ITEM_VALUE.szMultichoise, dw g_szMultichoisePageSize … … 137 137 138 138 g_rgwChoiseToValueLookupForPageSize: 139 dw EEPROM_PAGE _SIZE.1_byte140 dw EEPROM_PAGE _SIZE.2_bytes141 dw EEPROM_PAGE _SIZE.4_bytes142 dw EEPROM_PAGE _SIZE.8_bytes143 dw EEPROM_PAGE _SIZE.16_bytes144 dw EEPROM_PAGE _SIZE.32_bytes145 dw EEPROM_PAGE _SIZE.64_bytes139 dw EEPROM_PAGE.1_byte 140 dw EEPROM_PAGE.2_bytes 141 dw EEPROM_PAGE.4_bytes 142 dw EEPROM_PAGE.8_bytes 143 dw EEPROM_PAGE.16_bytes 144 dw EEPROM_PAGE.32_bytes 145 dw EEPROM_PAGE.64_bytes 146 146 g_rgszValueToStringLookupForPageSize: 147 147 dw g_szValueFlash1byte … … 185 185 ALIGN JUMP_ALIGN 186 186 StartFlashing: 187 push es 188 push ds 189 190 call .PrepareBuffersForFlashing 191 mov cx, FLASHVARS_size + PROGRESS_DIALOG_IO_size 192 call Memory_ReserveCXbytesFromStackToDSSI 193 call .InitializeFlashvarsFromDSSI 194 mov bx, si ; DS:BX now points to FLASHVARS 195 add si, BYTE FLASHVARS_size ; DS:SI now points to PROGRESS_DIALOG_IO 196 call Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX 197 call .DisplayFlashingResultsFromFlashvarsInDSBX 198 199 add sp, BYTE FLASHVARS_size + PROGRESS_DIALOG_IO_size 200 pop ds 201 pop es 187 202 ret 203 204 ;-------------------------------------------------------------------- 205 ; .PrepareBuffersForFlashing 206 ; Parameters: 207 ; SS:BP: Ptr to MENU 208 ; Returns: 209 ; Nothing 210 ; Corrupts registers: 211 ; AX, BX, CX, SI, DI 212 ;-------------------------------------------------------------------- 213 ALIGN JUMP_ALIGN 214 .PrepareBuffersForFlashing: 215 call EEPROM_LoadFromRomToRamComparisonBuffer 216 call Buffers_AppendZeroesIfNeeded 217 test WORD [cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_CHECKSUM 218 jz SHORT .DoNotGenerateChecksumByte 219 jmp Buffers_GenerateChecksum 220 .DoNotGenerateChecksumByte: 221 ret 222 223 ;-------------------------------------------------------------------- 224 ; .InitializeFlashvarsFromDSSI 225 ; Parameters: 226 ; DS:SI: Ptr to FLASHVARS to initialize 227 ; SS:BP: Ptr to MENU 228 ; Returns: 229 ; Nothing 230 ; Corrupts registers: 231 ; AX, BX, DX, DI, ES 232 ;-------------------------------------------------------------------- 233 ALIGN JUMP_ALIGN 234 .InitializeFlashvarsFromDSSI: 235 call Buffers_GetFileBufferToESDI 236 mov [si+FLASHVARS.fpNextSourcePage], di 237 mov [si+FLASHVARS.fpNextSourcePage+2], es 238 239 call Buffers_GetFlashComparisonBufferToESDI 240 mov [si+FLASHVARS.fpNextComparisonPage], di 241 mov [si+FLASHVARS.fpNextComparisonPage+2], es 242 243 mov ax, [cs:g_cfgVars+CFGVARS.wEepromSegment] 244 mov WORD [si+FLASHVARS.fpNextDestinationPage], 0 245 mov [si+FLASHVARS.fpNextDestinationPage+2], ax 246 247 mov al, [cs:g_cfgVars+CFGVARS.bEepromType] 248 mov [si+FLASHVARS.bEepromType], al 249 250 mov al, [cs:g_cfgVars+CFGVARS.bSdpCommand] 251 mov [si+FLASHVARS.bEepromSdpCommand], al 252 253 eMOVZX bx, BYTE [cs:g_cfgVars+CFGVARS.bEepromPage] 254 mov ax, [cs:bx+g_rgwEepromPageToSizeInBytes] 255 mov [si+FLASHVARS.wEepromPageSize], ax 256 257 call .GetNumberOfPagesToFlashToAX 258 mov [si+FLASHVARS.wPagesToFlash], ax 259 ret 260 261 ;-------------------------------------------------------------------- 262 ; .GetNumberOfPagesToFlashToAX 263 ; Parameters: 264 ; DS:SI: Ptr to FLASHVARS to initialize 265 ; Returns: 266 ; AX: Number of pages to flash (0 = 65536) 267 ; Corrupts registers: 268 ; BX, DX 269 ;-------------------------------------------------------------------- 270 ALIGN JUMP_ALIGN 271 .GetNumberOfPagesToFlashToAX: 272 eMOVZX bx, BYTE [si+FLASHVARS.bEepromType] 273 mov ax, [cs:bx+g_rgwEepromTypeToSizeInWords] 274 xor dx, dx 275 shl ax, 1 ; Size in bytes to... 276 rcl dx, 1 ; ...DX:AX 277 278 cmp WORD [si+FLASHVARS.wEepromPageSize], BYTE 1 279 jbe SHORT .PreventDivideException 280 div WORD [si+FLASHVARS.wEepromPageSize] 281 .PreventDivideException: 282 ret 283 284 285 ;-------------------------------------------------------------------- 286 ; .DisplayFlashingResultsFromFlashvarsInDSBX 287 ; Parameters: 288 ; DS:BX: Ptr to FLASHVARS 289 ; SS:BP: Ptr to MENU 290 ; Returns: 291 ; Nothing 292 ; Corrupts registers: 293 ; AX, BX, DX 294 ;-------------------------------------------------------------------- 295 ALIGN JUMP_ALIGN 296 .DisplayFlashingResultsFromFlashvarsInDSBX: 297 eMOVZX bx, BYTE [bx+FLASHVARS.flashResult] 298 jmp [cs:bx+.rgfnFlashResultMessage] 299 300 ALIGN WORD_ALIGN 301 .rgfnFlashResultMessage: 302 dw .DisplayFlashSuccessful 303 dw .DisplayPollingError 304 dw .DisplayDataVerifyError 305 306 307 ;-------------------------------------------------------------------- 308 ; .DisplayPollingError 309 ; .DisplayDataVerifyError 310 ; .DisplayFlashSuccessful 311 ; Parameters: 312 ; SS:BP: Ptr to MENU 313 ; Returns: 314 ; Nothing 315 ; Corrupts registers: 316 ; AX, DX, DI, ES 317 ;-------------------------------------------------------------------- 318 ALIGN JUMP_ALIGN 319 .DisplayPollingError: 320 mov dx, g_szErrEepromPolling 321 jmp Dialogs_DisplayErrorFromCSDX 322 323 ALIGN JUMP_ALIGN 324 .DisplayDataVerifyError: 325 mov dx, g_szErrEepromVerify 326 jmp Dialogs_DisplayErrorFromCSDX 327 328 ALIGN JUMP_ALIGN 329 .DisplayFlashSuccessful: 330 call Buffers_GetFileBufferToESDI 331 cmp WORD [es:di+ROMVARS.wRomSign], 0AA55h ; PC ROM? 332 je SHORT .DisplayRebootMessageAndReboot 333 mov dx, g_szForeignFlash 334 jmp Dialogs_DisplayNotificationFromCSDX 335 ALIGN JUMP_ALIGN 336 .DisplayRebootMessageAndReboot: 337 mov dx, g_szPCFlashSuccessfull 338 call Dialogs_DisplayNotificationFromCSDX 339 ; Fall to .RebootComputer 340 341 342 ;-------------------------------------------------------------------- 343 ; .RebootComputer 344 ; Parameters: 345 ; Nothing 346 ; Returns: 347 ; Nothing, function never returns 348 ; Corrupts registers: 349 ; Doesn't matter 350 ;-------------------------------------------------------------------- 351 .RebootComputer: 352 mov al, 0FEh ; System reset (AT+ keyboard controller) 353 out 64h, al ; Reset computer (AT+) 354 nop 355 jmp WORD 0F000h:0FFF0h ; XT reset
Note:
See TracChangeset
for help on using the changeset viewer.