Changeset 443 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Device


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/Src/Device
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.