Changeset 584 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src


Ignore:
Timestamp:
Apr 25, 2015, 7:17:41 PM (10 years ago)
Author:
Tomi Tilli
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • Added support for Lo-tech 8-bit IDE Adapter (untested)
Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm

    r545 r584  
    8989
    9090%ifdef MODULE_8BIT_IDE
    91     ; Enable 8-bit PIO mode for 8-bit ATA and XT-CF
    9291    push    si
     92
     93    ; Enable 8-bit PIO for DEVICE_8BIT_ATA (no need to verify device type here)
    9394    call    AH9h_Enable8bitModeForDevice8bitAta
     95
     96    ; Set XT-CF mode. No need to check here if device is XT-CF or not.
    9497%ifdef MODULE_8BIT_IDE_ADVANCED
    95     mov     al, XTCF_8BIT_PIO_MODE      ; initialise with most basic transfer mode
    96     call    AH9h_SetModeFromALtoXTCF
     98    call    AH1Eh_GetCurrentXTCFmodeToAX    ; Reads from DPT_ATA.bDevice that we just stored
     99    call    AH9h_SetModeFromALtoXTCF        ; Enables/disables 8-bit mode when necessary
    97100%endif ; MODULE_8BIT_IDE_ADVANCED
    98101    pop     si
     
    106109
    107110    ; Clean stack and return
    108 .FailedToSet8bitMode:
    109111    lea     sp, [bp+SIZE_OF_IDEPACK_WITHOUT_INTPACK]    ; This assumes BP hasn't changed between Idepack_FakeToSSBP and here
    110112    pop     bp
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm

    r568 r584  
    350350        dw      IdePioBlock_ReadFromXtideRev1       ; 3, DEVICE_8BIT_XTIDE_REV1
    351351        dw      IdePioBlock_ReadFrom16bitDataPort   ; 4, DEVICE_8BIT_XTIDE_REV2
     352%ifdef MODULE_8BIT_IDE_ADVANCED
    352353        dw      IdePioBlock_ReadFrom8bitDataPort    ; 5, DEVICE_8BIT_XTCF_PIO8
    353354        dw      IdePioBlock_ReadFrom16bitDataPort   ; 6, DEVICE_8BIT_XTCF_PIO8_WITH_BIU_OFFLOAD
    354 %ifdef MODULE_8BIT_IDE_ADVANCED
    355         dw      IdeDmaBlock_ReadFromXTCF            ; 7, DEVICE_8BIT_XTCF_DMA
     355        dw      IdePioBlock_ReadFrom16bitDataPort   ; 7, DEVICE_8BIT_XTCF_PIO16_WITH_BIU_OFFLOAD
     356        dw      IdeDmaBlock_ReadFromXTCF            ; 8, DEVICE_8BIT_XTCF_DMA
    356357%endif ; MODULE_8BIT_IDE_ADVANCED
    357358%endif ; MODULE_8BIT_IDE
     
    365366        dw      IdePioBlock_WriteToXtideRev1        ; 3, DEVICE_8BIT_XTIDE_REV1
    366367        dw      IdePioBlock_WriteToXtideRev2        ; 4, DEVICE_8BIT_XTIDE_REV2
     368%ifdef MODULE_8BIT_IDE_ADVANCED
    367369        dw      IdePioBlock_WriteTo8bitDataPort     ; 5, DEVICE_8BIT_XTCF_PIO8
    368370        dw      IdePioBlock_WriteTo16bitDataPort    ; 6, DEVICE_8BIT_XTCF_PIO8_WITH_BIU_OFFLOAD
    369 %ifdef MODULE_8BIT_IDE_ADVANCED
    370         dw      IdeDmaBlock_WriteToXTCF             ; 7, DEVICE_8BIT_XTCF_DMA
     371        dw      IdePioBlock_WriteTo16bitDataPort    ; 7, DEVICE_8BIT_XTCF_PIO16_WITH_BIU_OFFLOAD
     372        dw      IdeDmaBlock_WriteToXTCF             ; 8, DEVICE_8BIT_XTCF_DMA
    371373%endif ; MODULE_8BIT_IDE_ADVANCED
    372374%endif ; MODULE_8BIT_IDE
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm

    r567 r584  
    111111    ;       Selected transfer mode is stored in BIOS variable (DPT_ATA.bDevice).
    112112
    113     ; Note that when selecting 'DEVICE_8BIT_PIO_MODE_WITH_BIU_OFFLOAD' mode,
     113    ; Note that when selecting 'DEVICE_8BIT_XTCF_PIO8_WITH_BIU_OFFLOAD' mode,
    114114    ; the ATA device (i.e. CompactFlash card) will operate in 8-bit mode, but
    115115    ; data will be transferred from its data register using 16-bit CPU instructions
     
    134134    dec     ax                      ; XTCF_8BIT_PIO_MODE_WITH_BIU_OFFLOAD = 1
    135135    jz      SHORT .Set8bitPioModeWithBIUOffload
     136    dec     ax
     137    jz      SHORT .Set16bitPioModeWithBIUOffload
    136138
    137139    ; XTCF_DMA_MODE = 2 (allow 3 as well for more optimized code)
     
    144146    mov     al, XTCF_DMA_MODE_MAX_BLOCK_SIZE
    145147    jmp     SHORT AH24h_SetBlockSize
     148
     149.Set16bitPioModeWithBIUOffload:
     150    pop     bx                              ; Do not enable 8-bit PIO...
     151    ePUSH_T bx, AH23h_Disable8bitPioMode    ; ...disable it instead
     152    mov     al, DEVICE_8BIT_XTCF_PIO16_WITH_BIU_OFFLOAD
     153    SKIP2B  bx
    146154
    147155.Set8bitPioMode:
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH23h_HFeatures.asm

    r526 r584  
    7878;--------------------------------------------------------------------
    7979; AH23h_Enable8bitPioMode
     80; AH23h_Disable8bitPioMode
    8081;   Parameters:
    8182;       DS:DI:  Ptr to DPT (in RAMVARS segment)
     
    9192    mov     si, FEATURE_ENABLE_8BIT_PIO_TRANSFER_MODE
    9293    jmp     SHORT AH23h_SetControllerFeatures
     94AH23h_Disable8bitPioMode:
     95    mov     si, FEATURE_DISABLE_8BIT_PIO_TRANSFER_MODE
     96    call    AH23h_SetControllerFeatures
     97    xor     ah, ah          ; Clear error since modern drives might not understand the command and are
     98    ret                     ; always in 16-bit mode anyway
    9399%endif
  • trunk/XTIDE_Universal_BIOS/Src/Main.asm

    r567 r584  
    136136%ifdef MODULE_8BIT_IDE_ADVANCED
    137137    at  ROMVARS.ideVars0+IDEVARS.wBasePort,             dw  DEVICE_XTIDE_DEFAULT_PORT       ; Controller Command Block base port
    138     at  ROMVARS.ideVars0+IDEVARS.bDevice,               db  DEVICE_8BIT_XTCF_PIO8
     138    at  ROMVARS.ideVars0+IDEVARS.bDevice,               db  XTCF_8BIT_PIO_MODE_WITH_BIU_OFFLOAD
    139139%else
    140140    at  ROMVARS.ideVars0+IDEVARS.wBasePort,             dw  DEVICE_XTIDE_DEFAULT_PORT       ; Controller Command Block base port
Note: See TracChangeset for help on using the changeset viewer.