Changeset 592 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages
- Timestamp:
- Jun 25, 2018, 10:29:27 PM (6 years ago)
- Location:
- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm
r580 r592 1 1 ; Project name : XTIDE Universal BIOS Configurator v2 2 ; Description : "Boot Menu Settings" menu structs and functions.2 ; Description : "Boot settings" menu structs and functions. 3 3 4 4 ; … … 26 26 at MENUPAGE.fnEnter, dw BootMenuSettingsMenu_EnterMenuOrModifyItemVisibility 27 27 at MENUPAGE.fnBack, dw ConfigurationMenu_EnterMenuOrModifyItemVisibility 28 at MENUPAGE.wMenuitems, dw 628 at MENUPAGE.wMenuitems, dw 7 29 29 iend 30 30 … … 55 55 iend 56 56 57 g_MenuitemBootMnuStngsColorTheme: 58 istruc MENUITEM 59 at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI 60 at MENUITEM.fnFormatValue, dw MenuitemPrint_WriteLookupValueStringToBufferInESDIfromUnshiftedItemInDSSI 61 at MENUITEM.szName, dw g_szItemColorTheme 62 at MENUITEM.szQuickInfo, dw g_szNfoColorTheme 63 at MENUITEM.szHelp, dw g_szHelpColorTheme 64 at MENUITEM.bFlags, db FLG_MENUITEM_VISIBLE | FLG_MENUITEM_MODIFY_MENU 65 at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE 66 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw ROMVARS.pColorTheme ; Only ever read - never modified 67 at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgColorTheme 68 at MENUITEM.itemValue + ITEM_VALUE.szMultichoice, dw g_szMultichoiceColorTheme 69 at MENUITEM.itemValue + ITEM_VALUE.rgwChoiceToValueLookup, dw NULL 70 at MENUITEM.itemValue + ITEM_VALUE.rgszValueToStringLookup, dw g_rgszValueToStringLookupForColorTheme 71 at MENUITEM.itemValue + ITEM_VALUE.fnValueReader, dw ReadColorTheme 72 at MENUITEM.itemValue + ITEM_VALUE.fnValueWriter, dw WriteColorTheme 73 iend 74 57 75 g_MenuitemBootMnuStngsFloppyDrives: 58 76 istruc MENUITEM … … 116 134 at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 1092 117 135 iend 118 119 120 g_rgwChoiceToValueLookupForEnableBootMenu:121 dw FALSE122 dw BOOT_MENU_DEFAULT_TIMEOUT123 136 124 137 g_rgwChoiceToValueLookupForDisplayModes: … … 146 159 dw g_szValueBootFloppyDrvs4 147 160 161 g_rgszValueToStringLookupForColorTheme: 162 dw g_szValueColorTheme0 163 dw g_szValueColorTheme1 164 dw g_szValueColorTheme2 165 dw g_szValueColorTheme3 166 dw g_szValueColorTheme4 167 dw g_szValueColorTheme5 168 169 ColorThemeTable: 170 ; Classic (default) 171 db COLOR_ATTRIBUTE(COLOR_YELLOW, COLOR_BLUE) ; .cBordersAndBackground 172 db COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK) ; .cShadow 173 db COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_BLUE) ; .cTitle 174 db COLOR_ATTRIBUTE(COLOR_WHITE, COLOR_BLUE) ; .cItem 175 db COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_CYAN) ; .cHighlightedItem 176 db COLOR_ATTRIBUTE(COLOR_RED, COLOR_BLUE) | FLG_COLOR_BLINK ; .cHurryTimeout 177 db COLOR_ATTRIBUTE(COLOR_GREEN, COLOR_BLUE) ; .cNormalTimeout 178 ; Argon Blue 179 db COLOR_ATTRIBUTE(COLOR_LIGHT_BLUE, COLOR_BLACK) ; .cBordersAndBackground 180 db COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK) ; .cShadow 181 db COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_BLACK) ; .cTitle 182 db COLOR_ATTRIBUTE(COLOR_WHITE, COLOR_BLACK) ; .cItem 183 db COLOR_ATTRIBUTE(COLOR_LIGHT_BLUE, COLOR_BLACK) ; .cHighlightedItem 184 db COLOR_ATTRIBUTE(COLOR_LIGHT_BLUE, COLOR_BLACK) | FLG_COLOR_BLINK ; .cHurryTimeout 185 db COLOR_ATTRIBUTE(COLOR_LIGHT_BLUE, COLOR_BLACK) ; .cNormalTimeout 186 ; Neon Red 187 db COLOR_ATTRIBUTE(COLOR_LIGHT_RED, COLOR_BLACK) ; .cBordersAndBackground 188 db COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK) ; .cShadow 189 db COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_BLACK) ; .cTitle 190 db COLOR_ATTRIBUTE(COLOR_WHITE, COLOR_BLACK) ; .cItem 191 db COLOR_ATTRIBUTE(COLOR_LIGHT_RED, COLOR_BLACK) ; .cHighlightedItem 192 db COLOR_ATTRIBUTE(COLOR_LIGHT_RED, COLOR_BLACK) | FLG_COLOR_BLINK ; .cHurryTimeout 193 db COLOR_ATTRIBUTE(COLOR_LIGHT_RED, COLOR_BLACK) ; .cNormalTimeout 194 ; Phosphor Green 195 db COLOR_ATTRIBUTE(COLOR_LIGHT_GREEN, COLOR_BLACK) ; .cBordersAndBackground 196 db COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK) ; .cShadow 197 db COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_BLACK) ; .cTitle 198 db COLOR_ATTRIBUTE(COLOR_WHITE, COLOR_BLACK) ; .cItem 199 db COLOR_ATTRIBUTE(COLOR_LIGHT_GREEN, COLOR_BLACK) ; .cHighlightedItem 200 db COLOR_ATTRIBUTE(COLOR_LIGHT_GREEN, COLOR_BLACK) | FLG_COLOR_BLINK ; .cHurryTimeout 201 db COLOR_ATTRIBUTE(COLOR_LIGHT_GREEN, COLOR_BLACK) ; .cNormalTimeout 202 ; Moon Surface 203 db COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK) ; .cBordersAndBackground 204 db COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK) ; .cShadow 205 db COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_BLACK) ; .cTitle 206 db COLOR_ATTRIBUTE(COLOR_WHITE, COLOR_BLACK) ; .cItem 207 db COLOR_ATTRIBUTE(COLOR_BROWN, COLOR_BLACK) ; .cHighlightedItem 208 db COLOR_ATTRIBUTE(COLOR_BRIGHT_WHITE, COLOR_BLACK) | FLG_COLOR_BLINK ; .cHurryTimeout 209 db COLOR_ATTRIBUTE(COLOR_WHITE, COLOR_BLACK) ; .cNormalTimeout 210 ; Toxic Waste 211 db COLOR_ATTRIBUTE(COLOR_LIGHT_GREEN, COLOR_BLACK) ; .cBordersAndBackground 212 db COLOR_ATTRIBUTE(COLOR_GRAY, COLOR_BLACK) ; .cShadow 213 db COLOR_ATTRIBUTE(COLOR_LIGHT_GREEN, COLOR_BLACK) ; .cTitle 214 db COLOR_ATTRIBUTE(COLOR_LIGHT_CYAN, COLOR_BLACK) ; .cItem 215 db COLOR_ATTRIBUTE(COLOR_LIGHT_CYAN, COLOR_BLUE) ; .cHighlightedItem 216 db COLOR_ATTRIBUTE(COLOR_LIGHT_RED, COLOR_BLACK) | FLG_COLOR_BLINK ; .cHurryTimeout 217 db COLOR_ATTRIBUTE(COLOR_LIGHT_RED, COLOR_BLACK) ; .cNormalTimeout 218 EndOfColorThemeTable: 219 CountOfThemes equ (EndOfColorThemeTable-ColorThemeTable) / ATTRIBUTE_CHARS_size 220 148 221 149 222 ; Section containing code … … 166 239 call .EnableOrDisableScanForSerialDrives 167 240 call .EnableOrDisableDefaultBootDrive 241 call .EnableOrDisableColorThemeSelection 168 242 call .EnableOrDisableBootMenuSelectionTimeout 169 243 mov si, g_MenupageForBootMenuSettingsMenu … … 202 276 mov bx, g_MenuitemBootMnuStngsDefaultBootDrive 203 277 test ax, FLG_ROMVARS_MODULE_HOTKEYS | FLG_ROMVARS_MODULE_BOOT_MENU 278 jmp SHORT .DisableMenuitemFromCSBXifZFset 279 280 281 ;-------------------------------------------------------------------- 282 ; .EnableOrDisableColorThemeSelection 283 ; Parameters: 284 ; AX: ROMVARS.wFlags 285 ; SS:BP: Menu handle 286 ; Returns: 287 ; Nothing 288 ; Corrupts registers: 289 ; BX 290 ;-------------------------------------------------------------------- 291 ALIGN JUMP_ALIGN 292 .EnableOrDisableColorThemeSelection: 293 mov bx, g_MenuitemBootMnuStngsColorTheme 294 test ax, FLG_ROMVARS_MODULE_BOOT_MENU 204 295 jmp SHORT .DisableMenuitemFromCSBXifZFset 205 296 … … 244 335 245 336 ;-------------------------------------------------------------------- 246 ; MENUITEM value reader functions 247 ; Parameters: 248 ; AX: Value from MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset 249 ; DS:SI: Ptr to MENUITEM 250 ; ES:DI: Ptr to value variable 251 ; Returns: 252 ; AX: Value with possible modifications 253 ; Corrupts registers: 254 ; Nothing 255 ;-------------------------------------------------------------------- 256 ALIGN JUMP_ALIGN 257 ValueReaderForEnableBootMenu: 258 test ax, ax 259 jz SHORT .NoNeedToModify 260 mov ax, TRUE<<1 261 .NoNeedToModify: 337 ; ReadColorTheme 338 ; Parameters: 339 ; AX: Value read from the ROMVARS location 340 ; ES:DI: ROMVARS location where the value was just read from 341 ; DS:SI: MENUITEM pointer 342 ; Returns: 343 ; AX: Value that the MENUITEM system will interact with and display 344 ; Corrupts registers: 345 ; BX, DI, ES 346 ;-------------------------------------------------------------------- 347 ALIGN JUMP_ALIGN 348 ReadColorTheme: 349 push ds 350 351 push es ; ES -> DS 352 pop ds 353 push cs ; CS -> ES 354 pop es 355 356 mov di, EndOfColorThemeTable-1 ; ES:DI now points to the end of the last theme in the table of available themes in XTIDECFG 357 xor bx, bx 358 359 push si 360 push cx 361 mov cx, CountOfThemes 362 std 363 .NextTheme: 364 push cx 365 mov cl, ATTRIBUTE_CHARS_size 366 mov si, ax ; [ROMVARS.pColorTheme] to SI 367 dec si 368 add si, cx ; DS:SI now points to the end of the ColorTheme in the loaded BIOS 369 sub di, bx ; Update the pointer to the end of the next theme in the table 370 371 ; We verify that the theme in the loaded BIOS exists in our table. If it doesn't exist then that most likely means 372 ; the loaded BIOS doesn't contain MODULE_BOOT_MENU and the theme actually isn't a theme - it's code. Either way, 373 ; we don't trust it enough to copy it over as corrupt/invalid settings could render the UI in XTIDECFG unreadable. 374 repe cmpsb 375 mov bx, cx 376 pop cx 377 loopne .NextTheme 378 cld 379 mov ax, cx 380 jne SHORT .SkipCopy 381 382 ; Copy the color theme fron the loaded BIOS overwriting XTIDECFG's own theme 383 inc si 384 mov di, ColorTheme ; ES:DI now points to ColorTheme in XTIDECFG 385 386 mov cl, ATTRIBUTE_CHARS_size 387 call Memory_CopyCXbytesFromDSSItoESDI 388 389 .SkipCopy: 390 pop cx 391 pop si 392 pop ds 262 393 ret 394 395 396 ;-------------------------------------------------------------------- 397 ; WriteColorTheme 398 ; Parameters: 399 ; AX: Value that the MENUITEM system was interacting with 400 ; ES:DI: ROMVARS location where the value is to be stored 401 ; DS:SI: MENUITEM pointer 402 ; Returns: 403 ; AX: Value to actually write to ROMVARS 404 ; Corrupts registers: 405 ; Nothing 406 ;-------------------------------------------------------------------- 407 ALIGN JUMP_ALIGN 408 WriteColorTheme: 409 push cx 410 push si 411 push di 412 413 mov cx, ATTRIBUTE_CHARS_size 414 mul cl ; Multiply with the menu choice index 415 mov si, ColorThemeTable 416 add si, ax 417 mov ax, [es:di] ; Fetch the ptr to ColorTheme 418 mov di, ax 419 420 call Memory_CopyCXbytesFromDSSItoESDI 421 422 pop di 423 pop si 424 pop cx 425 ret 426 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/ConfigurationMenu.asm
r589 r592 245 245 ; Nothing 246 246 ; Corrupts registers: 247 ; BX , DI, ES247 ; BX 248 248 ;-------------------------------------------------------------------- 249 249 ALIGN JUMP_ALIGN … … 262 262 ; Nothing 263 263 ; Corrupts registers: 264 ; AX, BX , CX264 ; AX, BX 265 265 ;-------------------------------------------------------------------- 266 266 ALIGN JUMP_ALIGN … … 268 268 call Buffers_GetRomvarsFlagsToAX 269 269 mov bx, g_MenuitemConfigurationKiBtoStealFromRAM 270 test a x, FLG_ROMVARS_FULLMODE270 test al, FLG_ROMVARS_FULLMODE 271 271 jz SHORT .DisableMenuitemFromCSBX 272 272 jmp SHORT .EnableMenuitemFromCSBX … … 319 319 ; All, except segments 320 320 ;-------------------------------------------------------------------- 321 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 322 %if (ROMVARS.ideVars0 | ROMVARS.ideVars1 | ROMVARS.ideVars2 | ROMVARS.ideVars3) & 0FF00h = 0 323 PrimaryIdeController: 324 mov bl, ROMVARS.ideVars0 & 0FFh 325 SKIP2B f 326 SecondaryIdeController: 327 mov bl, ROMVARS.ideVars1 & 0FFh 328 SKIP2B f 329 TertiaryIdeController: 330 mov bl, ROMVARS.ideVars2 & 0FFh 331 SKIP2B f 332 QuaternaryIdeController: 333 mov bl, ROMVARS.ideVars3 & 0FFh 334 xor bh, bh 335 ; Fall to DisplayIdeControllerMenu 336 %else 321 337 ALIGN JUMP_ALIGN 322 338 PrimaryIdeController: … … 338 354 mov bx, ROMVARS.ideVars3 339 355 ; Fall to DisplayIdeControllerMenu 356 %endif 357 %endif 340 358 341 359 ALIGN JUMP_ALIGN … … 383 401 ; Nothing 384 402 ; Corrupts registers: 385 ; A ll403 ; AX, BX, CX, DX 386 404 ;---------------------------------------------------------------------- 387 405 ConfigurationMenu_CheckAndMoveSerialDrivesToBottom: … … 428 446 ; move serial to end of list, others up 429 447 ; 448 %ifdef CLD_NEEDED 430 449 cld 431 450 %endif 432 451 mov ax, di ; save end pointer of list after scan 433 434 452 sub sp, IDEVARS_size ; copy serial to temporary space on stack 435 436 453 mov di, sp 437 454 … … 439 456 pop es 440 457 458 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 441 459 %if IDEVARS_size & 1 442 460 mov cl, IDEVARS_size … … 446 464 rep movsw 447 465 %endif 466 %endif 448 467 449 468 lea di, [si-IDEVARS_size] ; move up all the idevars below the serial, by one slot 450 451 469 mov cx, ax ; restore end pointer of list, subtract off end of serial idevars 452 470 sub cx, si … … 462 480 ; di is already at last IDEVARS position 463 481 482 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 464 483 %if IDEVARS_size & 1 465 484 mov cl, IDEVARS_size … … 469 488 rep movsw 470 489 %endif 490 %endif 471 491 472 492 add sp, IDEVARS_size … … 476 496 477 497 mov dh, 1 ; set flag that we have done a relocation 478 479 498 jmp SHORT .outerLoop 480 499 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm
r589 r592 185 185 pop ds 186 186 187 cmp WORD [ cs:g_cfgVars+CFGVARS.wEepromSegment], 0188 jne .alreadySet187 cmp WORD [g_cfgVars+CFGVARS.wEepromSegment], 0 188 jne SHORT .AlreadySet 189 189 190 190 push es 191 191 push di 192 192 call EEPROM_FindXtideUniversalBiosROMtoESDI 193 push es 194 pop ax 193 mov ax, es 195 194 pop di 196 195 pop es 197 j c .storeEepromSegment196 jnc SHORT .StoreEepromSegment 198 197 mov ax, DEFAULT_EEPROM_SEGMENT 199 .storeEepromSegment: 200 mov WORD [cs:g_cfgVars+CFGVARS.wEepromSegment], ax 201 202 .alreadySet: 203 198 .StoreEepromSegment: 199 mov [g_cfgVars+CFGVARS.wEepromSegment], ax 200 201 .AlreadySet: 204 202 mov si, g_MenupageForFlashMenu 205 203 jmp Menupage_ChangeToNewMenupageInDSSI … … 256 254 ALIGN JUMP_ALIGN, ret 257 255 .ImageFitsInSelectedEeprom: 256 .DoNotGenerateChecksumByte: 258 257 ret 259 258 … … 271 270 call EEPROM_LoadFromRomToRamComparisonBuffer 272 271 call Buffers_AppendZeroesIfNeeded 273 test WORD[cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_CHECKSUM272 test BYTE [cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_CHECKSUM 274 273 jz SHORT .DoNotGenerateChecksumByte 275 274 jmp Buffers_GenerateChecksum 276 .DoNotGenerateChecksumByte:277 ret278 275 279 276 ;-------------------------------------------------------------------- … … 349 346 .GetSelectedEepromSizeInWordsToAX: 350 347 eMOVZX bx, [cs:g_cfgVars+CFGVARS.bEepromType] 351 mov ax, [cs:bx+g_rgwEepromTypeToSizeInWords] 348 ;%if g_rgwEepromTypeToSizeInWords = 0 ; *FIXME* It really is but NASM won't accept this. 349 mov ax, [cs:bx] 350 ;%else 351 ; mov ax, [cs:bx+g_rgwEepromTypeToSizeInWords] 352 ;%endif 352 353 ret 353 354 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm
r589 r592 135 135 at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgIdeCmdPort 136 136 at MENUITEM.itemValue + ITEM_VALUE.wMinValue, dw 8h 137 at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 3 f8h137 at MENUITEM.itemValue + ITEM_VALUE.wMaxValue, dw 3F8h 138 138 at MENUITEM.itemValue + ITEM_VALUE.fnValueReader, dw IdeControllerMenu_SerialReadPort 139 139 at MENUITEM.itemValue + ITEM_VALUE.fnValueWriter, dw IdeControllerMenu_SerialWritePort … … 306 306 mov [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 307 307 308 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 309 %if IDEVARS.wBasePort = 0 310 mov [cs:g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], bx 311 %else 308 312 lea ax, [bx+IDEVARS.wBasePort] 309 313 mov [cs:g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 310 314 %endif 315 316 %if IDEVARS.bSerialPort = 0 317 mov [cs:g_MenuitemIdeControllerSerialPort+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], bx 318 %else 311 319 lea ax, [bx+IDEVARS.bSerialPort] 312 320 mov [cs:g_MenuitemIdeControllerSerialPort+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 321 %endif 322 %endif 313 323 314 324 lea ax, [bx+IDEVARS.bSerialBaud] … … 361 371 ALIGN JUMP_ALIGN 362 372 .EnableOrDisableCommandBlockPort: 363 mov bx, [ cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]373 mov bx, [g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 364 374 call Buffers_GetRomvarsValueToAXfromOffsetInBX 365 375 mov bx, g_MenuitemIdeControllerCommandBlockAddress … … 380 390 ALIGN JUMP_ALIGN 381 391 .EnableOrDisableControlBlockPort: 382 mov bx, [ cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]392 mov bx, [g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 383 393 call Buffers_GetRomvarsValueToAXfromOffsetInBX 384 394 mov bx, g_MenuitemIdeControllerControlBlockAddress … … 404 414 jz SHORT .DisableMenuitemFromCSBX 405 415 406 mov bx, [ cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]416 mov bx, [g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 407 417 call Buffers_GetRomvarsValueToAXfromOffsetInBX 408 418 mov bx, g_MenuitemIdeControllerEnableInterrupt … … 424 434 ALIGN JUMP_ALIGN 425 435 .EnableOrDisableIRQchannelSelection: 426 mov bx, [ cs:g_MenuitemIdeControllerEnableInterrupt+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]436 mov bx, [g_MenuitemIdeControllerEnableInterrupt+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 427 437 call Buffers_GetRomvarsValueToAXfromOffsetInBX 428 438 mov bx, g_MenuitemIdeControllerIdeIRQ … … 453 463 454 464 465 ;-------------------------------------------------------------------- 466 ; .EnableOrDisableSerial 467 ; Parameters: 468 ; SS:BP: Menu handle 469 ; Returns: 470 ; Nothing 471 ; Corrupts registers: 472 ; AX, BX 473 ;-------------------------------------------------------------------- 455 474 .EnableOrDisableSerial: 456 475 mov bx, g_MenuitemIdeControllerSerialBaud … … 463 482 call DisableMenuitemFromCSBX 464 483 465 mov bx, [ cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]484 mov bx, [g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 466 485 call Buffers_GetRomvarsValueToAXfromOffsetInBX 467 486 cmp al, DEVICE_SERIAL_PORT 468 jne .DisableAllSerial487 jne SHORT .DisableAllSerial 469 488 470 489 mov bx, g_MenuitemIdeControllerSerialCOM … … 474 493 call EnableMenuitemFromCSBX 475 494 476 mov bx, [ cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]495 mov bx, [g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 477 496 call Buffers_GetRomvarsValueToAXfromOffsetInBX 478 497 mov bx, g_MenuitemIdeControllerSerialPort … … 483 502 ret 484 503 504 485 505 ;-------------------------------------------------------------------- 486 506 ; MENUITEM activation functions (.fnActivate) … … 531 551 jmp MasterSlaveMenu_EnterMenuOrModifyItemVisibility 532 552 533 ;------------------------------------------------------------------------------------------ 534 ; 535 ; Reader/Writer Routines 536 ; 537 ; For serial drives, we pack the port number and baud rate into a single byte, and thus 538 ; we need to take care to properly read/write just the bits we need. In addition, since 539 ; we use the Port/PortCtrl bytes in a special way for serial drives, we need to properly 540 ; default the values stored in both these words when switching in and out of the Serial 541 ; device choice. 542 ; 543 ; Writers: 544 ; Parameters: 545 ; AX: Value that the MENUITEM system was interacting with 546 ; ES:DI: ROMVARS location where the value is to be stored 553 554 ;-------------------------------------------------------------------- 555 ; IdeControllerMenu_WriteDevice 556 ; 557 ; Sets default values to ports and other device dependent stuff 558 ; 559 ; Parameters: 560 ; AX: IDE controller/Device type menu choice index 561 ; ES:DI: Ptr to IDEVARS.bDevice 547 562 ; DS:SI: MENUITEM pointer 548 563 ; Returns: 549 ; AX: Value to actually write to ROMVARS 550 ; Corrupts registers: 551 ; AX 552 ; 553 ; Readers: 554 ; Parameters: 555 ; AX: Value read from the ROMVARS location 556 ; ES:DI: ROMVARS location where the value was just read from 557 ; DS:SI: MENUITEM pointer 558 ; Returns: 559 ; AX: Value that the MENUITEM system will interact with and display 560 ; Corrupts registers: 561 ; AX 562 ; 563 ALIGN JUMP_ALIGN 564 WriterForXTCFwindow: 565 xor al, al 566 SKIP2B f 567 ReaderForXTCFwindow: 568 xor ah, ah 569 xchg al, ah 570 ret 571 572 564 ; AX: IDE controller/Device type menu choice index 565 ; Corrupts registers: 566 ; BX, DX 567 ;-------------------------------------------------------------------- 573 568 ALIGN JUMP_ALIGN 574 569 IdeControllerMenu_WriteDevice: 575 push bx576 570 push di 577 571 push ax … … 581 575 582 576 ; Note! AL is the choice index, not device code 583 shl al, 1 ; Selection to device code 584 585 ; Restore ports and other stuff to default values 577 eSHL_IM al, 1 ; Selection to device code 586 578 jz SHORT .StandardIdeDevice ; DEVICE_16BIT_ATA 587 579 … … 603 595 div bl 604 596 mov bx, .rgbLowByteOfStdIdeInterfacePorts 605 xlat 597 xlat ; DS=CS so no segment override needed 606 598 mov ah, 1 ; DEVICE_ATA_*_PORT >> 8 607 599 mov bh, 3 ; DEVICE_ATA_*_PORTCTRL >> 8 … … 622 614 623 615 .SupportForDeviceNotAvailable: 624 push dx625 616 mov dx, g_szUnsupportedDevice 626 617 call Dialogs_DisplayErrorFromCSDX 627 pop dx628 618 629 619 ; Restore device type to the previous value … … 631 621 mov al, bl ; Previous device type to AL 632 622 shr al, 1 ; Device code to choice index 633 jmp SHORT .DoneWithNoChangeOfDevice 623 pop di 624 ret 634 625 635 626 .NotSerialDevice: … … 670 661 671 662 .ChangingToSerial: 672 cmp bl, DEVICE_SERIAL_PORT 673 je SHORT .Done ; if we were already serial, nothing to do 674 663 ; 664 ; For serial drives, we pack the port number and baud rate into a single byte, and thus 665 ; we need to take care to properly read/write just the bits we need. In addition, since 666 ; we use the Port/PortCtrl bytes in a special way for serial drives, we need to properly 667 ; default the values stored in both these words when switching in and out of the Serial 668 ; device choice. 669 ; 670 mov al, SERIAL_DEFAULT_COM 675 671 mov BYTE [es:di+IDEVARS.bSerialBaud-IDEVARS.wBasePort], SERIAL_DEFAULT_BAUD 676 mov BYTE [es:di+IDEVARS.bIRQ-IDEVARS.wBasePort], 0 ; Clear .bIRQ to keep the boot menu from printing it 677 678 mov al, SERIAL_DEFAULT_COM 672 mov [es:di+IDEVARS.bIRQ-IDEVARS.wBasePort], ah ; Clear .bIRQ to keep the boot menu from printing it 673 679 674 sub di, IDEVARS.wBasePort - IDEVARS.bSerialCOMPortChar 680 675 call IdeControllerMenu_SerialWriteCOM … … 683 678 .Done: 684 679 pop ax 685 .DoneWithNoChangeOfDevice: 686 pop di ; IDEVARS.bDevice 687 pop bx 680 pop di 688 681 ret 689 682 690 ; 691 ; Doesn't modify COM character (unless it is not recognized, which would be an error case), 692 ; But does update the port address based on COM port selection 693 ; 683 684 ;-------------------------------------------------------------------- 685 ; IdeControllerMenu_SerialWriteCOM 686 ; 687 ; Updates the port address based on COM port selection 688 ; 689 ; Parameters: 690 ; AL: COM port 691 ; ES:DI: Ptr to IDEVARS.bSerialCOMPortChar 692 ; DS:SI: MENUITEM pointer 693 ; Returns: 694 ; Nothing 695 ; Corrupts registers: 696 ; BX 697 ;-------------------------------------------------------------------- 694 698 ALIGN JUMP_ALIGN 695 699 IdeControllerMenu_SerialWriteCOM: 696 700 push ax 697 push bx698 701 push si 699 702 700 mov si, g_rgbChoiceToValueLookupForCOM 701 mov bx, PackedCOMPortAddresses 702 703 .loop: 704 mov ah, [bx] 705 706 cmp ah, (SERIAL_DEFAULT_CUSTOM_PORT >> 2) 707 je .notFound 708 709 cmp al, [si] 710 je .found 711 703 mov bx, PackedCOMPortAddresses - 1 704 mov si, g_rgbChoiceToValueLookupForCOM - 2 705 706 .Loop: 707 inc bx 712 708 inc si 713 709 inc si 714 inc bx 715 716 jmp .loop 717 718 .notFound: 719 mov al, 'x' 720 721 .found: 710 711 mov ah, [bx] 712 cmp ah, SERIAL_DEFAULT_CUSTOM_PORT >> 2 713 je SHORT .NotFound 714 715 cmp al, [si] 716 jne SHORT .Loop 717 718 .NotFound: 722 719 mov [es:di+IDEVARS.bSerialPort-IDEVARS.bSerialCOMPortChar], ah 723 720 724 721 pop si 725 pop bx726 722 pop ax 727 728 723 ret 729 724 730 725 726 ;-------------------------------------------------------------------- 727 ; IdeControllerMenu_SerialReadPort 731 728 ; 732 729 ; Packed Port (byte) -> Numeric Port (word) 733 730 ; 731 ; Parameters: 732 ; AX: Value read from the ROMVARS location 733 ; ES:DI: ROMVARS location where the value was just read from 734 ; DS:SI: MENUITEM pointer 735 ; Returns: 736 ; AX: Value that the MENUITEM system will interact with and display 737 ; Corrupts registers: 738 ; Nothing 739 ;-------------------------------------------------------------------- 734 740 ALIGN JUMP_ALIGN 735 741 IdeControllerMenu_SerialReadPort: … … 738 744 ret 739 745 746 747 ;-------------------------------------------------------------------- 748 ; IdeControllerMenu_SerialWritePort 740 749 ; 741 750 ; Numeric Port (word) -> Packed Port (byte) 742 ; And convert from Custom to a defined COM port if we match one of the pre-defined COM port numbers 743 ; 751 ; 752 ; And convert from Custom to a defined COM port if we 753 ; match one of the pre-defined COM port numbers 754 ; 755 ; Parameters: 756 ; AX: Value that the MENUITEM system was interacting with 757 ; ES:DI: ROMVARS location where the value is to be stored 758 ; DS:SI: MENUITEM pointer 759 ; Returns: 760 ; AX: Value to actually write to ROMVARS 761 ; Corrupts registers: 762 ; BX 763 ;-------------------------------------------------------------------- 744 764 ALIGN JUMP_ALIGN 745 765 IdeControllerMenu_SerialWritePort: 746 push bx747 766 push si 748 767 749 768 eSHR_IM ax, 2 750 and al, 0feh ; force 8-byte boundary 751 752 mov si, g_rgbChoiceToValueLookupForCOM 753 mov bx, PackedCOMPortAddresses ; loop, looking for port address in known COM address list 754 755 .loop: 756 mov ah, [si] 757 cmp ah, 'x' 758 je .found 759 760 cmp al, [bx] 761 je .found 762 769 and al, 0FEh ; Force 8-byte boundary 770 771 mov si, g_rgbChoiceToValueLookupForCOM - 2 772 mov bx, PackedCOMPortAddresses - 1 ; Loop, looking for port address in known COM address list 773 774 .Loop: 763 775 inc si 764 776 inc si 765 777 inc bx 766 778 767 jmp .loop 768 769 .found: 779 mov ah, [si] 780 cmp ah, 'x' 781 je SHORT .Found 782 783 cmp al, [bx] 784 jne SHORT .Loop 785 786 .Found: 770 787 mov [es:di+IDEVARS.bSerialCOMPortChar-IDEVARS.bSerialPort], ah 771 788 772 789 pop si 773 pop bx774 775 790 ret 776 791 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MainMenu.asm
r546 r592 155 155 .EnableOrDisableXtideRomItems: 156 156 call EEPROM_FindXtideUniversalBiosROMtoESDI 157 j nc SHORT .DisableAllRomItems157 jc SHORT .DisableAllRomItems 158 158 or BYTE [g_MenuitemMainMenuLoadXtideUniversalBiosFromRom+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE 159 159 call Buffers_IsXtideUniversalBiosLoaded … … 201 201 ALIGN JUMP_ALIGN 202 202 .EnableOrDisableFlashEeprom: 203 test WORD[g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED203 test BYTE [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED 204 204 jz SHORT .DisableFlashEeprom 205 205 or BYTE [g_MenuitemMainMenuFlashEeprom+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE … … 222 222 ALIGN JUMP_ALIGN 223 223 .EnableOrDisableSave: 224 test WORD[g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED224 test BYTE [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED 225 225 jz SHORT .DisableSave 226 226 or BYTE [g_MenuitemMainMenuSaveFile+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE … … 257 257 add si, BYTE FILE_DIALOG_IO.szFile 258 258 call BiosFile_LoadFileFromDSSItoRamBuffer 259 call LoadColorTheme 260 ; *FIXME* Will load themes even from unrecognized versions of the BIOS which isn't really a problem but still 'unexpected behaviour' and therefore a bug. 259 261 call MainMenu_EnterMenuOrModifyItemVisibility 260 262 .CancelFileLoading: … … 272 274 mov dx, g_szDlgMainLoadROM 273 275 call Dialogs_DisplayNotificationFromCSDX 276 call LoadColorTheme 274 277 jmp MainMenu_EnterMenuOrModifyItemVisibility 275 278 … … 281 284 call Buffers_SetUnsavedChanges 282 285 mov dx, g_szDlgMainLoadStngs 283 jmp Dialogs_DisplayNotificationFromCSDX 284 286 call Dialogs_DisplayNotificationFromCSDX 287 call EEPROM_FindXtideUniversalBiosROMtoESDI 288 call LoadColorTheme.FromROM 289 jmp MainMenu_EnterMenuOrModifyItemVisibility 290 291 292 ;-------------------------------------------------------------------- 293 ; LoadColorTheme 294 ; Parameters: 295 ; ES: ROMVARS segment (only when loading theme from ROM) 296 ; Returns: 297 ; Nothing 298 ; Corrupts registers: 299 ; AX, BX, DI, ES 300 ;-------------------------------------------------------------------- 301 ALIGN JUMP_ALIGN 302 LoadColorTheme: 303 call Buffers_GetFileBufferToESDI 304 .FromROM: 305 mov ax, [es:ROMVARS.pColorTheme] 306 jmp ReadColorTheme 307 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MasterSlaveMenu.asm
r583 r592 196 196 dw DISABLE_WRITE_CACHE 197 197 dw ENABLE_WRITE_CACHE 198 199 198 g_rgszChoiceToStringLookupForWriteCache: 200 199 dw g_szValueBootDispModeDefault … … 207 206 dw TRANSLATEMODE_ASSISTED_LBA 208 207 dw TRANSLATEMODE_AUTO 209 210 208 g_rgszChoiceToStringLookupForXlateMode: 211 209 dw g_szValueDrvXlateNormal … … 229 227 ALIGN JUMP_ALIGN 230 228 MasterSlaveMenu_InitializeToDrvparamsOffsetInBX: 229 push ds 230 231 push cs 232 pop ds 233 234 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 235 %if DRVPARAMS.wFlags = 0 236 mov ax, bx 237 %else 231 238 lea ax, [bx+DRVPARAMS.wFlags] 232 mov [cs:g_MenuitemMasterSlaveBlockModeTransfers+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 233 mov [cs:g_MenuitemMasterSlaveChsTranslateMode+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 234 mov [cs:g_MenuitemMasterSlaveWriteCache+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 235 mov [cs:g_MenuitemMasterSlaveUserCHS+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 236 mov [cs:g_MenuitemMasterSlaveUserLBA+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 239 %endif 240 %endif 241 mov [g_MenuitemMasterSlaveBlockModeTransfers+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 242 mov [g_MenuitemMasterSlaveChsTranslateMode+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 243 mov [g_MenuitemMasterSlaveWriteCache+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 244 mov [g_MenuitemMasterSlaveUserCHS+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 245 mov [g_MenuitemMasterSlaveUserLBA+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 237 246 238 247 lea ax, [bx+DRVPARAMS.wCylinders] 239 mov [ cs:g_MenuitemMasterSlaveCylinders+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax248 mov [g_MenuitemMasterSlaveCylinders+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 240 249 241 250 lea ax, [bx+DRVPARAMS.bHeads] 242 mov [ cs:g_MenuitemMasterSlaveHeads+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax251 mov [g_MenuitemMasterSlaveHeads+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 243 252 244 253 lea ax, [bx+DRVPARAMS.bSect] 245 mov [ cs:g_MenuitemMasterSlaveSectors+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax254 mov [g_MenuitemMasterSlaveSectors+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 246 255 247 256 lea ax, [bx+DRVPARAMS.dwMaximumLBA] 248 mov [cs:g_MenuitemMasterSlaveUserLbaValue+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 257 mov [g_MenuitemMasterSlaveUserLbaValue+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 258 259 pop ds 249 260 ret 250 261 … … 283 294 mov bx, [g_MenuitemMasterSlaveUserLBA+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 284 295 call Buffers_GetRomvarsValueToAXfromOffsetInBX 285 test a x, FLG_DRVPARAMS_USERLBA296 test al, FLG_DRVPARAMS_USERLBA 286 297 jnz SHORT .DisableCHSandEnableLBA 287 test a x, FLG_DRVPARAMS_USERCHS298 test al, FLG_DRVPARAMS_USERCHS 288 299 jnz SHORT .EnableCHSandDisableLBA 289 300 … … 320 331 ALIGN JUMP_ALIGN 321 332 .EnableOrDisableCHandS: 322 mov bx, [ cs:g_MenuitemMasterSlaveUserCHS+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]333 mov bx, [g_MenuitemMasterSlaveUserCHS+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 323 334 call Buffers_GetRomvarsValueToAXfromOffsetInBX 324 test a x, FLG_DRVPARAMS_USERCHS335 test al, FLG_DRVPARAMS_USERCHS 325 336 jz SHORT .DisableCHandS 326 test a x, FLG_DRVPARAMS_USERLBA337 test al, FLG_DRVPARAMS_USERLBA 327 338 jnz SHORT .DisableCHandS 328 339 … … 355 366 ALIGN JUMP_ALIGN 356 367 .EnableOrDisableUserLbaValue: 357 mov bx, [ cs:g_MenuitemMasterSlaveUserLBA+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]368 mov bx, [g_MenuitemMasterSlaveUserLBA+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 358 369 call Buffers_GetRomvarsValueToAXfromOffsetInBX 359 370 mov bx, g_MenuitemMasterSlaveUserLbaValue 360 test a x, FLG_DRVPARAMS_USERCHS371 test al, FLG_DRVPARAMS_USERCHS 361 372 jnz SHORT .DisableMenuitemFromCSBX 362 test a x, FLG_DRVPARAMS_USERLBA373 test al, FLG_DRVPARAMS_USERLBA 363 374 jz SHORT .DisableMenuitemFromCSBX 364 375 ; Fall to .EnableMenuitemFromCSBX … … 443 454 ALIGN JUMP_ALIGN 444 455 MasterSlaveMenu_WriteCHSFlag: 445 test word[es:di], FLG_DRVPARAMS_USERCHS446 jnz .alreadySet456 test BYTE [es:di], FLG_DRVPARAMS_USERCHS 457 jnz SHORT .AlreadySet 447 458 448 459 push ax … … 466 477 pop ax 467 478 468 . alreadySet:479 .AlreadySet: 469 480 ret 470 481 … … 475 486 ALIGN JUMP_ALIGN 476 487 MasterSlaveMenu_WriteLBAFlag: 477 test word[es:di], FLG_DRVPARAMS_USERLBA478 jnz .alreadySet488 test BYTE [es:di], FLG_DRVPARAMS_USERLBA 489 jnz SHORT .AlreadySet 479 490 480 491 push ax … … 490 501 pop ax 491 502 492 . alreadySet:503 .AlreadySet: 493 504 ret 505
Note:
See TracChangeset
for help on using the changeset viewer.