Changeset 567 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS_Configurator_v2


Ignore:
Timestamp:
May 26, 2014, 1:25:15 PM (10 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • Renamed MODULE_FEATURE_SETS to MODULE_POWER_MANAGEMENT.
  • Renamed MODULE_VERY_LATE_INITIALIZATION to MODULE_VERY_LATE_INIT and removed it from the official builds.
  • Removed the code that skips detection of slave drives on XT-CF controllers since slave drives can be used with Lo-tech ISA CompactFlash boards.
  • Added autodetection of the SVC ADP50L controller to XTIDECFG.
  • The autodetection of XT-CF controllers now requires MODULE_8BIT_IDE_ADVANCED in the loaded BIOS.
  • Fixed a bug in XTIDECFG from r502 where the "Base (cmd block) address" menu option would be displayed when a serial device was selected as the IDE controller.
  • XTIDECFG would display the "Enable interrupt" menu option for the XTIDE r1 but not for the XTIDE r2. It's now displayed for both controller types.
  • Disabled the "Internal Write Cache" menu option in the Master/Slave Drive menus for serial device type drives.
  • Optimizations and other fixes.
Location:
trunk/XTIDE_Universal_BIOS_Configurator_v2
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Inc/MenuStructs.inc

    r526 r567  
    4747FLG_MENUITEM_BYTEVALUE      EQU (1<<3)  ; Item value is single byte
    4848FLG_MENUITEM_PROGRAMVAR     EQU (1<<4)  ; Item is for configuring program, not BIOS
    49 FLG_MENUITEM_CHOICESTRINGS  EQU (1<<5)  ; ChoiceToStringLookup table is 1-1 with ChoiceToValueLookup table,
     49FLG_MENUITEM_CHOICESTRINGS  EQU (1<<5)  ; ChoiceToStringLookup table is 1-1 with ChoiceToValueLookup table,
    5050                                        ; ChoiceToStringLookup table must also be NULL terminated
    5151FLG_MENUITEM_MASKVALUE      EQU (1<<6)  ; Item value is more than one bit among other bits
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm

    r526 r567  
    4343;   Returns:
    4444;       ZF:     Set if supported version of XTIDE Universal BIOS is loaded
    45 ;               Cleared no file or some other file is loaded
     45;               Cleared if no file or some other file is loaded
    4646;   Corrupts registers:
    4747;       CX, SI, DI, ES
     
    5050Buffers_IsXtideUniversalBiosLoaded:
    5151    test    WORD [cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED
    52     jz      SHORT .NoFileOrBiosLoaded
    53 
    54     call    Buffers_GetFileBufferToESDI
    55     jmp     SHORT Buffers_IsXtideUniversalBiosSignatureInESDI
    56 .NoFileOrBiosLoaded:
     52    jnz     SHORT .FileOrBiosLoaded
    5753    or      cl, 1       ; Clear ZF
    5854    ret
    5955
     56.FileOrBiosLoaded:
     57    call    Buffers_GetFileBufferToESDI
     58    ; Fall to Buffers_IsXtideUniversalBiosSignatureInESDI
     59
    6060
    6161;--------------------------------------------------------------------
     
    6565;   Returns:
    6666;       ZF:     Set if supported version of XTIDE Universal BIOS is loaded
    67 ;               Cleared no file or some other file is loaded
     67;               Cleared if no file or some other file is loaded
    6868;   Corrupts registers:
    6969;       CX, SI
     
    183183    mov     cx, [cs:di+g_rgwEepromTypeToSizeInWords]
    184184    sub     cx, [cs:g_cfgVars+CFGVARS.wImageSizeInWords]    ; CX = WORDs to append
    185     jle     SHORT .NoNeedToAppendZeroes
     185    jbe     SHORT .NoNeedToAppendZeroes
    186186
    187187    call    Buffers_GetFileBufferToESDI
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/IdeAutodetect.asm

    r526 r567  
    3838;--------------------------------------------------------------------
    3939IdeAutodetect_DetectIdeDeviceFromPortDXAndReturnControlBlockInSI:
    40     cmp     dx, FIRST_MEMORY_SEGMENT_ADDRESS
     40    cmp     dh, FIRST_MEMORY_SEGMENT_ADDRESS >> 8
    4141    jb      SHORT DetectPortMappedDeviceFromPortDX
    4242    ; Fall to DetectMemoryMappedDeviceFromSegmentDX
     
    5555;--------------------------------------------------------------------
    5656DetectMemoryMappedDeviceFromSegmentDX:
    57     ; *** Try to detect JR-IDE/ISA (only if MODULE_8BIT_IDE_ADVANCED is present) ***
     57    ; *** Try to detect JR-IDE/ISA and ADP50L (only if MODULE_8BIT_IDE_ADVANCED is present) ***
    5858    test    WORD [di+ROMVARS.wFlags], FLG_ROMVARS_MODULE_8BIT_IDE_ADVANCED
    59     jz      SHORT NoIdeDeviceFound
     59    stc
     60    jz      SHORT .NoIdeDeviceFound
    6061
    6162    push    ds
    6263    mov     ds, dx
    63     cli                                 ; Disable Interrupts
     64
     65    cli
    6466    mov     ah, [JRIDE_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET + STATUS_REGISTER_in]
    6567    mov     al, [JRIDE_CONTROL_BLOCK_REGISTER_WINDOW_OFFSET + ALTERNATE_STATUS_REGISTER_in]
    66     sti                                 ; Enable Interrupts
     68    sti
     69    call    CompareIdeStatusRegistersFromALandAH
     70    mov     al, DEVICE_8BIT_JRIDE_ISA
     71    jnc     .IdeDeviceFound
     72
     73    cli
     74    mov     ah, [ADP50L_COMMAND_BLOCK_REGISTER_WINDOW_OFFSET + (STATUS_REGISTER_in << 1)]
     75    mov     al, [ADP50L_CONTROL_BLOCK_REGISTER_WINDOW_OFFSET + (ALTERNATE_STATUS_REGISTER_in << 1)]
     76    sti
     77    call    CompareIdeStatusRegistersFromALandAH
     78    mov     al, DEVICE_8BIT_ADP50L
     79
     80.IdeDeviceFound:
     81    mov     si, dx                      ; For IDEDTCT.COM
    6782    pop     ds
    68     call    CompareIdeStatusRegistersFromALandAH
    69     mov     al, DEVICE_8BIT_JRIDE_ISA   ; Assume CF was cleared
    70     mov     si, dx                      ; For IDEDTCT.COM
    71     ret                                 ; No need to return Control Block Port
     83.NoIdeDeviceFound:
     84    ret
    7285
    7386
     
    110123
    111124    ; Detect 8-bit devices only if MODULE_8BIT_IDE is available
    112     test    BYTE [di+ROMVARS.wFlags], FLG_ROMVARS_MODULE_8BIT_IDE
     125    test    BYTE [di+ROMVARS.wFlags], FLG_ROMVARS_MODULE_8BIT_IDE | FLG_ROMVARS_MODULE_8BIT_IDE_ADVANCED
    113126    jz      SHORT NoIdeDeviceFound
     127    jpo     SHORT .SkipXTCF             ; Only 1 bit set means no MODULE_8BIT_IDE_ADVANCED
    114128
    115129    ; *** Try to detect XT-CF ***
     
    120134    mov     al, DEVICE_8BIT_XTCF_PIO8
    121135    jnc     SHORT .IdeDeviceFound
    122 
     136    shr     bx, 1
     137.SkipXTCF:
    123138
    124139    ; *** Try to detect 8-bit XT-IDE rev 1 or rev 2 ***
     
    126141    ; Status Register addresses. That is why we need another step
    127142    ; to check is this XT-IDE rev 1 or rev 2.
    128     sub     si, BYTE XTCF_CONTROL_BLOCK_OFFSET >> 1
    129     shr     bx, 1
     143    mov     si, dx
     144    add     si, BYTE XTIDE_CONTROL_BLOCK_OFFSET
    130145    call    DetectIdeDeviceFromPortsDXandSIwithOffsetsInBLandBH
    131146    jc      SHORT NoIdeDeviceFound      ; No XT-IDE rev 1 or rev 2 found
     
    210225    test    al, FLG_STATUS_DRDY
    211226    jz      SHORT NoIdeDeviceFound  ; Device needs to be ready
    212     ret                                     ; Return with CF cleared
     227    ret                             ; Return with CF cleared
    213228
    214229NoIdeDeviceFound:
     
    305320    dw      3C0h
    306321    dw      3E0h
    307     ; JR-IDE/ISA (Memory Segment Addresses)
    308     dw      0C000h
    309     dw      0C400h
    310     dw      0C800h
    311     dw      0CC00h
    312     dw      0D000h
    313     dw      0D400h
    314     dw      0D800h
     322    ; Memory Segment Addresses
     323    dw      0C000h  ; JR-IDE/ISA
     324    dw      0C400h  ; JR-IDE/ISA
     325    dw      0C800h  ; JR-IDE/ISA and ADP50L
     326    dw      0CA00h  ; ADP50L
     327    dw      0CC00h  ; JR-IDE/ISA and ADP50L
     328    dw      0CE00h  ; ADP50L
     329    dw      0D000h  ; JR-IDE/ISA
     330    dw      0D400h  ; JR-IDE/ISA
     331    dw      0D800h  ; JR-IDE/ISA
    315332.wLastIdePort:
    316     dw      0DC00h
     333    dw      0DC00h  ; JR-IDE/ISA
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menuitem.asm

    r526 r567  
    389389    mov     di, g_cfgVars
    390390    ret
     391
     392
     393;--------------------------------------------------------------------
     394; EnableMenuitemFromCSBX
     395; DisableMenuitemFromCSBX
     396;   Parameters:
     397;       CS:BX:  Ptr to MENUITEM
     398;   Returns:
     399;       Nothing
     400;   Corrupts registers:
     401;       Nothing
     402;--------------------------------------------------------------------
     403ALIGN JUMP_ALIGN
     404EnableMenuitemFromCSBX:
     405    or      BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
     406    ret
     407
     408ALIGN JUMP_ALIGN
     409DisableMenuitemFromCSBX:
     410    and     BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
     411    ret
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm

    r526 r567  
    235235ALIGN JUMP_ALIGN
    236236.EnableMenuitemFromCSBX:
    237     or      BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
    238     ret
     237    jmp     EnableMenuitemFromCSBX
    239238
    240239ALIGN JUMP_ALIGN
    241240.DisableMenuitemFromCSBX:
    242     and     BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
    243     ret
     241    jmp     DisableMenuitemFromCSBX
    244242
    245243
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/ConfigurationMenu.asm

    r526 r567  
    217217.DisableAllIdeControllerMenuitems:
    218218    mov     cx, MAX_ALLOWED_IDE_CONTROLLERS-1
    219     mov     bx, g_MenuitemConfigurationSecondaryIdeController
    220 ALIGN JUMP_ALIGN
    221 .DisableNextIdeControllerMenuitem:
    222     call    .DisableMenuitemFromCSBX
    223     add     bx, BYTE MENUITEM_size
    224     loop    .DisableNextIdeControllerMenuitem
    225     ret
     219    mov     ax, DisableMenuitemFromCSBX
     220    jmp     SHORT .Go
    226221
    227222ALIGN JUMP_ALIGN
     
    230225    dec     cx          ; Primary always enabled
    231226    jz      SHORT .PrimaryControllerAlreadyEnabled
     227    mov     ax, EnableMenuitemFromCSBX
     228.Go:
    232229    mov     bx, g_MenuitemConfigurationSecondaryIdeController
    233230ALIGN JUMP_ALIGN
    234 .EnableNextIdeControllerMenuitem:
    235     call    .EnableMenuitemFromCSBX
     231.EnableOrDisableNextIdeControllerMenuitem:
     232    call    ax
    236233    add     bx, BYTE MENUITEM_size
    237     loop    .EnableNextIdeControllerMenuitem
     234    loop    .EnableOrDisableNextIdeControllerMenuitem
    238235.PrimaryControllerAlreadyEnabled:
    239236    ret
     
    288285    call    Buffers_GetRomvarsFlagsToAX
    289286    mov     bx, g_MenuitemConfigurationIdleTimeout
    290     test    ax, FLG_ROMVARS_MODULE_FEATURE_SETS
     287    test    ax, FLG_ROMVARS_MODULE_POWER_MANAGEMENT
    291288    jz      SHORT .DisableMenuitemFromCSBX
    292289    ; Fall to .EnableMenuitemFromCSBX
     
    305302ALIGN JUMP_ALIGN
    306303.EnableMenuitemFromCSBX:
    307     or      BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
    308     ret
     304    jmp     EnableMenuitemFromCSBX
    309305
    310306ALIGN JUMP_ALIGN
    311307.DisableMenuitemFromCSBX:
    312     and     BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
    313     ret
    314 
     308    jmp     DisableMenuitemFromCSBX
    315309
    316310
     
    419413    jnz     .next
    420414    mov     si, di
    421     jmp     .next
     415    SKIP2B  f
    422416
    423417.notSerial:
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm

    r546 r567  
    242242    dw  NULL
    243243
    244 SERIAL_DEFAULT_CUSTOM_PORT   EQU        300h           ; can't be any of the pre-defined COM values
    245 
    246 PackedCOMPortAddresses:             ; COM1 - COMC (or COM12)
    247     db      SERIAL_COM1_IOADDRESS >> 2
     244SERIAL_DEFAULT_CUSTOM_PORT      EQU     300h        ; can't be any of the pre-defined COM values
     245SERIAL_DEFAULT_COM              EQU     '1'
     246SERIAL_DEFAULT_BAUD             EQU     ((115200 / 9600)    & 0xff)
     247
     248PackedCOMPortAddresses:                             ; COM1 - COMC (or COM12)
     249    db      SERIAL_COM1_IOADDRESS >> 2
    248250    db      SERIAL_COM2_IOADDRESS >> 2
    249251    db      SERIAL_COM3_IOADDRESS >> 2
     
    258260    db      SERIAL_COMC_IOADDRESS >> 2
    259261    db      SERIAL_DEFAULT_CUSTOM_PORT >> 2         ; must be last entry (see reader/writer routines)
    260 SERIAL_DEFAULT_COM          EQU     '1'
    261262
    262263g_rgbChoiceToValueLookupForBaud:
     
    279280    dw      g_szValueCfgBaud2400
    280281    dw      NULL
    281 SERIAL_DEFAULT_BAUD         EQU     ((115200 / 9600)    & 0xff)
    282282
    283283; Section containing code
     
    339339    push    cs
    340340    pop     ds
     341    call    .EnableOrDisableCommandBlockPort
    341342    call    .EnableOrDisableControlBlockPort
    342343    call    .DisableIRQchannelSelection
     
    345346    mov     si, g_MenupageForIdeControllerMenu
    346347    jmp     Menupage_ChangeToNewMenupageInDSSI
     348
     349
     350;--------------------------------------------------------------------
     351; .EnableOrDisableCommandBlockPort
     352;   Parameters:
     353;       SS:BP:  Menu handle
     354;   Returns:
     355;       Nothing
     356;   Corrupts registers:
     357;       AX, BX
     358;--------------------------------------------------------------------
     359ALIGN JUMP_ALIGN
     360.EnableOrDisableCommandBlockPort:
     361    mov     bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
     362    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
     363    mov     bx, g_MenuitemIdeControllerCommandBlockAddress
     364    cmp     al, DEVICE_SERIAL_PORT
     365    je      SHORT .DisableMenuitemFromCSBX
     366    jmp     SHORT .EnableMenuitemFromCSBX
    347367
    348368
     
    385405    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
    386406    mov     bx, g_MenuitemIdeControllerEnableInterrupt
    387     cmp     al, DEVICE_8BIT_XTIDE_REV2
     407    cmp     al, DEVICE_8BIT_XTCF_PIO8
    388408    jae     SHORT .DisableMenuitemFromCSBX
    389409
    390     call    .EnableMenuitemFromCSBX
     410    call    EnableMenuitemFromCSBX
    391411    ; Fall to .EnableOrDisableIRQchannelSelection
    392412
     
    424444ALIGN JUMP_ALIGN
    425445.DisableMenuitemFromCSBX:
    426     and     BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
    427     ret
     446    jmp     DisableMenuitemFromCSBX
    428447
    429448ALIGN JUMP_ALIGN
    430449.EnableMenuitemFromCSBX:
    431     or      BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
    432     ret
     450    jmp     EnableMenuitemFromCSBX
    433451
    434452
    435453.EnableOrDisableSerial:
    436454    mov     bx, g_MenuitemIdeControllerSerialBaud
    437     call    .DisableMenuitemFromCSBX
     455    call    DisableMenuitemFromCSBX
    438456
    439457    mov     bx, g_MenuitemIdeControllerSerialCOM
    440     call    .DisableMenuitemFromCSBX
     458    call    DisableMenuitemFromCSBX
    441459
    442460    mov     bx, g_MenuitemIdeControllerSerialPort
    443     call    .DisableMenuitemFromCSBX
     461    call    DisableMenuitemFromCSBX
    444462
    445463    mov     bx, [cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
    446464    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
    447465    cmp     al, DEVICE_SERIAL_PORT
    448     jnz     .DisableAllSerial
     466    jne     .DisableAllSerial
    449467
    450468    mov     bx, g_MenuitemIdeControllerSerialCOM
    451     call    .EnableMenuitemFromCSBX
     469    call    EnableMenuitemFromCSBX
    452470
    453471    mov     bx, g_MenuitemIdeControllerSerialBaud
    454     call    .EnableMenuitemFromCSBX
     472    call    EnableMenuitemFromCSBX
    455473
    456474    mov     bx, [cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
    457475    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
    458476    mov     bx, g_MenuitemIdeControllerSerialPort
    459     cmp     al,'x'
    460     jz      .EnableMenuitemFromCSBX
    461     jmp     .DisableMenuitemFromCSBX
     477    cmp     al, 'x'
     478    je      SHORT .EnableMenuitemFromCSBX
     479    jmp     SHORT .DisableMenuitemFromCSBX
    462480.DisableAllSerial:
    463481    ret
     
    485503DisplayMasterSlaveMenu:
    486504;
    487 ; block mode is not supported on serial drives, disable/enable the option as appropriate
     505; "Block Mode Transfers" and "Internal Write Cache" are not supported on serial drives, disable/enable the options as appropriate
    488506;
    489507    push    bx
     
    491509    call    Buffers_GetRomvarsValueToAXfromOffsetInBX
    492510    mov     bx, g_MenuitemMasterSlaveBlockModeTransfers
    493     cmp     al,DEVICE_SERIAL_PORT
    494     jz      .isSerial
    495     or      BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
     511
     512    cmp     al, DEVICE_SERIAL_PORT
     513    je      .isSerial
     514
     515    call    EnableMenuitemFromCSBX
     516    mov     bx, g_MenuitemMasterSlaveWriteCache
     517    call    EnableMenuitemFromCSBX
    496518    jmp     .isDone
     519
    497520.isSerial:
    498     and     BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
     521    call    DisableMenuitemFromCSBX
     522    mov     bx, g_MenuitemMasterSlaveWriteCache
     523    call    DisableMenuitemFromCSBX
     524
    499525.isDone:
    500526    pop     bx
     
    515541; Writers:
    516542;   Parameters:
    517 ;       AX:     Value that the MENUITEM system was interacting with
    518 ;       ES:DI:  ROMVARS location where the value is to be stored
    519 ;       DS:SI:  MENUITEM pointer
     543;       AX:     Value that the MENUITEM system was interacting with
     544;       ES:DI:  ROMVARS location where the value is to be stored
     545;       DS:SI:  MENUITEM pointer
    520546;   Returns:
    521547;       AX:     Value to actually write to ROMVARS
     
    525551; Readers:
    526552;   Parameters:
    527 ;       AX:     Value read from the ROMVARS location
    528 ;       ES:DI:  ROMVARS location where the value was just read from
    529 ;       DS:SI:  MENUITEM pointer
     553;       AX:     Value read from the ROMVARS location
     554;       ES:DI:  ROMVARS location where the value was just read from
     555;       DS:SI:  MENUITEM pointer
    530556;   Returns:
    531557;       AX:     Value that the MENUITEM system will interact with and display
     
    535561ALIGN JUMP_ALIGN
    536562WriterForXTCFwindow:
    537     mov     al, ah
     563    xor     al, al
     564    SKIP2B  f
     565ReaderForXTCFwindow:
    538566    xor     ah, ah
    539     ret
    540 
    541 ALIGN JUMP_ALIGN
    542 ReaderForXTCFwindow:
    543     mov     ah, al
    544     xor     al, al
     567    xchg    al, ah
    545568    ret
    546569
     
    552575ALIGN JUMP_ALIGN
    553576IdeControllerMenu_WriteDevice:
    554         push    bx
    555         push    di
    556         push    di
    557         push    ax
    558 
    559         ; Note! AL is the choice index, not device code
    560         shl     ax, 1                               ; Selection to device code
    561         mov     bl, [es:di]                         ; what is the current Device we are changing from?
    562         sub     di, BYTE IDEVARS.bDevice - IDEVARS.wBasePort    ; Get ready to set the Port addresses
    563         cmp     al, DEVICE_SERIAL_PORT
    564         je      SHORT .changingToSerial
    565         cmp     al, DEVICE_8BIT_JRIDE_ISA
    566         je      SHORT .ChangingToJrIdeIsa
    567         cmp     al, DEVICE_8BIT_ADP50L
    568         je      SHORT .ChangingToADP50L
    569 
    570         ; Restore ports to default values
    571         cmp     al, DEVICE_8BIT_ATA                 ; Standard ATA controllers, including 8-bit mode
    572         mov     ax, DEVICE_ATA_PRIMARY_PORT         ; Defaults for 16-bit and better ATA devices
    573         mov     bx, DEVICE_ATA_PRIMARY_PORTCTRL
    574         jbe     SHORT .writeNonSerial
    575 
    576         mov     ax, DEVICE_XTIDE_DEFAULT_PORT       ; Defaults for 8-bit XTIDE and XT-CF devices
    577         mov     bx, DEVICE_XTIDE_DEFAULT_PORTCTRL
    578 
    579 .writeNonSerial:
    580         stosw                                       ; Store defaults in IDEVARS.wBasePort and IDEVARS.wBasePortCtrl
    581         xchg    bx, ax
    582         stosw
    583         jmp     SHORT .done
     577    push    bx
     578    push    di
     579    push    ax
     580
     581    ; Note! AL is the choice index, not device code
     582    shl     ax, 1                               ; Selection to device code
     583    mov     bl, [es:di]                         ; what is the current Device we are changing from?
     584    sub     di, BYTE IDEVARS.bDevice - IDEVARS.wBasePort    ; Get ready to set the Port addresses
     585    cmp     al, DEVICE_SERIAL_PORT
     586    je      SHORT .ChangingToSerial
     587    cmp     al, DEVICE_8BIT_JRIDE_ISA
     588    je      SHORT .ChangingToJrIdeIsa
     589    cmp     al, DEVICE_8BIT_ADP50L
     590    je      SHORT .ChangingToADP50L
     591
     592    ; Restore ports to default values
     593    cmp     al, DEVICE_8BIT_ATA                 ; Standard ATA controllers, including 8-bit mode
     594    mov     ax, DEVICE_ATA_PRIMARY_PORT         ; Defaults for 16-bit and better ATA devices
     595    mov     bx, DEVICE_ATA_PRIMARY_PORTCTRL
     596    jbe     SHORT .WriteNonSerial
     597
     598    mov     ax, DEVICE_XTIDE_DEFAULT_PORT       ; Defaults for 8-bit XTIDE and XT-CF devices
     599    mov     bx, DEVICE_XTIDE_DEFAULT_PORTCTRL
     600
     601.WriteNonSerial:
     602    stosw                                       ; Store defaults in IDEVARS.wBasePort and IDEVARS.wBasePortCtrl
     603    xchg    bx, ax
     604    stosw
     605    jmp     SHORT .Done
    584606
    585607.ChangingToJrIdeIsa:
    586         mov     ah, JRIDE_DEFAULT_SEGMENT_ADDRESS >> 8
    587         SKIP2B  bx
     608    mov     ah, JRIDE_DEFAULT_SEGMENT_ADDRESS >> 8
     609    SKIP2B  bx
    588610
    589611.ChangingToADP50L:
    590         mov     ah, ADP50L_DEFAULT_BIOS_SEGMENT_ADDRESS >> 8
    591         xor     al, al
    592         xor     bx, bx
    593         jmp     SHORT .writeNonSerial
    594 
    595 .changingToSerial:
    596         cmp     bl, DEVICE_SERIAL_PORT
    597         je      SHORT .done                         ; if we were already serial, nothing to do
    598 
    599         mov     BYTE [es:di+IDEVARS.bSerialBaud-IDEVARS.wBasePort], SERIAL_DEFAULT_BAUD
    600 
    601         mov     al, SERIAL_DEFAULT_COM
    602         sub     di, IDEVARS.wBasePort - IDEVARS.bSerialCOMPortChar
    603         call    IdeControllerMenu_SerialWriteCOM
    604         stosb
    605 
    606 .done:
    607         pop     ax
    608         pop     di          ; IDEVARS.bDevice
    609         pop     di
    610         pop     bx
    611         ret
     612    mov     ah, ADP50L_DEFAULT_BIOS_SEGMENT_ADDRESS >> 8
     613    xor     al, al
     614    xor     bx, bx
     615    jmp     SHORT .WriteNonSerial
     616
     617.ChangingToSerial:
     618    cmp     bl, DEVICE_SERIAL_PORT
     619    je      SHORT .Done                         ; if we were already serial, nothing to do
     620
     621    mov     BYTE [es:di+IDEVARS.bSerialBaud-IDEVARS.wBasePort], SERIAL_DEFAULT_BAUD
     622
     623    mov     al, SERIAL_DEFAULT_COM
     624    sub     di, IDEVARS.wBasePort - IDEVARS.bSerialCOMPortChar
     625    call    IdeControllerMenu_SerialWriteCOM
     626    stosb
     627
     628.Done:
     629    pop     ax
     630    pop     di          ; IDEVARS.bDevice
     631    pop     bx
     632    ret
    612633
    613634;
     
    617638ALIGN JUMP_ALIGN
    618639IdeControllerMenu_SerialWriteCOM:
    619         push    ax
    620         push    bx
    621         push    si
    622 
    623         mov     si,g_rgbChoiceToValueLookupForCOM
    624         mov     bx,PackedCOMPortAddresses
     640    push    ax
     641    push    bx
     642    push    si
     643
     644    mov     si, g_rgbChoiceToValueLookupForCOM
     645    mov     bx, PackedCOMPortAddresses
    625646
    626647.loop:
    627         mov     ah,[bx]
    628 
    629         cmp     ah,(SERIAL_DEFAULT_CUSTOM_PORT >> 2)
    630         jz      .notFound
    631 
    632         cmp     al,[si]
    633         jz      .found
    634 
    635         inc     si
    636         inc     si
    637         inc     bx
    638 
    639         jmp     .loop
     648    mov     ah, [bx]
     649
     650    cmp     ah, (SERIAL_DEFAULT_CUSTOM_PORT >> 2)
     651    je      .notFound
     652
     653    cmp     al, [si]
     654    je      .found
     655
     656    inc     si
     657    inc     si
     658    inc     bx
     659
     660    jmp     .loop
    640661
    641662.notFound:
    642         mov     al, 'x'
     663    mov     al, 'x'
    643664
    644665.found:
    645         mov     [es:di+IDEVARS.bSerialPort-IDEVARS.bSerialCOMPortChar], ah
    646 
    647         pop     si
    648         pop     bx
    649         pop     ax
    650 
    651         ret
     666    mov     [es:di+IDEVARS.bSerialPort-IDEVARS.bSerialCOMPortChar], ah
     667
     668    pop     si
     669    pop     bx
     670    pop     ax
     671
     672    ret
    652673
    653674
     
    657678ALIGN JUMP_ALIGN
    658679IdeControllerMenu_SerialReadPort:
    659         xor     ah,ah
    660         eSHL_IM ax, 2
    661         ret
     680    xor     ah, ah
     681    eSHL_IM ax, 2
     682    ret
    662683
    663684;
     
    667688ALIGN JUMP_ALIGN
    668689IdeControllerMenu_SerialWritePort:
    669         push    bx
    670         push    si
    671 
    672         eSHR_IM ax, 2
    673         and     al,0feh         ; force 8-byte boundary
    674 
    675         mov     si,g_rgbChoiceToValueLookupForCOM
    676         mov     bx,PackedCOMPortAddresses           ; loop, looking for port address in known COM address list
     690    push    bx
     691    push    si
     692
     693    eSHR_IM ax, 2
     694    and     al, 0feh            ; force 8-byte boundary
     695
     696    mov     si, g_rgbChoiceToValueLookupForCOM
     697    mov     bx, PackedCOMPortAddresses          ; loop, looking for port address in known COM address list
    677698
    678699.loop:
    679         mov     ah,[si]
    680         cmp     ah,'x'
    681         jz      .found
    682 
    683         cmp     al,[bx]
    684         jz      .found
    685 
    686         inc     si
    687         inc     si
    688         inc     bx
    689 
    690         jmp     .loop
     700    mov     ah, [si]
     701    cmp     ah, 'x'
     702    je      .found
     703
     704    cmp     al, [bx]
     705    je      .found
     706
     707    inc     si
     708    inc     si
     709    inc     bx
     710
     711    jmp     .loop
    691712
    692713.found:
    693         mov     [es:di+IDEVARS.bSerialCOMPortChar-IDEVARS.bSerialPort], ah
    694 
    695         pop     si
    696         pop     bx
    697 
    698         ret
    699 
     714    mov     [es:di+IDEVARS.bSerialCOMPortChar-IDEVARS.bSerialPort], ah
     715
     716    pop     si
     717    pop     bx
     718
     719    ret
     720
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MasterSlaveMenu.asm

    r548 r567  
    290290    ; Enable both
    291291    mov     bx, g_MenuitemMasterSlaveUserCHS
    292     call    .EnableMenuitemFromCSBX
     292    call    EnableMenuitemFromCSBX
    293293    mov     bx, g_MenuitemMasterSlaveUserLBA
    294     jmp     .EnableMenuitemFromCSBX
     294    jmp     SHORT .EnableMenuitemFromCSBX
    295295
    296296ALIGN JUMP_ALIGN
    297297.EnableCHSandDisableLBA:
    298298    mov     bx, g_MenuitemMasterSlaveUserCHS
    299     call    .EnableMenuitemFromCSBX
     299    call    EnableMenuitemFromCSBX
    300300    mov     bx, g_MenuitemMasterSlaveUserLBA
    301     jmp     .DisableMenuitemFromCSBX
     301    jmp     SHORT .DisableMenuitemFromCSBX
    302302
    303303ALIGN JUMP_ALIGN
    304304.DisableCHSandEnableLBA:
    305305    mov     bx, g_MenuitemMasterSlaveUserLBA
    306     call    .EnableMenuitemFromCSBX
     306    call    EnableMenuitemFromCSBX
    307307    mov     bx, g_MenuitemMasterSlaveUserCHS
    308     jmp     .DisableMenuitemFromCSBX
     308    jmp     SHORT .DisableMenuitemFromCSBX
    309309
    310310
     
    328328
    329329    mov     bx, g_MenuitemMasterSlaveCylinders
    330     call    .EnableMenuitemFromCSBX
     330    call    EnableMenuitemFromCSBX
    331331    mov     bx, g_MenuitemMasterSlaveHeads
    332     call    .EnableMenuitemFromCSBX
     332    call    EnableMenuitemFromCSBX
    333333    mov     bx, g_MenuitemMasterSlaveSectors
    334334    jmp     SHORT .EnableMenuitemFromCSBX
     
    337337.DisableCHandS:
    338338    mov     bx, g_MenuitemMasterSlaveCylinders
    339     call    .DisableMenuitemFromCSBX
     339    call    DisableMenuitemFromCSBX
    340340    mov     bx, g_MenuitemMasterSlaveHeads
    341     call    .DisableMenuitemFromCSBX
     341    call    DisableMenuitemFromCSBX
    342342    mov     bx, g_MenuitemMasterSlaveSectors
    343343    jmp     SHORT .DisableMenuitemFromCSBX
     
    377377ALIGN JUMP_ALIGN
    378378.EnableMenuitemFromCSBX:
    379     or      BYTE [cs:bx+MENUITEM.bFlags], FLG_MENUITEM_VISIBLE
    380     ret
     379    jmp     EnableMenuitemFromCSBX
    381380
    382381ALIGN JUMP_ALIGN
    383382.DisableMenuitemFromCSBX:
    384     and     BYTE [cs:bx+MENUITEM.bFlags], ~FLG_MENUITEM_VISIBLE
    385     ret
     383    jmp     DisableMenuitemFromCSBX
    386384
    387385
     
    407405
    408406    xchg    ax, dx              ; SHR 16
    409     eSHIFT_IM ax, 4, shr        ; SHR 4 => AX = DX:AX / (1024*1024)
     407    eSHR_IM ax, 4               ; SHR 4 => AX = DX:AX / (1024*1024)
    410408
    411409    pop     dx
     
    429427
    430428    xor     dx, dx
    431     eSHIFT_IM ax, 4, shl
     429    eSHL_IM ax, 4
    432430    xchg    dx, ax          ; DX:AX now holds AX * 1024 * 1024
    433431
     
    445443ALIGN JUMP_ALIGN
    446444MasterSlaveMenu_WriteCHSFlag:
    447         test    word [es:di], FLG_DRVPARAMS_USERCHS
    448         jnz     .alreadySet
    449 
    450         push    ax
    451         push    di
    452         push    si
    453 
    454         mov     ax, MASTERSLAVE_CYLINDERS_DEFAULT
    455         mov     si, g_MenuitemMasterSlaveCylinders
    456         call    Menuitem_StoreValueFromAXtoMenuitemInDSSI
    457 
    458         mov     ax, MASTERSLAVE_HEADS_DEFAULT
    459         mov     si, g_MenuitemMasterSlaveHeads
    460         call    Menuitem_StoreValueFromAXtoMenuitemInDSSI
    461 
    462         mov     ax, MASTERSLAVE_SECTORS_DEFAULT
    463         mov     si, g_MenuitemMasterSlaveSectors
    464         call    Menuitem_StoreValueFromAXtoMenuitemInDSSI
    465 
    466         pop     si
    467         pop     di
    468         pop     ax
     445    test    word [es:di], FLG_DRVPARAMS_USERCHS
     446    jnz     .alreadySet
     447
     448    push    ax
     449    push    di
     450    push    si
     451
     452    mov     ax, MASTERSLAVE_CYLINDERS_DEFAULT
     453    mov     si, g_MenuitemMasterSlaveCylinders
     454    call    Menuitem_StoreValueFromAXtoMenuitemInDSSI
     455
     456    mov     ax, MASTERSLAVE_HEADS_DEFAULT
     457    mov     si, g_MenuitemMasterSlaveHeads
     458    call    Menuitem_StoreValueFromAXtoMenuitemInDSSI
     459
     460    mov     ax, MASTERSLAVE_SECTORS_DEFAULT
     461    mov     si, g_MenuitemMasterSlaveSectors
     462    call    Menuitem_StoreValueFromAXtoMenuitemInDSSI
     463
     464    pop     si
     465    pop     di
     466    pop     ax
    469467
    470468.alreadySet:
    471         ret
     469    ret
    472470
    473471;
     
    477475ALIGN JUMP_ALIGN
    478476MasterSlaveMenu_WriteLBAFlag:
    479         test    word [es:di], FLG_DRVPARAMS_USERLBA
    480         jnz     .alreadySet
    481 
    482         push    ax
    483         push    di
    484         push    si
    485 
    486         mov     ax, MASTERSLAVE_USERLBA_DEFAULT
    487         mov     si, g_MenuitemMasterSlaveUserLbaValue
    488         call    Menuitem_StoreValueFromAXtoMenuitemInDSSI
    489 
    490         pop     si
    491         pop     di
    492         pop     ax
     477    test    word [es:di], FLG_DRVPARAMS_USERLBA
     478    jnz     .alreadySet
     479
     480    push    ax
     481    push    di
     482    push    si
     483
     484    mov     ax, MASTERSLAVE_USERLBA_DEFAULT
     485    mov     si, g_MenuitemMasterSlaveUserLbaValue
     486    call    Menuitem_StoreValueFromAXtoMenuitemInDSSI
     487
     488    pop     si
     489    pop     di
     490    pop     ax
    493491
    494492.alreadySet:
    495         ret
     493    ret
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm

    r565 r567  
    6969g_szItemMainFlash:      db  "Flash EEPROM",NULL
    7070g_szItemMainSave:       db  "Save BIOS back to original file",NULL
    71 g_szItemMainLicense:    db  "Copyright and License Information",NULL
    72 g_szItemMainHomePage:   db  "Web Links",NULL
     71g_szItemMainLicense:    db  "Copyright and License Information",NULL
     72g_szItemMainHomePage:   db  "Web Links",NULL
    7373
    7474g_szDlgMainLoadROM:     db  "Successfully loaded XTIDE Universal BIOS from EEPROM.",NULL
     
    128128g_szNfoCfgIdleTimeout:  db  "Enable Power Management to set the harddrive(s) to spin down after idling a certain amount of time.",NULL
    129129
    130 g_szSerialMoved:        db  "A Serial Controller has been moved to the end of the Controller list."
     130g_szSerialMoved:        db  "A Serial Controller has been moved to the end of the Controller list."
    131131                        db  " No further action is required. Serial Controllers must be placed at the end of the list.",NULL
    132132
     
    294294g_szValueCfgDeviceSerial:                   db  "Serial",NULL
    295295
    296 g_szSerialCOMChoice:    db  "COM1 - address 3F8h",LF
     296g_szSerialCOMChoice:    db  "COM1 - address 3F8h",LF
    297297                        db  "COM2 - address 2F8h",LF
    298                         db  "COM3 - address 3E8h",LF
    299                         db  "COM4 - address 2E8h",LF
    300                         db  "COM5 - address 2F0h",LF
    301                         db  "COM6 - address 3E0h",LF
     298                        db  "COM3 - address 3E8h",LF
     299                        db  "COM4 - address 2E8h",LF
     300                        db  "COM5 - address 2F0h",LF
     301                        db  "COM6 - address 3E0h",LF
    302302                        db  "COM7 - address 2E0h",LF
    303303                        db  "COM8 - address 260h",LF
     
    306306                        db  "COMB - address 360h",LF
    307307                        db  "COMC - address 270h",LF
    308                         db  "COMx - Custom address",NULL
     308                        db  "COMx - Custom address",NULL
    309309
    310310g_szValueCfgCOM1:       db  "COM1",NULL
     
    322322g_szValueCfgCOMx:       db  "Custom",NULL
    323323
    324 g_szSerialBaudChoice:   db  "115.2K baud",LF
    325                         db  "57.6K baud",LF
     324g_szSerialBaudChoice:   db  "115.2K baud",LF
     325                        db  "57.6K baud",LF
    326326                        db  "38.4K baud",LF
    327                         db  "28.8K baud",LF
    328                         db  "19.2K baud",LF
     327                        db  "28.8K baud",LF
     328                        db  "19.2K baud",LF
    329329                        db  "9600 baud",LF
    330                         db  "4800 baud",LF
    331                         db  "2400 baud",NULL
     330                        db  "4800 baud",LF
     331                        db  "2400 baud",NULL
    332332
    333333g_szValueCfgBaud115_2:  db  "115.2K",NULL
     
    377377                        db  " least one drive with buggy Block Mode implementation.",NULL
    378378
    379 g_szHelpDrvWriteCache:  db  "Modern Hard Drives have large internal write cache."
    380                         db  " The cache will speed up writes since the drive can free the bus right after data has been written in cache."
    381                         db  " The drive then starts to write the data from cache by itself."
    382                         db  " That can be dangerous since all unwritten data in cache is lost if power is turned off or the system is reset."
     379g_szHelpDrvWriteCache:  db  "Modern Hard Drives have a large amount of internal write cache."
     380                        db  " The cache will speed up writes since the drive can free the bus right after data has been written to cache."
     381                        db  " The drive then starts to write the data from cache to disk by itself."
     382                        db  " This can be dangerous since all unwritten data in cache is lost if power is turned off or the system is reset."
    383383                        db  " Modern operating systems will flush the cache when user shuts down the system."
    384384                        db  " DOS does not have that sort of protection so it is up to the user to make sure cache is flushed."
Note: See TracChangeset for help on using the changeset viewer.