Changeset 443 in xtideuniversalbios


Ignore:
Timestamp:
Aug 25, 2012, 2:48:40 PM (12 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Offset to ATA-ID buffer will no longer get corrupted when trying to enable 8-bit mode for XT-CF.
  • Optimized A0<->A3 swapping a bit.
Location:
trunk/XTIDE_Universal_BIOS
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Inc/RamVars.inc

    r433 r443  
    118118endstruc
    119119
    120 EXTRA_BYTES_FOR_INTPACK     EQU (IDEPACK_size - INTPACK_size)
     120SIZE_OF_IDEPACK_WITHOUT_INTPACK     EQU (IDEPACK_size - INTPACK_size)
    121121
    122122
  • trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm

    r400 r443  
    8989;       CF:     Cleared if success, Set if error
    9090;   Corrupts registers:
    91 ;       AL, BL, CX, DX, SI, DI, ES
     91;       AL, BX, CX, DX, SI, DI, ES
    9292;--------------------------------------------------------------------
    9393%ifdef MODULE_SERIAL    ; IDE + Serial
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm

    r442 r443  
    6363;       CF:     Cleared if success, Set if error
    6464;   Corrupts registers:
    65 ;       AL, BL, CX, DX, SI, DI, ES
     65;       AL, BX, CX, DX, SI, DI, ES
    6666;--------------------------------------------------------------------
    6767IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH:
     
    7474    call    IdeDPT_StoreDeviceTypeFromIdevarsInCSBPtoDPTinDSDI
    7575
    76     ; Wait until drive motors have reached max speed
     76    ; Wait until drive motors have reached full speed
    7777    cmp     bp, BYTE ROMVARS.ideVars0       ; First controller?
    7878    jne     SHORT .SkipLongWaitSinceDriveIsNotPrimaryMaster
     
    8888%ifdef MODULE_8BIT_IDE
    8989    ; Enable 8-bit PIO mode for Lo-tech XT-CF
     90    push    si
    9091    call    AH9h_Enable8bitPioModeForXTCF
     92    pop     si
    9193    jc      SHORT .FailedToSet8bitMode
    9294%endif
     
    100102    ; Clean stack and return
    101103.FailedToSet8bitMode:
    102     lea     sp, [bp+EXTRA_BYTES_FOR_INTPACK]    ; This assumes BP hasn't changed between Idepack_FakeToSSBP and here
     104    lea     sp, [bp+SIZE_OF_IDEPACK_WITHOUT_INTPACK]    ; This assumes BP hasn't changed between Idepack_FakeToSSBP and here
    103105    pop     bp
    104106    ret
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIO.asm

    r414 r443  
    163163    ; Exchange address lines A0 and A3 from DL
    164164    add     dx, [cs:bx]                         ; DX now has port address
    165     mov     bl, dl
    166     mov     bh, MASK_A3_AND_A0_ADDRESS_LINES
    167     and     bh, bl                              ; BH = 0, 1, 8 or 9, we can ignore 0 and 9
    168     jz      SHORT .ReturnTranslatedPortInDX     ; Jump out since DH is 0
    169     xor     bh, MASK_A3_AND_A0_ADDRESS_LINES
    170     jz      SHORT .ReturnTranslatedPortInDX     ; Jump out since DH was 9
    171     and     dl, ~MASK_A3_AND_A0_ADDRESS_LINES
    172     or      dl, bh                              ; Address lines now reversed
     165    mov     bl, dl                              ; Port low byte to BL
     166    and     bl, MASK_A3_AND_A0_ADDRESS_LINES    ; Clear all bits except A0 and A3
     167    jz      SHORT .ReturnTranslatedPortInDX     ; A0 and A3 both zeroes, no change needed
     168    cmp     bl, MASK_A3_AND_A0_ADDRESS_LINES
     169    je      SHORT .ReturnTranslatedPortInDX     ; A0 and A3 both ones, no change needed
     170    xor     dl, MASK_A3_AND_A0_ADDRESS_LINES    ; Invert A0 and A3
    173171.ReturnTranslatedPortInDX:
    174172    ret
  • trunk/XTIDE_Universal_BIOS/Src/Device/Idepack.asm

    r421 r443  
    3232Idepack_FakeToSSBP:
    3333    pop     ax
    34     sub     sp, BYTE EXTRA_BYTES_FOR_INTPACK
     34    sub     sp, BYTE SIZE_OF_IDEPACK_WITHOUT_INTPACK
    3535    mov     bp, sp
    3636    jmp     ax
     
    161161
    162162    ; Device Control byte with interrupts disabled
    163     call    AccessDPT_GetDeviceControlByteToAL
    164     or      al, FLG_DEVCONTROL_nIEN     ; Disable interrupt
    165     mov     [bp+IDEPACK.bDeviceControl], al
     163    mov     BYTE [bp+IDEPACK.bDeviceControl], FLG_DEVCONTROL_nIEN
    166164
    167165    jmp     Device_OutputCommandWithParameters
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm

    r421 r443  
    9090    sti                                 ; Enable interrupts
    9191    cld                                 ; String instructions to increment pointers
    92     CREATE_FRAME_INTPACK_TO_SSBP    EXTRA_BYTES_FOR_INTPACK
     92    CREATE_FRAME_INTPACK_TO_SSBP    SIZE_OF_IDEPACK_WITHOUT_INTPACK
    9393    call    RamVars_GetSegmentToDS
    9494
     
    264264    or      BYTE [bp+IDEPACK.intpack+INTPACK.flags+1], (FLG_FLAGS_IF>>8)
    265265    mov     sp, bp  ; This makes possible to exit anytime, no matter what is on stack
    266     RESTORE_FRAME_INTPACK_FROM_SSBP     EXTRA_BYTES_FOR_INTPACK
     266    RESTORE_FRAME_INTPACK_FROM_SSBP     SIZE_OF_IDEPACK_WITHOUT_INTPACK
    267267
    268268
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm

    r439 r443  
    262262;   Parameters:
    263263;       DS:DI:  Ptr to DPT
     264;       SS:BP:  Ptr to IDEPACK
    264265;   Returns:
    265266;       AH:     Int 13h return status
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm

    r431 r443  
    119119    call    Idepack_FakeToSSBP
    120120    call    AH0h_ResetAllOurHardDisksAtTheEndOfDriveInitialization
    121     add     sp, BYTE EXTRA_BYTES_FOR_INTPACK
     121    add     sp, BYTE SIZE_OF_IDEPACK_WITHOUT_INTPACK
    122122    ret
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm

    r422 r443  
    6262ALIGN JUMP_ALIGN
    6363AccessDPT_GetDriveSelectByteForEbiosToAL:
    64     mov     al, [di+DPT.wFlags]
     64    mov     al, [di+DPT.bFlagsLow]
    6565    ; Fall to GetDriveSelectByteForAssistedLBAtoAL
    6666%endif ; MODULE_EBIOS
Note: See TracChangeset for help on using the changeset viewer.