Ignore:
Timestamp:
Feb 25, 2013, 4:23:09 PM (11 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • Reverted the changes to MenuEvents.inc done in r492 since they broke the F1 key function in XTIDECFG.
  • Added a tail-call optimized variant of the CALL_DISPLAY_LIBRARY macro (JMP_DISPLAY_LIBRARY).
  • Put a block size limit in AH1Eh_ChangeXTCFmodeBasedOnControlRegisterInAL. I think it's needed but if not, it's easy to remove.
  • Other optimizations and fixes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm

    r491 r505  
    102102    out     dx, al
    103103
     104    ; We always need to enable 8-bit mode since 16-bit mode is restored
     105    ; when controller is reset (AH=00h or 0Dh)
     106    ePUSH_T bx, AH23h_Enable8bitPioMode
     107
    104108    ; Convert Control Register Contents to device code
    105109    test    al, al
     
    108112    jae     SHORT .SetMemoryMappedMode
    109113
     114; We need to limit block size here. Consider this scenario;
     115; 1. While in PIO mode or memory mapped mode, the drive is set to do
     116;    block transfers larger than XTCF_DMA_MODE_MAX_BLOCK_SIZE.
     117; 2. A call is subsequently made to change device mode to DEVICE_8BIT_XTCF_DMA.
     118; 3. The call to AH24h_SetBlockSize fails but the change in device mode has been made.
     119
    110120    ; Set DMA Mode
    111121    mov     BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_DMA
    112122    mov     al, [di+DPT_ATA.bBlockSize]
    113     call    AH24h_SetBlockSize  ; AH=24h limits block size if necessary
    114     jmp     SHORT .Enable8bitPioMode
     123    MIN_U   al, XTCF_DMA_MODE_MAX_BLOCK_SIZE
     124    jmp     SHORT AH24h_SetBlockSize    ; Returns via AH23h_Enable8bitPioMode
    115125
    116126.SetMemoryMappedMode:
    117     mov     BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_MEMMAP
    118     jmp     SHORT .Enable8bitPioMode
     127    mov     al, DEVICE_8BIT_XTCF_MEMMAP
     128    SKIP2B  bx
    119129
    120130.Set8bitPioMode:
    121     mov     BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_PIO8
    122     ; Fall to .Enable8bitPioMode
    123 
    124     ; We always need to enable 8-bit mode since 16-bit mode is restored
    125     ; when controller is reset (AH=00h or 0Dh)
    126 .Enable8bitPioMode:
    127     jmp     AH23h_Enable8bitPioMode
     131    mov     al, DEVICE_8BIT_XTCF_PIO8
     132    mov     [di+DPT_ATA.bDevice], al
     133    ret     ; Via AH23h_Enable8bitPioMode
    128134
    129135
Note: See TracChangeset for help on using the changeset viewer.