Changeset 568 in xtideuniversalbios


Ignore:
Timestamp:
Dec 21, 2014, 5:37:53 PM (7 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • SerDrive: Using named pipe mode (serdrive -p) now works under Windows XP/2000/Server 2003.
  • checksum.pl: Added a compatibility fix for 3Com 3C503 cards.
  • XTIDECFG will now scan every possible segment address to find and load the BIOS and/or its settings from EEPROM. This should simplify things for people using combined option ROMs.
  • Fixed a bug from r521 in BootSector.asm where the BIOS would not display a timeout error if it failed to load the boot sector from harddrive.
  • Fixed a bug from r541 in CompatibleDPT.asm where CompatibleDPT_CreateDeviceParameterTableExtensionToESBXfromDPTinDSSI would generate an invalid checksum in the DPTE.
  • Optimizations and other fixes.
Location:
trunk
Files:
35 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Inc/Delay.inc

    r567 r568  
    55
    66;--------------------------------------------------------------------
    7 ; Clears prefetch queue by jumping to next instruction.
    8 ; This delays much more than nop instruction of fast systems.
     7; Clears prefetch queue by jumping to the next instruction.
     8; This delays much more than the nop instruction on fast systems.
    99;
    1010; JMP_DELAY
  • trunk/Assembly_Library/Inc/Emulate.inc

    r510 r568  
    7474;--------------------------------------------------------------------
    7575%macro eSALC 0
    76     db      0D6h
     76;   db      0D6h
     77    salc
    7778%endmacro
    7879
  • trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm

    r526 r568  
    623623    mov     cx, STRING_DIALOG_IO_size
    624624    call    Memory_ReserveCXbytesFromStackToDSSI
    625     call    .InitializeStringDialogIoInDSSIforInputtingFileName
    626 
    627     CALL_MENU_LIBRARY GetStringWithIoInDSSI
    628     mov     al, [si+STRING_DIALOG_IO.bUserCancellation]
    629     add     sp, BYTE STRING_DIALOG_IO_size
    630     test    al, al      ; User cancellation?
    631     jnz     SHORT ReturnWithoutHandlingKeystroke
    632     jmp     CloseFileDialogAfterSuccessfulSelection
    633 
    634 ALIGN JUMP_ALIGN
    635 .InitializeStringDialogIoInDSSIforInputtingFileName:
     625
     626;;; InitializeStringDialogIoInDSSIforInputtingFileName
    636627    call    InitializeNullStringsToDialogInputInDSSI
    637628    mov     WORD [si+DIALOG_INPUT.fszTitle], g_szEnterNewFileOrDirectory
     
    642633    mov     [si+STRING_DIALOG_IO.fpReturnBuffer], ax
    643634    mov     [si+STRING_DIALOG_IO.fpReturnBuffer+2], es
    644     ret
     635;;;
     636
     637    CALL_MENU_LIBRARY GetStringWithIoInDSSI
     638    mov     al, [si+STRING_DIALOG_IO.bUserCancellation]
     639    add     sp, BYTE STRING_DIALOG_IO_size
     640    test    al, al      ; User cancellation?
     641    jnz     SHORT ReturnWithoutHandlingKeystroke
     642    jmp     CloseFileDialogAfterSuccessfulSelection
    645643
    646644
  • trunk/Assembly_Library/Src/Menu/Dialog/DialogString.asm

    r526 r568  
    9999    mov     cx, [si+STRING_DIALOG_IO.wBufferSize]
    100100    les     di, [si+STRING_DIALOG_IO.fpReturnBuffer]
    101     call    .GetCharacterFilterFunctionToDX
     101    mov     dx, [si+STRING_DIALOG_IO.fnCharFilter]
     102    test    dx, dx
     103    jnz     SHORT .CharacterFilterFunctionInDX
     104    mov     dx, Char_CharIsValid
    102105
     106.CharacterFilterFunctionInDX:
    103107    call    Keyboard_ReadUserInputtedStringToESDIWhilePrinting
    104108    jz      SHORT .UserCancellation
     
    108112.UserCancellation:
    109113    ret
    110 
    111 ;--------------------------------------------------------------------
    112 ; .GetCharacterFilterFunctionToDX
    113 ;   Parameters
    114 ;       DS:SI:  Ptr to STRING_DIALOG_IO
    115 ;       SS:BP:  Ptr to DIALOG
    116 ;   Returns:
    117 ;       CS:DX:  Ptr to character filter function
    118 ;   Corrupts registers:
    119 ;       Nothing
    120 ;--------------------------------------------------------------------
    121 ALIGN JUMP_ALIGN
    122 .GetCharacterFilterFunctionToDX:
    123     mov     dx, [si+STRING_DIALOG_IO.fnCharFilter]
    124     test    dx, dx
    125     jnz     SHORT .ReturnFilterFunctionInDX
    126     mov     dx, Char_CharIsValid
    127 ALIGN JUMP_ALIGN, ret
    128 .ReturnFilterFunctionInDX:
    129     ret
  • trunk/Assembly_Library/Src/Menu/Dialog/DialogWord.asm

    r526 r568  
    9393;       Nothing (User input stored to WORD_DIALOG_IO)
    9494;   Corrupts registers:
    95 ;       AX, BX, DX, SI, DI
     95;       AX, BX, CX, DX, SI, DI
    9696;--------------------------------------------------------------------
    9797ALIGN JUMP_ALIGN
     
    100100    eMOVZX  bx, [si+WORD_DIALOG_IO.bNumericBase]
    101101ALIGN JUMP_ALIGN
    102 .GetUserInputIntilValidOrCancelled:
     102.GetUserInputUntilValidOrCancelled:
    103103    call    Keyboard_ReadUserInputtedWordWhilePrinting
    104104    jz      SHORT .UserCancellation
     
    116116.InputtedWordNotInRange:
    117117    call    Keyboard_PlayBellForUnwantedKeystroke
    118     call    .ClearInputtedWordFromDialog
    119     jmp     SHORT .GetUserInputIntilValidOrCancelled
    120 
    121 ;--------------------------------------------------------------------
    122 ; .ClearInputtedWordFromDialog
    123 ;   Parameters
    124 ;       SS:BP:  Ptr to DIALOG
    125 ;   Returns:
    126 ;       Nothing
    127 ;   Corrupts registers:
    128 ;       AX, CX, DX, DI
    129 ;--------------------------------------------------------------------
    130 ALIGN JUMP_ALIGN
    131 .ClearInputtedWordFromDialog:
     118    ; Clear inputted word from dialog
    132119    CALL_DISPLAY_LIBRARY GetSoftwareCoordinatesToAX
    133120    xchg    dx, ax
     
    138125
    139126    xchg    ax, dx
    140     JMP_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
    141 
     127    CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
     128    jmp     SHORT .GetUserInputUntilValidOrCancelled
  • trunk/Assembly_Library/Src/Menu/MenuBorders.asm

    r526 r568  
    5656    push    RefreshTitleBorders
    5757    push    MenuBorders_GetNumberOfMiddleCharactersToDX
    58     jmp     MenuBorders_AdjustDisplayContextForDrawingBorders
     58    jmp     SHORT MenuBorders_AdjustDisplayContextForDrawingBorders
    5959%endif
    6060
     
    120120    CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
    121121
    122     mov     si, ATTRIBUTE_CHARS.cBordersAndBackground
     122    xor     si, si      ; SI = ATTRIBUTE_CHARS.cBordersAndBackground
    123123    jmp     MenuAttribute_SetToDisplayContextFromTypeInSI
    124124
     
    141141
    142142;--------------------------------------------------------------------
     143; RefreshItemBorders
    143144; RefreshTitleBorders
    144 ;   Parameters
    145 ;       DX:     Number of times to repeat middle character
    146 ;       SS:BP:  Ptr to MENU
    147 ;   Returns:
    148 ;       Nothing
    149 ;   Corrupts registers:
    150 ;       AX, BX, CX, SI, DI
    151 ;--------------------------------------------------------------------
    152 ALIGN MENU_JUMP_ALIGN
    153 RefreshTitleBorders:
    154     call    DrawTopBorderLine
    155     eMOVZX  cx, [bp+MENUINIT.bTitleLines]
    156     jmp     SHORT DrawTextBorderLinesByCXtimes
    157 
    158 ;--------------------------------------------------------------------
    159145; RefreshInformationBorders
    160 ;   Parameters
    161 ;       DX:     Number of times to repeat middle character
    162 ;       SS:BP:  Ptr to MENU
    163 ;   Returns:
    164 ;       Nothing
    165 ;   Corrupts registers:
    166 ;       AX, BX, CX, SI, DI
    167 ;--------------------------------------------------------------------
    168 ALIGN MENU_JUMP_ALIGN
    169 RefreshInformationBorders:
    170     call    DrawSeparationBorderLine
    171     eMOVZX  cx, [bp+MENUINIT.bInfoLines]
    172     jmp     SHORT DrawTextBorderLinesByCXtimes
    173 
    174 ;--------------------------------------------------------------------
    175 ; RefreshItemBorders
    176146;   Parameters
    177147;       DX:     Number of times to repeat middle character
     
    186156    call    DrawSeparationBorderLine
    187157    call    MenuScrollbars_GetMaxVisibleItemsOnPageToCX
    188     ; Fall to DrawTextBorderLinesByCXtimes
    189 
    190 ;--------------------------------------------------------------------
     158    jmp     SHORT DrawTextBorderLinesByCXtimes
     159
     160ALIGN MENU_JUMP_ALIGN
     161RefreshTitleBorders:
     162    call    DrawTopBorderLine
     163    mov     cl, [bp+MENUINIT.bTitleLines]
     164    jmp     SHORT DrawTextBorderLinesByCLtimes
     165
     166ALIGN MENU_JUMP_ALIGN
     167RefreshInformationBorders:
     168    call    DrawSeparationBorderLine
     169    mov     cl, [bp+MENUINIT.bInfoLines]
     170    ; Fall to DrawTextBorderLinesByCLtimes
     171
     172;--------------------------------------------------------------------
     173; DrawTextBorderLinesByCLtimes
    191174; DrawTextBorderLinesByCXtimes
    192175;   Parameters
    193 ;       CX:     Number of border lines to draw
     176;       CL/CX:  Number of border lines to draw
    194177;       DX:     Number of times to repeat middle character
    195178;       SS:BP:  Ptr to MENU
     
    199182;       AX, CX, SI, DI
    200183;--------------------------------------------------------------------
     184DrawTextBorderLinesByCLtimes:
     185    xor     ch, ch
    201186DrawTextBorderLinesByCXtimes:
    202187    jcxz    .NoBorderLinesToDraw
     
    213198; DrawSeparationBorderLine
    214199; DrawBottomBorderLine
    215 ; DrawTimeoutCounterOverBottomBorderLine
    216200; DrawBottomShadowLine
    217201; DrawTextBorderLine
     
    242226
    243227    call    DrawTimeoutCounterString
     228    push    dx
    244229    sub     dx, BYTE MENU_TIMEOUT_STRING_CHARACTERS
    245230    mov     si, g_BottomBorderWithTimeoutCharacters
    246231    call    PrintBorderCharactersFromCSSIandShadowCharacter
    247     add     dx, BYTE MENU_TIMEOUT_STRING_CHARACTERS
     232    pop     dx
    248233    ret
    249234
     
    403388    mov     si, ATTRIBUTE_CHARS.cNormalTimeout
    404389    cmp     di, BYTE MENU_TIMEOUT_SECONDS_FOR_HURRY
    405     eCMOVB  si, ATTRIBUTE_CHARS.cHurryTimeout
     390    jnb     SHORT .NormalTimeout
     391    dec     si          ; SI = ATTRIBUTE_CHARS.cHurryTimeout
     392.NormalTimeout:
    406393    call    MenuAttribute_GetToAXfromTypeInSI
    407394
  • trunk/Assembly_Library/Src/Menu/MenuScrollbars.asm

    r526 r568  
    116116ALIGN MENU_JUMP_ALIGN
    117117MenuScrollbars_MoveHighlightedItemByAX:
    118     mov     cx, [bp+MENUINIT.wHighlightedItem]
    119     add     cx, ax
    120     ; Fall to .RotateItemInCX
    121 
    122 ;--------------------------------------------------------------------
    123 ; .RotateItemInCX
    124 ;   Parameters
    125 ;       CX:     Possibly under of overflown item to be rotated
    126 ;       SS:BP:  Ptr to MENU
    127 ;   Returns:
    128 ;       CX:     Valid item index
    129 ;   Corrupts registers:
    130 ;       DX
    131 ;--------------------------------------------------------------------
    132 ;.RotateItemInCX:
    133118    mov     dx, [bp+MENUINIT.wItems]
    134     test    cx, cx
     119    add     ax, [bp+MENUINIT.wHighlightedItem]
     120    xchg    cx, ax
    135121    js      SHORT .RotateNegativeItemInCX
    136122    sub     cx, dx
  • trunk/Assembly_Library/Src/Serial/SerialServer.asm

    r567 r568  
    8383
    8484%ifdef USE_UNDOC_INTEL
    85         eSALC   ; Clear AL using CF
     85        salc    ; Clear AL using CF
    8686%else
    87         xor     ax,ax
     87        xor     al, al
    8888%endif
    8989        inc     dx              ; divisor high
     
    108108        pop     dx              ; base, interrupts disabled
    109109%ifdef USE_UNDOC_INTEL
    110         eSALC   ; Clear AL using CF
     110        salc    ; Clear AL using CF
    111111%else
    112         xor     ax,ax
     112        xor     al, al
    113113%endif
    114114        out     dx,al
  • trunk/Serial_Server/win32/Win32Serial.h

    r526 r568  
    5555            log( 0, "Opening named pipe %s (simulating %s baud)", name, baudRate->display );
    5656
    57             pipe = CreateNamedPipeA( name, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE|PIPE_REJECT_REMOTE_CLIENTS, 2, 1024, 1024, 0, NULL );
     57            pipe = CreateNamedPipeA( name, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE, 2, 1024, 1024, 0, NULL );
    5858            if( pipe == INVALID_HANDLE_VALUE )
    5959                log( -1, "Could not CreateNamedPipe " PIPENAME );
  • trunk/Tools/StringsCompress.pl

    r526 r568  
    217217for( $g = 0; $translate_index[$g]; $g++ )
    218218{
    219     print "        db     ".$translate_index[$g]."  ; ".$g."\n";
     219    print "\t\tdb     ".$translate_index[$g]."\t; ".$g."\n";
    220220}
    221221
     
    231231for( $t = $format_begin; $format_index[$t]; $t++ )
    232232{
    233     print "        db     (DisplayFormatCompressed_BaseFormatOffset - ".$format_index[$t].")    ; ".$t."\n";
     233    print "\t\tdb     (DisplayFormatCompressed_BaseFormatOffset - ".$format_index[$t].")\t; ".$t."\n";
    234234}
    235235
  • trunk/Tools/checksum.pl

    r526 r568  
    5757
    5858$fixzero = chr(0);
     59
     60#
     61# Compatibility fix for 3Com 3C503 cards. They use 8 KB ROMs and return 8080h as the last word of the ROM.
     62#
     63if( $desiredSize == 8192 ) {
     64    if( $bytes < $desiredSize - 3 ) {
     65        while( $bytes < $desiredSize - 3 ) {
     66            print FILE $fixzero;
     67            $bytes++;
     68        }
     69        $fixl = ($cs == 0 ? 0 : 256 - $cs);
     70        $fix = chr($fixl).chr($cs);
     71        print FILE $fix;
     72        $bytes += 2;
     73    } else {
     74        print "Warning! ".$ARGV[0]." cannot be used on a 3Com 3C503 card!\n";
     75    }
     76}
     77
    5978while( $bytes < $desiredSize - 1 )
    6079{
  • trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm

    r526 r568  
    4747%ifdef MODULE_SERIAL    ; IDE + Serial
    4848Device_FinalizeDPT:
    49     ; needs to check IDEVARS vs. checking the DPT as the serial bit in the DPT is set in the Finalize routine
    50     CMP_USING_IDEVARS_IN_CSBP_AND_JUMP_IF   DEVICE_SERIAL_PORT, .FinalizeDptForSerialPortDevice
     49    ; Needs to check IDEVARS vs. checking the DPT as the serial bit in the DPT is set in the Finalize routine
     50    cmp     BYTE [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT
     51%ifdef USE_386
     52    jne     IdeDPT_Finalize
     53    jmp     SerialDPT_Finalize
     54%else
     55    je      SHORT .FinalizeDptForSerialPortDevice
    5156    jmp     IdeDPT_Finalize
    5257.FinalizeDptForSerialPortDevice:
    5358    jmp     SerialDPT_Finalize
     59%endif
    5460
    5561%else                   ; IDE
     
    94100%ifdef MODULE_SERIAL    ; IDE + Serial
    95101Device_IdentifyToBufferInESSIwithDriveSelectByteInBH:
    96     CMP_USING_IDEVARS_IN_CSBP_AND_JUMP_IF   DEVICE_SERIAL_PORT, .IdentifyDriveFromSerialPort
     102    cmp     BYTE [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT
     103%ifdef USE_386
     104    jne     IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
     105    jmp     SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
     106%else
     107    je      SHORT .IdentifyDriveFromSerialPort
    97108    jmp     IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
    98109.IdentifyDriveFromSerialPort:
    99110    jmp     SerialCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH
     111%endif
    100112
    101113%else                   ; IDE
     
    122134ALIGN JUMP_ALIGN
    123135Device_OutputCommandWithParameters:
    124     TEST_USING_DPT_AND_JUMP_IF_SERIAL_DEVICE .OutputCommandToSerialPort
     136    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE
     137%ifdef USE_386
     138    jz      IdeCommand_OutputWithParameters
     139    jmp     SerialCommand_OutputWithParameters
     140%else
     141    jnz     SHORT .OutputCommandToSerialPort
    125142    jmp     IdeCommand_OutputWithParameters
    126143
     
    128145.OutputCommandToSerialPort:
    129146    jmp     SerialCommand_OutputWithParameters
     147%endif
    130148
    131149%else                   ; IDE
     
    147165%ifdef MODULE_SERIAL    ; IDE + Serial
    148166Device_SelectDrive:
    149     TEST_USING_DPT_AND_JUMP_IF_SERIAL_DEVICE    ReturnSuccessForSerialPort
     167    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE
     168%ifndef USE_386
     169    jnz     SHORT ReturnSuccessForSerialPort
    150170    jmp     IdeCommand_SelectDrive
     171%else
     172    jz      IdeCommand_SelectDrive
     173    ; Fall to ReturnSuccessForSerialPort
     174%endif
    151175
    152176%else                   ; IDE
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm

    r567 r568  
    189189    mov     cl, [bp+PIOVARS.bSectorsLeft]       ; CH is already zero
    190190    push    cx
    191 %ifdef USE_186
    192     push    CheckErrorsAfterTransferringLastBlock
    193     jmp     [bp+PIOVARS.fnXfer]                 ; Transfer possibly partial block
    194 %else
    195191    call    [bp+PIOVARS.fnXfer]                 ; Transfer possibly partial block
    196192    jmp     SHORT CheckErrorsAfterTransferringLastBlock
    197 %endif
    198193
    199194
     
    241236
    242237    ; Convert ES:SI to physical address
    243 %ifdef USE_186
     238%ifdef USE_386
     239
     240    mov     dx, es
     241    xor     ax, ax
     242    shld    ax, dx, 4
     243    shl     dx, 4
     244    add     si, dx
     245    adc     al, ah
     246    mov     es, ax
     247
     248%elifdef USE_186
    244249                        ; Bytes EU Cycles(286)
    245250    mov     ax, es      ; 2     2
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm

    r567 r568  
    322322
    323323;--------------------------------------------------------------------
     324; Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH_ALHasDriveNumber
    324325; Int13h_SetErrorCodeToBdaAndToIntpackInSSBPfromAH
    325326; Int13h_SetErrorCodeToIntpackInSSBPfromAH
     
    330331;       SS:BP:  Ptr to IDEPACK with error condition set
    331332;   Corrupts registers:
    332 ;       DS, DI
     333;       DS, BX, DI
    333334;--------------------------------------------------------------------
    334335ALIGN JUMP_ALIGN
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH4h_HVerify.asm

    r526 r568  
    3838;   Returns with INTPACK in SS:BP:
    3939;       AH:     Int 13h/40h floppy return status
    40 ;       AL:     Number of sectors actually verified (only valid if CF set for someBIOSes)
     40;       AL:     Number of sectors actually verified (only valid if CF set for some BIOSes)
    4141;       CF:     0 if successful, 1 if error
    4242;--------------------------------------------------------------------
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH43h_ExtendedWriteSectors.asm

    r526 r568  
    4848    mov     ah, [cs:bx+g_rgbWriteCommandLookup]
    4949    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ)
    50 %ifdef USE_186
    51     push    AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX
    52     jmp     Idepack_ConvertDapToIdepackAndIssueCommandFromAH
    53 %else
    5450    call    Idepack_ConvertDapToIdepackAndIssueCommandFromAH
    5551    jmp     SHORT AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX
    56 %endif
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH44h_ExtendedVerifySectors.asm

    r526 r568  
    4343    mov     ah, [cs:bx+g_rgbVerifyCommandLookup]
    4444    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRDY)
    45 %ifdef USE_186
    46     push    AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX
    47     jmp     Idepack_ConvertDapToIdepackAndIssueCommandFromAH
    48 %else
    4945    call    Idepack_ConvertDapToIdepackAndIssueCommandFromAH
    5046    jmp     SHORT AH42h_ReturnFromInt13hAfterStoringErrorCodeFromAHandTransferredSectorsFromCX
    51 %endif
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm

    r550 r568  
    147147    ; from previously scanned drive.
    148148.DoNotSetChsFlag:
    149     eMOVZX  dx, BYTE [es:si+DPT.bPchsHeads]
     149    eMOVZX  dx, [es:si+DPT.bPchsHeads]
    150150    mov     [di+EDRIVE_INFO.dwHeads], dx
    151151    mov     [di+EDRIVE_INFO.dwHeads+2], cx
     
    159159    mov     [di+EDRIVE_INFO.dwCylinders+2], cx
    160160
    161 .ReturnWithSuccess:
    162     xor     ax, ax
    163 .ReturnWithError:
     161    xor     ax, ax      ; Success
    164162    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm

    r542 r568  
    3737ALIGN JUMP_ALIGN
    3838Address_ExtractLCHSparametersFromOldInt13hAddress:
    39     mov     bl, cl              ; Copy sector number...
    40     and     bl, 3Fh             ; ...and limit to 1...63
     39    mov     bl, 3Fh             ; Load sector number mask
     40    and     bl, cl              ; Sector number now in BL
    4141    sub     cl, bl              ; Remove from cylinder number high
    4242    eROL_IM cl, 2               ; High bits to beginning
     
    7575    ; (LCylinder << n) + (LHead / PHeadCount)
    7676    mov     dx, cx                  ; Copy L-CHS Cylinder number to DX
    77     mov     cl, [di+DPT.bFlagsLow]  ; Load shift count
    78     and     cl, MASKL_DPT_CHS_SHIFT_COUNT
     77    mov     cl, MASKL_DPT_CHS_SHIFT_COUNT   ; Load shift count mask
     78    and     cl, [di+DPT.bFlagsLow]  ; Shift count now in CL
    7979    shl     dx, cl                  ; DX = LCylinder << n
    8080    add     ax, dx                  ; AX = P-CHS Cylinder number
     
    8383    ret
    8484
     85; *FIXME* The above function description doesn't match the code.
     86; If CX has a maximum value of 1023 on entry then there is no way CX can be 16382 on return.
     87; 1023 SHL 3 (MASKL_DPT_CHS_SHIFT_COUNT) is 8184. With the addition of AX (at most 255?)
     88; the result is 8439.
    8589
    8690;--------------------------------------------------------------------
     
    102106ALIGN JUMP_ALIGN
    103107Address_OldInt13hAddressToIdeAddress:
    104         call    Address_ExtractLCHSparametersFromOldInt13hAddress
    105         ACCESSDPT__GET_UNSHIFTED_TRANSLATE_MODE_TO_AXZF
     108    call    Address_ExtractLCHSparametersFromOldInt13hAddress
     109    mov     al, [di+DPT.bFlagsLow]
     110    and     al, MASKL_DPT_TRANSLATEMODE
    106111
    107112;;; 0: ADDRESSING_MODE_NORMAL
    108         jz      SHORT DoNotConvertLCHS
     113    jz      SHORT DoNotConvertLCHS
    109114
    110115;;; 1: ADDRESSING_MODE_LARGE
    111         test    al, FLGL_DPT_ASSISTED_LBA
    112         jz      SHORT ConvertLargeModeLCHStoPCHS
     116    test    al, FLGL_DPT_ASSISTED_LBA
     117    jz      SHORT ConvertLargeModeLCHStoPCHS
    113118
    114119;;; 2: ADDRESSING_MODE_ASSISTED_LBA
    115         ; Fall through to ConvertAssistedLBAModeLCHStoLBARegisterValues
     120    ; Fall to ConvertAssistedLBAModeLCHStoLBARegisterValues
    116121
    117122
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm

    r567 r568  
    4646    ; Make sure that sector count is valid
    4747%ifdef USE_UNDOC_INTEL
    48     eSALC   ; Clear AL using CF (CF is cleared since JB above fell through)
     48    salc    ; Clear AL using CF (CF is cleared since JB above fell through)
    4949    or      al, [es:si+DAP.wSectorCount]
    5050%else
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h/BootSector.asm

    r528 r568  
    4242    ; display error code every time user intends to boot from hard disk
    4343    ; when A then C boot order is used.
     44    test    dl, dl
    4445    js      SHORT .PrintFailedToLoadErrorCode   ; Hard Drive
    4546    cmp     ah, RET_HD_TIMEOUT
     
    4849    je      SHORT .ReturnWithCFclearSinceFailedToLoadBootSector
    4950.PrintFailedToLoadErrorCode:
    50 %ifdef USE_186
    51     push    .ReturnWithCFclearSinceFailedToLoadBootSector
    52     jmp     DetectPrint_FailedToLoadFirstSector
    53 %else
    5451    call    DetectPrint_FailedToLoadFirstSector
    55     jmp     .ReturnWithCFclearSinceFailedToLoadBootSector
    56 %endif
     52    jmp     SHORT .ReturnWithCFclearSinceFailedToLoadBootSector
    5753
    5854
     
    6359    jne     SHORT .FirstHardDiskSectorNotBootable
    6460.AlwaysBootFromFloppyDriveForBooterGames:
    65     stc     ; Boot Sector loaded succesfully
     61    stc     ; Boot Sector loaded successfully
    6662    jmp     SHORT Int19_JumpToBootSectorOrRomBoot
    6763
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm

    r567 r568  
    136136    mov     cx, [di+DPT_ADVANCED_ATA.wMinPioCycleTime]
    137137    test    si, si
    138     jz      SHORT .PioTimingsLoadedToAXandCX
     138    jz      SHORT .PioTimingsLoadedToBXandCX
    139139    MIN_U   bl, [si+DPT_ADVANCED_ATA.bPioMode]
    140140    MAX_U   cx, [si+DPT_ADVANCED_ATA.wMinPioCycleTime]
    141 .PioTimingsLoadedToAXandCX:
     141.PioTimingsLoadedToBXandCX:
    142142    ret
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm

    r567 r568  
    107107    call    AccessDPT_GetPointerToDRVPARAMStoCSBX
    108108    push    ds
     109
     110    push    cs
     111    pop     ds
     112
     113    ; Load User Defined CHS or LBA to CX:AX
     114    mov     dx, [bx+DRVPARAMS.wFlags]
     115    mov     ax, [bx+DRVPARAMS.wCylinders]       ; Or .dwMaximumLBA
     116    mov     cx, [bx+DRVPARAMS.wHeadsAndSectors] ; Or .dwMaximumLBA+2
     117
    109118    push    es
    110119    pop     ds      ; DS:SI now points to ATA information
    111 
    112     ; Load User Defined CHS or LBA to CX:AX
    113     mov     dx, [cs:bx+DRVPARAMS.wFlags]
    114     mov     ax, [cs:bx+DRVPARAMS.wCylinders]        ; Or .dwMaximumLBA
    115     mov     cx, [cs:bx+DRVPARAMS.wHeadsAndSectors]  ; Or .dwMaximumLBA+2
    116120
    117121    ; * User defined CHS *
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm

    r567 r568  
    7272%endif
    7373
    74     mov     al,[cs:ROMVARS.wFlags]          ; Configurator set to always scan?
    75     or      al,[es:BDA.bKBFlgs1]            ; Or, did the user hold down the ALT key?
    76     and     al,8                            ; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_ALWAYSDETECT
     74    mov     al, [cs:ROMVARS.wFlags]         ; Configurator set to always scan?
     75    or      al, [es:BDA.bKBFlgs1]           ; Or, did the user hold down the ALT key?
     76    and     al, 8                           ; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_ALWAYSDETECT
    7777    jnz     .DriveDetectLoop
    7878%endif
     
    8989;
    9090    mov     cx, [RAMVARS.wDrvCntAndFlopCnt]     ; Our count of hard disks
    91 
    9291    mov     al, [es:BDA.bHDCount]
    93     add     cl, al                      ; Add our drives to the system count
    94     mov     [es:BDA.bHDCount], cl
     92    add     [es:BDA.bHDCount], cl       ; Add our drives to the system count
    9593    or      al, 80h                     ; Or in hard disk flag
    9694    mov     [RAMVARS.bFirstDrv], al     ; Store first drive number
     
    118116    inc     ax                              ; low order bit, indicating floppy drive exists
    119117
    120     mov     ah, [es:BDA.wEquipment]         ; Load Equipment WORD low byte
    121     and     ah, 03eh                        ; Mask off drive number and drives present bit
     118    mov     ah, 3Eh                         ; AND mask to AH (all bits set except floppy drive count/present)
     119    and     ah, [es:BDA.wEquipment]         ; Load Equipment WORD low byte and mask off drive number and drives present bit
    122120    or      al, ah                          ; Or in new values
    123121    mov     [es:BDA.wEquipment], al         ; and store
    124122
    125     mov     al, 1eh                         ; BDA pointer to Floppy DPT
     123    mov     al, 1Eh                         ; BDA pointer to Floppy DPT
    126124    mov     si, AH8h_FloppyDPT
    127125    call    Interrupts_InstallHandlerToVectorInALFromCSSI
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm

    r567 r568  
    181181    push    ax
    182182    push    di                          ; BIOS segment
    183     add     al, ROMVARS.szVersion - ROMVARS.szTitle
     183    mov     al, ROMVARS.szVersion & 0FFh
    184184    push    ax
    185185%else
  • trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrintCfg.asm

    r550 r568  
    5656;--------------------------------------------------------------------
    5757.PushAddressingMode:
    58     ACCESSDPT__GET_UNSHIFTED_TRANSLATE_MODE_TO_AXZF
     58    mov     al, [di+DPT.bFlagsLow]
     59    and     ax, BYTE MASKL_DPT_TRANSLATEMODE
    5960    ;;
    6061    ;; This multiply both shifts the addressing mode bits down to low order bits, and
     
    107108    eCMOVZ  ah, [di+DPT_ATA.bDevice]    ; DPT_ATA contains up to date device information for IDE drives
    108109%ifdef USE_UNDOC_INTEL
    109     eSALC   ; Clear AL using CF (from TEST above)
     110    salc    ; Clear AL using CF (from TEST above)
    110111    eAAD    g_szDeviceTypeValues_Displacement
    111112%else
  • trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm

    r567 r568  
    6969.PrintFloppyDriveHotkeys:
    7070    call    FloppyDrive_GetCountToAX
    71     test    ax, ax      ; Any Floppy Drives?
    72     jz      SHORT .SkipFloppyDriveHotkeys
     71    xchg    cx, ax      ; Any Floppy Drives?
     72    jcxz    .SkipFloppyDriveHotkeys
    7373
    7474    mov     ax, (ANGLE_QUOTE_RIGHT << 8) | DEFAULT_FLOPPY_DRIVE_LETTER
  • trunk/XTIDE_Universal_BIOS/Src/StringsCompressed.asm

    r536 r568  
    491491
    492492StringsCompressed_TranslatesAndFormats:
    493         db     32  ; 0
    494         db     172  ; 1
    495         db     171  ; 2
    496         db     179  ; 3
    497         db     175  ; 4
    498         db     33  ; 5
    499         db     34  ; 6
    500         db     44  ; 7
    501         db     45  ; 8
    502         db     46  ; 9
    503         db     47  ; 10
    504         db     49  ; 11
    505         db     50  ; 12
    506         db     51  ; 13
    507         db     53  ; 14
    508         db     54  ; 15
    509         db     56  ; 16
    510         db     200  ; 17
    511         db     181  ; 18
    512         db     48  ; 19
    513         db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_2_I)    ; 20
    514         db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_u)    ; 21
    515         db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_5_u)    ; 22
    516         db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_x)    ; 23
    517         db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_5_x)    ; 24
    518         db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_nl)    ; 25
    519         db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_2_u)    ; 26
    520         db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_A)    ; 27
    521         db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_c)    ; 28
    522         db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_s)    ; 29
    523         db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_z)    ; 30
     493        db     32   ; 0
     494        db     172  ; 1
     495        db     171  ; 2
     496        db     179  ; 3
     497        db     175  ; 4
     498        db     33   ; 5
     499        db     34   ; 6
     500        db     44   ; 7
     501        db     45   ; 8
     502        db     46   ; 9
     503        db     47   ; 10
     504        db     49   ; 11
     505        db     50   ; 12
     506        db     51   ; 13
     507        db     53   ; 14
     508        db     54   ; 15
     509        db     56   ; 16
     510        db     200  ; 17
     511        db     181  ; 18
     512        db     48   ; 19
     513        db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_2_I)  ; 20
     514        db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_u)    ; 21
     515        db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_5_u)  ; 22
     516        db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_x)    ; 23
     517        db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_5_x)  ; 24
     518        db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_nl)   ; 25
     519        db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_2_u)  ; 26
     520        db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_A)    ; 27
     521        db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_c)    ; 28
     522        db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_s)    ; 29
     523        db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_z)    ; 30
    524524
    525525%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
     
    560560
    561561;; translated usage stats
    562 ;; 33:1
    563 ;; 32:35
    564 ;; 181:1
    565 ;; 53:2
    566 ;; 48:2
    567 ;; 200:1
    568 ;; 46:3
    569 ;; 179:8
     562;; 54:1
     563;; 47:2
     564;; 175:1
     565;; 49:1
    570566;; 44:1
    571567;; 50:2
     568;; 200:1
     569;; 181:1
     570;; 172:2
     571;; 45:2
     572;; 56:8
     573;; 33:1
     574;; 53:2
     575;; 179:8
     576;; 171:2
    572577;; 51:3
    573 ;; 47:2
    574 ;; 172:2
    575578;; 34:3
    576 ;; 49:1
    577 ;; 56:8
    578 ;; 45:2
    579 ;; 175:1
    580 ;; 171:2
    581 ;; 54:1
     579;; 48:2
     580;; 46:3
     581;; 32:35
    582582;; total translated: 20
    583583
    584584;; format usage stats
     585;; nl:12
     586;; x:5
    585587;; A:4
     588;; 5-x:1
    586589;; 2-u:1
     590;; z:2
    587591;; 5-u:2
    588 ;; x:5
    589592;; s:14
    590 ;; 5-x:1
    591 ;; nl:12
    592593;; 2-I:1
    593594;; u:6
    594595;; c:13
    595 ;; z:2
    596596;; total format: 11
    597597
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm

    r567 r568  
    5858
    5959%ifdef USE_UNDOC_INTEL
    60     eSALC   ; Clears AL using CF while preserving flags
     60    salc    ; Clears AL using CF while preserving flags
    6161%endif
    6262
     
    163163;--------------------------------------------------------------------
    164164AccessDPT_GetIdevarsToCSBX:
    165     eMOVZX  bx, BYTE [di+DPT.bIdevarsOffset]
     165    eMOVZX  bx, [di+DPT.bIdevarsOffset]
    166166    ret
    167167
    168 
    169 ;--------------------------------------------------------------------
    170 ; ACCESSDPT__GET_UNSHIFTED_TRANSLATE_MODE_TO_AXZF
    171 ;   Parameters:
    172 ;       DS:DI:  Ptr to Disk Parameter Table
    173 ;   Returns:
    174 ;       AX:     Translate Mode (TRANSLATEMODE_NORMAL, TRANSLATEMODE_LARGE or TRANSLATEMODE_ASSISTED_LBA)
    175 ;               unshifted (still shifted where it is in bFlagsLow)
    176 ;       ZF:     Set based on value in AL
    177 ;   Corrupts registers:
    178 ;       Nothing
    179 ;--------------------------------------------------------------------
    180 ;
    181 ; Converted to a macro since only called in two places, and the call/ret overhead
    182 ; is not worth it for these two instructions (4 bytes total)
    183 ;
    184 %macro ACCESSDPT__GET_UNSHIFTED_TRANSLATE_MODE_TO_AXZF 0
    185     mov     al, [di+DPT.bFlagsLow]
    186     and     ax, BYTE MASKL_DPT_TRANSLATEMODE
    187 %endmacro
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AtaGeometry.asm

    r567 r568  
    142142; GetSectorCountToDXAXfromCHSinAXBLBH
    143143;   Parameters:
    144 ;       ES:SI:  Ptr to 512-byte ATA information read from the drive
    145144;       AX:     Number of cylinders (1...16383)
    146145;       BL:     Number of heads (1...255)
     
    328327    cmp     ax, cx
    329328    jbe     SHORT .NumberOfHeadsNowInCX
    330     eSHL_IM cl, 1                       ; Double number of heads
    331     jnz     SHORT .CompareNextValidNumberOfHeads    ; Reached 256 heads?
    332     dec     cl                          ;  If so, limit heads to 255
     329    eSHL_IM cx, 1                       ; Double number of heads
     330    jpo     SHORT .CompareNextValidNumberOfHeads    ; Reached 256 heads?
     331    dec     cx                          ;  If so, limit heads to 255
    333332.NumberOfHeadsNowInCX:
    334333    mov     bx, cx                      ; Number of heads are returned in BL
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CompatibleDPT.asm

    r558 r568  
    114114;--------------------------------------------------------------------
    115115FillTranslatedDPTtoESDIfromDPTinDSSI:
    116     xor     dx, dx                      ; Clear for checksum
     116    cwd                                 ; Clear for checksum
    117117    call    StoswThenAddALandAHtoDL     ; Bytes 0 and 1 (Logical number of cylinders)
    118118
    119     mov     al, BYTE [si+DPT.bLchsHeads]
     119    mov     al, [si+DPT.bLchsHeads]
    120120    mov     ah, TRANSLATED_DPT_SIGNATURE
    121121    call    StoswThenAddALandAHtoDL     ; Bytes 2 (Logical number of heads) and 3 (Axh signature to indicate Translated DPT)
    122122
    123     eMOVZX  ax, BYTE [si+DPT.bPchsSectorsPerTrack]
     123    eMOVZX  ax, [si+DPT.bPchsSectorsPerTrack]
    124124    call    StoswThenAddALandAHtoDL     ; Bytes 4 (Physical sectors per track) and 5 (Write Precompensation Cylinder low)
    125125
    126     mov     al, ah
    127     call    StoswThenAddALandAHtoDL     ; Bytes 6 (Write Precompensation Cylinder high) and 7
    128 
    129     xchg    ax, cx                      ; Device Control byte to AL
     126    mov     al, ah                      ; Zero AX
     127    stosw                               ; Bytes 6 (Write Precompensation Cylinder high) and 7
     128
     129    xchg    cx, ax                      ; Device Control byte to AL, zero to CX
    130130    mov     ah, [si+DPT.wPchsCylinders]
    131131    call    StoswThenAddALandAHtoDL     ; Bytes 8 (Drive Control Byte) and 9 (Physical number of cylinders low)
     
    135135    call    StoswThenAddALandAHtoDL     ; Bytes 10 (Physical number of cylinders high) and 11 (Physical number of heads)
    136136
    137     xor     ax, ax
    138     call    StoswThenAddALandAHtoDL     ; Bytes 12 and 13 (Landing Zone Cylinder)
     137    xchg    cx, ax                      ; Zero to AX
     138    stosw                               ; Bytes 12 and 13 (Landing Zone Cylinder)
    139139
    140140    mov     al, [si+DPT.bLchsSectorsPerTrack]
     
    158158;       DI:     Incremented by 2
    159159;   Corrupts registers:
    160 ;       Nothing
     160;       AH
    161161;--------------------------------------------------------------------
    162162StoswALandChecksumFromDL:
     
    182182FillStandardDPTtoESDIfromDPTinDSSI:
    183183    stosw               ; Bytes 0 and 1 (Physical number of cylinders)
    184     eMOVZX  ax, BYTE [si+DPT.bLchsHeads]
     184    eMOVZX  ax, [si+DPT.bLchsHeads]
    185185    stosw               ; Bytes 2 (Physical number of heads) and 3
     186%ifdef USE_UNDOC_INTEL
     187%ifdef USE_386
     188    xor     al, al      ; Zero AX and clear CF
     189%else
     190    salc                ; Zero AX (CF cleared by eMOVZX above)
     191%endif
     192%else
    186193    mov     al, ah      ; Zero AX
     194%endif
    187195    stosw               ; Bytes 4 and 5 (Write Precompensation Cylinder low)
    188196    stosw               ; Bytes 6 (Write Precompensation Cylinder high) and 7
    189197    mov     al, cl      ; Device control byte to AL
    190198    stosw               ; Bytes 8 (Drive Control Byte) and 9
     199%ifdef USE_UNDOC_INTEL
     200    salc                ; Zero AX (CF cleared above)
     201%else
    191202    mov     al, ah      ; Zero AX
     203%endif
    192204    stosw               ; Bytes 10 and 11
    193205    stosw               ; Bytes 12 and 13 (Landing Zone Cylinder)
     
    208220;       ES:BX:  Ptr to Device Parameter Table Extension (DPTE)
    209221;   Corrupts registers:
    210 ;       AX, CX, DX, DI
     222;       AX, CX, DL, DI
    211223;--------------------------------------------------------------------
    212224CompatibleDPT_CreateDeviceParameterTableExtensionToESBXfromDPTinDSSI:
    213     call    GetTemporaryBufferForDPTEtoESDI ; valid until next AH=48h call
     225    call    GetTemporaryBufferForDPTEtoESDI ; Valid until next AH=48h call
    214226
    215227    ; Set 32-bit flag for 32-bit controllers
     
    218230    eCMOVE  cl, FLG_LBA_TRANSLATION_ENABLED | FLG_32BIT_XFER_MODE
    219231
     232    xor     dl, dl                          ; Clear DL for checksum
     233
    220234    ; DPTE.wBasePort
    221235    mov     ax, [si+DPT.wBasePort]
     
    223237
    224238    ; DPTE.wControlBlockPort
    225     eMOVZX  bx, BYTE [si+DPT.bIdevarsOffset]
     239    eMOVZX  bx, [si+DPT.bIdevarsOffset]
    226240    mov     ax, [cs:bx+IDEVARS.wControlBlockPort]
    227241    call    StoswThenAddALandAHtoDL         ; Bytes 2 and 3
     
    244258    ; DPTE.bDmaChannelAndType and DPTE.bPioMode
    245259    xor     ax, ax
    246 %ifdef MODULE_ADVANCED_ATA
     260%ifndef MODULE_ADVANCED_ATA
     261    stosw                                   ; Bytes 8 and 9
     262%else
    247263    or      ah, [si+DPT_ADVANCED_ATA.bPioMode]
    248264    jz      SHORT .DoNotSetFastPioFlag
    249     cmp     WORD [si+DPT_ADVANCED_ATA.wControllerID], BYTE 0
    250     je      SHORT .DoNotSetFastPioFlag
    251     inc     cx      ; FLG_FAST_PIO_ENABLED
     265    cmp     WORD [si+DPT_ADVANCED_ATA.wControllerID], BYTE 1
     266    sbb     cl, -1  ; FLG_FAST_PIO_ENABLED (if .wControllerID > 0)
    252267.DoNotSetFastPioFlag:
    253 %endif
    254268    call    StoswThenAddALandAHtoDL         ; Bytes 8 and 9
     269%endif
    255270
    256271    ; Set CHS translation flags and store DPTE.wFlags
     
    261276    test    al, FLGL_DPT_ASSISTED_LBA
    262277    jz      SHORT .NoChsTranslationOrBitShiftTranslationSet
    263     or      cx, LBA_ASSISTED_TRANSLATION << TRANSLATION_TYPE_FIELD_POSITION
     278    or      ch, LBA_ASSISTED_TRANSLATION << (TRANSLATION_TYPE_FIELD_POSITION - 8)
    264279.NoChsTranslationOrBitShiftTranslationSet:
    265280    xchg    ax, cx
     
    268283    ; DPTE.wReserved (must be zero)
    269284    xor     ax, ax
    270     call    StoswThenAddALandAHtoDL         ; Bytes 12 and 13
     285    stosw                                   ; Bytes 12 and 13
    271286
    272287    ; DPTE.bRevision and DPTE.bChecksum
    273288    mov     al, DPTE_REVISION
    274     call    StoswALandChecksumFromDL        ; Bytes 14 and 15
    275     lea     bx, [di-DPTE_size]
    276     ret
     289    lea     bx, [di+2-DPTE_size]            ; The +2 compensates for the last WORD yet to be stored
     290    jmp     StoswALandChecksumFromDL        ; Bytes 14 and 15
    277291%endif ; MODULE_EBIOS
    278292
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm

    r567 r568  
    116116    jnz     SHORT .NothingToChange
    117117
    118 .LimitHeadsForLargeAddressingMode:
    119118    ; We cannot have 16 P-Heads heads in Revised ECHS mode (8193 or more cylinders)
    120119    ; but 16 heads are allowed when there are 8192 or less cylinders (ECHS).
    121120    ; Both of these are LARGE modes so do not confuse with NORMAL mode.
    122121    call    AtaGeometry_IsDriveSmallEnoughForECHS
    123     jc      SHORT .NothingToChange
    124     dec     bx                      ; Adjust 16 P-Heads to 15
     122    adc     bx, -1                  ; Adjust 16 P-Heads to 15 if needed
    125123
    126124.NothingToChange:
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm

    r558 r568  
    159159    call    Buffers_IsXtideUniversalBiosSignatureInESDI
    160160    je      SHORT .RomFound
    161     add     bh, 2                   ; Increment by 8kB
     161    add     bx, 80h                 ; Increment by 2kB (minimum possible distance from the beginning of one option ROM to the next)
    162162    jnc     SHORT .SegmentLoop      ; Loop until segment overflows
    163163    clc
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Flash.asm

    r526 r568  
    8383
    8484    push    cx
    85     call    .GetSdpCommandFunctionToDXwithFlashvarsInSSBP
     85    call    .GetSdpCommandFunctionToAXwithFlashvarsInSSBP
    8686    mov     cx, [bp+FLASHVARS.wEepromPageSize]
    8787    mov     si, [bp+FLASHVARS.fpNextSourcePage]
     
    9494
    9595;--------------------------------------------------------------------
    96 ; .GetSdpCommandFunctionToDXwithFlashvarsInSSBP
    97 ;   Parameters:
    98 ;       SS:BP:  Ptr to FLASHVARS
    99 ;   Returns:
    100 ;       DX:     Ptr to SDP Command function
     96; .GetSdpCommandFunctionToAXwithFlashvarsInSSBP
     97;   Parameters:
     98;       SS:BP:  Ptr to FLASHVARS
     99;   Returns:
     100;       AX:     Ptr to SDP Command function
    101101;   Corrupts registers:
    102102;       BX, SI
    103103;--------------------------------------------------------------------
    104104ALIGN JUMP_ALIGN
    105 .GetSdpCommandFunctionToDXwithFlashvarsInSSBP:
     105.GetSdpCommandFunctionToAXwithFlashvarsInSSBP:
    106106    eMOVZX  bx, [bp+FLASHVARS.bEepromSdpCommand]
    107107    mov     si, [cs:bx+.rgpSdpCommandToEepromTypeLookupTable]
    108108    mov     bl, [bp+FLASHVARS.bEepromType]
    109     mov     dx, [cs:bx+si]
     109    mov     ax, [cs:bx+si]
    110110    ret
    111111
     
    182182;       Nothing
    183183;   Corrupts registers:
    184 ;       Nothing
     184;       AX
    185185;--------------------------------------------------------------------
    186186%macro DISABLE_SDP 2
    187     mov     BYTE [%1], 0AAh
    188     mov     BYTE [%2], 55h
    189     mov     BYTE [%1], 80h
    190     mov     BYTE [%1], 0AAh
    191     mov     BYTE [%2], 55h
    192     mov     BYTE [%1], 20h
     187    mov     ax, 80AAh
     188%%Again:
     189    mov     [%1], al        ; 0AAh
     190    shr     al, 1
     191    mov     [%2], al        ; 55h
     192    mov     [%1], ah        ; 80h/20h
     193    xor     ax, 0A0FFh
     194    jns     SHORT %%Again
    193195%endmacro
    194196
     
    215217WriteSdpEnableCommandFor2864mod:
    216218    ENABLE_SDP 155Ch, 0AA3h
    217     jmp     ReturnFromSdpCommand
     219    jmp     SHORT ReturnFromSdpCommand
    218220
    219221ALIGN JUMP_ALIGN
    220222WriteSdpEnableCommandFor28256or28512:
    221223    ENABLE_SDP 5555h, 2AAAh
    222     jmp     ReturnFromSdpCommand
     224    jmp     SHORT ReturnFromSdpCommand
    223225
    224226
     
    241243WriteSdpDisableCommandFor28256or28512:
    242244    DISABLE_SDP 5555h, 2AAAh
    243 DoNotWriteAnySdpCommand:
    244     jmp     SHORT ReturnFromSdpCommand
    245 
    246 
    247 ;--------------------------------------------------------------------
    248 ; WriteNextChangedByteFromPageToEeprom
    249 ;   Parameters:
     245    jmp     SHORT ReturnFromSdpCommand
     246
     247DoNotWriteAnySdpCommand EQU ReturnFromSdpCommand
     248
     249
     250;--------------------------------------------------------------------
     251; WriteAllChangedBytesFromPageToEeprom
     252;   Parameters:
     253;       AX:     Offset to SDP command function
     254;       BX:     Offset to next destination byte
    250255;       CX:     Number of bytes left to write
    251 ;       DX:     Offset to SDP command function
    252 ;       BX:     Offset to next destination byte
    253256;       SI:     Offset to next source byte
    254257;       ES:DI:  Ptr to next comparison byte
     
    258261;               Cleared if page written successfully
    259262;   Corrupts registers:
    260 ;       AX, BX, CX, SI, DI, DS, ES
     263;       AX, BX, CX, DX, SI, DI, DS, ES
    261264;--------------------------------------------------------------------
    262265ALIGN JUMP_ALIGN
    263266WriteAllChangedBytesFromPageToEeprom:
    264     mov     ax, [bp+FLASHVARS.fpNextSourcePage+2]       ; AX = Source segment
     267    mov     dx, [bp+FLASHVARS.fpNextSourcePage+2]       ; DX = Source segment
    265268    mov     ds, [bp+FLASHVARS.fpNextDestinationPage+2]  ; DS = EEPROM segment
    266269    cli                     ; Disable interrupts
    267     jmp     dx              ; Write SDP command (once to the beginning of page)
     270    jmp     ax              ; Write SDP command (once to the beginning of page)
    268271ALIGN JUMP_ALIGN
    269272ReturnFromSdpCommand:
    270     mov     ds, ax          ; DS:SI now points to source byte
     273    mov     ds, dx          ; DS:SI now points to source byte
    271274
    272275ALIGN JUMP_ALIGN
     
    278281    mov     ds, [bp+FLASHVARS.fpNextDestinationPage+2]  ; DS:BX now points to EEPROM
    279282    mov     [bx], al        ; Write byte to EEPROM
    280     mov     ds, [bp+FLASHVARS.fpNextSourcePage+2]       ; Restore DS
     283    mov     ds, dx          ; Restore DS
    281284    mov     [bp+FLASHVARS.wLastOffsetWritten], bx
    282285    mov     [bp+FLASHVARS.bLastByteWritten], al
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm

    r526 r568  
    185185    pop     ds
    186186
    187     cmp     word [cs:g_cfgVars+CFGVARS.wEepromSegment], 0
    188     jnz     .alreadySet
     187    cmp     WORD [cs:g_cfgVars+CFGVARS.wEepromSegment], 0
     188    jne     .alreadySet
    189189
    190190    push    es
     
    198198    mov     ax, DEFAULT_EEPROM_SEGMENT
    199199.storeEepromSegment:
    200     mov     word [cs:g_cfgVars+CFGVARS.wEepromSegment], ax
     200    mov     WORD [cs:g_cfgVars+CFGVARS.wEepromSegment], ax
    201201
    202202.alreadySet:
Note: See TracChangeset for help on using the changeset viewer.