Changeset 242 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages
- Timestamp:
- Feb 10, 2012, 3:12:40 AM (13 years ago)
- google:author:
- krille_n_@hotmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm
r233 r242 98 98 at MENUITEM.szHelp, dw g_szHelpIdeSerialCOM 99 99 at MENUITEM.bFlags, db FLG_MENUITEM_MODIFY_MENU | FLG_MENUITEM_BYTEVALUE | FLG_MENUITEM_CHOICESTRINGS 100 at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE 100 at MENUITEM.bType, db TYPE_MENUITEM_MULTICHOICE 101 101 at MENUITEM.itemValue + ITEM_VALUE.wRomvarsValueOffset, dw NULL 102 102 at MENUITEM.itemValue + ITEM_VALUE.szDialogTitle, dw g_szDlgDevice … … 122 122 at MENUITEM.itemValue + ITEM_VALUE.fnValueReader, dw IdeControllerMenu_SerialReadPort 123 123 at MENUITEM.itemValue + ITEM_VALUE.fnValueWriter, dw IdeControllerMenu_SerialWritePort 124 iend 125 126 g_MenuitemIdeControllerSerialBaud: 124 iend 125 126 g_MenuitemIdeControllerSerialBaud: 127 127 istruc MENUITEM 128 128 at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI … … 139 139 at MENUITEM.itemValue + ITEM_VALUE.rgszChoiceToStringLookup, dw g_rgszChoiceToStringLookupForBaud 140 140 iend 141 141 142 142 g_MenuitemIdeControllerEnableInterrupt: 143 143 istruc MENUITEM … … 200 200 dw 'C' 201 201 dw 'x' ; must be last entry (see reader/write routines) 202 g_rgszChoiceToStringLookupForCOM: 202 g_rgszChoiceToStringLookupForCOM: 203 203 dw g_szValueCfgCOM1 204 204 dw g_szValueCfgCOM2 … … 220 220 PackedCOMPortAddresses: ; COM1 - COMC (or COM12) 221 221 db DEVICE_SERIAL_COM1 >> 2 222 db DEVICE_SERIAL_COM2 >> 2 223 db DEVICE_SERIAL_COM3 >> 2 224 db DEVICE_SERIAL_COM4 >> 2 225 db DEVICE_SERIAL_COM5 >> 2 226 db DEVICE_SERIAL_COM6 >> 2 227 db DEVICE_SERIAL_COM7 >> 2 228 db DEVICE_SERIAL_COM8 >> 2 229 db DEVICE_SERIAL_COM9 >> 2 230 db DEVICE_SERIAL_COMA >> 2 231 db DEVICE_SERIAL_COMB >> 2 222 db DEVICE_SERIAL_COM2 >> 2 223 db DEVICE_SERIAL_COM3 >> 2 224 db DEVICE_SERIAL_COM4 >> 2 225 db DEVICE_SERIAL_COM5 >> 2 226 db DEVICE_SERIAL_COM6 >> 2 227 db DEVICE_SERIAL_COM7 >> 2 228 db DEVICE_SERIAL_COM8 >> 2 229 db DEVICE_SERIAL_COM9 >> 2 230 db DEVICE_SERIAL_COMA >> 2 231 db DEVICE_SERIAL_COMB >> 2 232 232 db DEVICE_SERIAL_COMC >> 2 233 233 db DEVICE_SERIAL_DEFAULT_CUSTOM_PORT >> 2 ; must be last entry (see reader/writer routines) 234 234 DEVICE_SERIAL_DEFAULT_COM EQU '1' 235 235 236 236 g_rgbChoiceToValueLookupForBaud: 237 237 dw (115200 / 115200) & 0xff … … 280 280 lea ax, [bx+IDEVARS.wPort] 281 281 mov [cs:g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 282 283 lea ax, [bx+IDEVARS.bSerialPort] 282 283 lea ax, [bx+IDEVARS.bSerialPort] 284 284 mov [cs:g_MenuitemIdeControllerSerialPort+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 285 285 286 286 lea ax, [bx+IDEVARS.bSerialBaud] 287 287 mov [cs:g_MenuitemIdeControllerSerialBaud+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 288 288 289 289 lea ax, [bx+IDEVARS.wPortCtrl] 290 290 mov [cs:g_MenuitemIdeControllerControlBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 291 291 292 292 lea ax, [bx+IDEVARS.bSerialCOMPortChar] 293 mov [cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 293 mov [cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax 294 294 295 295 lea ax, [bx+IDEVARS.bIRQ] … … 374 374 mov bx, g_MenuitemIdeControllerSerialPort 375 375 call .DisableMenuitemFromCSBX 376 377 mov bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 376 377 mov bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 378 378 call Buffers_GetRomvarsValueToAXfromOffsetInBX 379 379 cmp al,DEVICE_SERIAL_PORT … … 386 386 call .EnableMenuitemFromCSBX 387 387 388 mov bx, [cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 388 mov bx, [cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 389 389 call Buffers_GetRomvarsValueToAXfromOffsetInBX 390 390 mov bx, g_MenuitemIdeControllerSerialPort … … 402 402 403 403 mov bx, g_MenuitemIdeControllerEnableInterrupt 404 call .EnableMenuitemFromCSBX 404 call .EnableMenuitemFromCSBX 405 405 406 406 ret 407 407 408 408 ;-------------------------------------------------------------------- 409 409 ; MENUITEM activation functions (.fnActivate) … … 431 431 ; 432 432 push bx 433 mov bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 433 mov bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset] 434 434 call Buffers_GetRomvarsValueToAXfromOffsetInBX 435 435 mov bx, g_MenuitemMasterSlaveBlockModeTransfers … … 438 438 or BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE 439 439 jmp .isDone 440 .isSerial: 440 .isSerial: 441 441 and BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE 442 442 .isDone: 443 443 pop bx 444 444 445 445 call MasterSlaveMenu_InitializeToDrvparamsOffsetInBX 446 446 jmp MasterSlaveMenu_EnterMenuOrModifyItemVisibility … … 453 453 ; we need to take care to properly read/write just the bits we need. In addition, since 454 454 ; we use the Port/PortCtrl bytes in a special way for serial drives, we need to properly 455 ; default the values stored in both these words when switching in and out of the Serial455 ; default the values stored in both these words when switching in and out of the Serial 456 456 ; device choice. 457 457 ; … … 479 479 ; 480 480 ; No change to Device byte, but use this opportunity to change defaults stored in wPort and wPortCtrl if we are 481 ; changing in/out of a Serial device (since we use these bytes in radically different ways). Also clear the 482 ; interrupt informtion is we are moving into Serial (since the serial device does not use interrupts). 481 ; changing in/out of a Serial device (since we use these bytes in radically different ways). 483 482 ; 484 483 ALIGN JUMP_ALIGN … … 489 488 490 489 mov bl,[es:di] ; what is the current Device? 491 490 492 491 add di,IDEVARS.wPort - IDEVARS.bDevice ; Get ready to set the Port addresses 493 492 494 493 cmp al,DEVICE_SERIAL_PORT 495 494 jz .changingToSerial … … 500 499 .changingFromSerial: 501 500 cmp al,DEVICE_16BIT_ATA 502 jl .xtide 501 502 mov ax,DEVICE_XTIDE_DEFAULT_PORT ; Defaults for 8-bit XTIDE devices 503 mov bx,DEVICE_XTIDE_DEFAULT_PORTCTRL 504 505 jb .writeNonSerial 503 506 504 507 mov ax,DEVICE_ATA_DEFAULT_PORT ; Defaults for 16-bit and better ATA devices 505 508 mov bx,DEVICE_ATA_DEFAULT_PORTCTRL 506 jmp .writeNonSerial 507 508 .xtide: 509 mov ax,DEVICE_XTIDE_DEFAULT_PORT ; Defaults for 8-bit XTIDE devices 510 mov bx,DEVICE_XTIDE_DEFAULT_PORTCTRL 511 512 .writeNonSerial: 513 mov [es:di],ax ; Store defaults in IDEVARS.wPort and IDEVARS.wPortCtrl 514 mov [es:di+2],bx 509 510 .writeNonSerial: 511 stosw ; Store defaults in IDEVARS.wPort and IDEVARS.wPortCtrl 512 xchg bx, ax 513 stosw 515 514 516 515 jmp .done 517 516 518 .changingToSerial: 517 .changingToSerial: 519 518 cmp bl,DEVICE_SERIAL_PORT 520 519 jz .done ; if we were already serial, nothing to do … … 525 524 add di,IDEVARS.bSerialCOMPortChar-IDEVARS.wPort 526 525 call IdeControllerMenu_SerialWriteCOM 527 mov [es:di],al528 529 .done: 526 stosb 527 528 .done: 530 529 pop di 531 530 pop bx … … 536 535 ; 537 536 ; Doesn't modify COM character (unless it is not recognized, which would be an error case), 538 ; But does update the port address based on COM port selection 539 ; 537 ; But does update the port address based on COM port selection 538 ; 540 539 ALIGN JUMP_ALIGN 541 540 IdeControllerMenu_SerialWriteCOM: … … 543 542 push bx 544 543 push si 545 544 546 545 mov si,g_rgbChoiceToValueLookupForCOM 547 546 mov bx,PackedCOMPortAddresses … … 552 551 cmp ah,(DEVICE_SERIAL_DEFAULT_CUSTOM_PORT >> 2) 553 552 jz .notFound 554 553 555 554 cmp al,[si] 556 555 jz .found 557 556 558 557 inc si 559 558 inc si 560 559 inc bx 561 560 562 561 jmp .loop 563 562 564 563 .notFound: 565 564 mov al, 'x' 566 567 .found: 565 566 .found: 568 567 mov [es:di+IDEVARS.bSerialPort-IDEVARS.bSerialCOMPortChar], ah 569 568 … … 571 570 pop bx 572 571 pop ax 573 572 574 573 ret 575 574 576 575 577 576 ; 578 577 ; Packed Port (byte) -> Numeric Port (word) 579 ; 578 ; 580 579 ALIGN JUMP_ALIGN 581 580 IdeControllerMenu_SerialReadPort: 582 581 xor ah,ah 583 shl ax,1 584 shl ax,1 582 eSHL_IM ax, 2 585 583 ret 586 584 … … 590 588 ; 591 589 ALIGN JUMP_ALIGN 592 IdeControllerMenu_SerialWritePort: 590 IdeControllerMenu_SerialWritePort: 593 591 push bx 594 592 push si 595 593 596 shr ax,1 597 shr ax,1 594 eSHR_IM ax, 2 598 595 and al,0feh ; force 8-byte boundary 599 596 600 mov si,g_rgbChoiceToValueLookupForCOM 597 mov si,g_rgbChoiceToValueLookupForCOM 601 598 mov bx,PackedCOMPortAddresses ; loop, looking for port address in known COM address list 602 599 … … 605 602 cmp ah,'x' 606 603 jz .found 607 604 608 605 cmp al,[bx] 609 606 jz .found 610 607 611 608 inc si 612 609 inc si 613 610 inc bx 614 611 615 612 jmp .loop 616 613 617 .found: 614 .found: 618 615 mov [es:di+IDEVARS.bSerialCOMPortChar-IDEVARS.bSerialPort], ah 619 616 … … 623 620 ret 624 621 625 626 627 628 629 630
Note:
See TracChangeset
for help on using the changeset viewer.