Changeset 158 in xtideuniversalbios for trunk


Ignore:
Timestamp:
May 2, 2011, 9:41:51 AM (14 years ago)
Author:
Tomi Tilli
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • Optimized few bytes.
Location:
trunk/XTIDE_Universal_BIOS
Files:
19 edited

Legend:

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

    r152 r158  
    88struc DPT   ; 8 bytes
    99    ; General Disk Parameter Table related
    10     .wFlags                     resb    2
     10    .wFlags:
     11    .bFlagsLow                  resb    1
     12    .bFlagsHigh                 resb    1
    1113    .bIdevarsOffset             resb    1   ; Offset to IDEVARS for this drive
    1214
     
    3537
    3638
    37 ; Bit definitions for DPT.wFlags
    38 MASK_DPT_CHS_SHIFT_COUNT        EQU (7<<0)  ; Bits 0...3, P-CHS to L-CHS bit shift count (0...4)
    39 FLG_DPT_SLAVE                   EQU FLG_DRVNHEAD_DRV    ; (1<<4), Drive is slave drive
    40 MASK_DPT_ADDRESSING_MODE        EQU (3<<5)  ; Bits 5..6, Addressing Mode (bit 6 == FLG_DRVNHEAD_LBA)
    41 FLG_DPT_ENABLE_IRQ              EQU (1<<7)
    42 FLG_DPT_REVERSED_A0_AND_A3      EQU (1<<8)  ; XTIDE mod, Address lines 0 and 3 reversed
    43 FLG_DPT_SERIAL_DEVICE           EQU (1<<9)  ; Serial Port Device
    44 FLG_DPT_BLOCK_MODE_SUPPORTED    EQU (1<<10) ; Use block transfer commands
    45 FLG_DPT_INTERRUPT_IN_SERVICE    EQU (1<<11) ; Set when waiting for IRQ
    46 FLG_DPT_RESET_nDRDY             EQU (1<<12) ; Drive ready to accept commands
    47 FLG_DPT_RESET_nINITPRMS         EQU (1<<13) ; Initialize Device Parameters successfull
    48 FLG_DPT_RESET_nRECALIBRATE      EQU (1<<14) ; Recalibrate successfull
    49 FLG_DPT_RESET_nSETBLOCK         EQU (1<<15) ; Initialize Block Mode successfull
    50 MASK_DPT_RESET                  EQU 0F000h
     39; Bit definitions for DPT.bFlagsLow
     40MASKL_DPT_CHS_SHIFT_COUNT       EQU (7<<0)  ; Bits 0...3, P-CHS to L-CHS bit shift count (0...4)
     41FLGL_DPT_SLAVE                  EQU FLG_DRVNHEAD_DRV    ; (1<<4), Drive is slave drive
     42MASKL_DPT_ADDRESSING_MODE       EQU (3<<5)  ; Bits 5..6, Addressing Mode (bit 6 == FLG_DRVNHEAD_LBA)
     43FLGL_DPT_ENABLE_IRQ             EQU (1<<7)
     44
     45; Bit definitions for DPT.bFlagsHigh
     46FLGH_DPT_REVERSED_A0_AND_A3     EQU (1<<0)  ; XTIDE mod, Address lines 0 and 3 reversed
     47FLGH_DPT_SERIAL_DEVICE          EQU (1<<1)  ; Serial Port Device
     48FLGH_DPT_BLOCK_MODE_SUPPORTED   EQU (1<<2)  ; Use block transfer commands
     49FLGH_DPT_INTERRUPT_IN_SERVICE   EQU (1<<3)  ; Set when waiting for IRQ
     50FLGH_DPT_RESET_nDRDY            EQU (1<<4)  ; Drive ready to accept commands
     51FLGH_DPT_RESET_nINITPRMS        EQU (1<<5)  ; Initialize Device Parameters successfull
     52FLGH_DPT_RESET_nRECALIBRATE     EQU (1<<6)  ; Recalibrate successfull
     53FLGH_DPT_RESET_nSETBLOCK        EQU (1<<7)  ; Initialize Block Mode successfull
     54MASKH_DPT_RESET                 EQU 0F0h
    5155
    5256; Addressing modes for DPT.wFlags
  • trunk/XTIDE_Universal_BIOS/Inc/IdeRegisters.inc

    r150 r158  
    1919STATUS_REGISTER_in              EQU     7       ; Read only
    2020COMMAND_REGISTER_out            EQU     7       ; Write only
    21 XTIDE_DATA_HIGH_REGISTER        EQU     8       ; Non-standard (actually first Control Block reg)
     21;XTIDE_DATA_HIGH_REGISTER       EQU     8       ; Non-standard (actually first Control Block reg)
    2222
    2323; IDE Register offsets from Control Block base port
     
    5858; Bit definitions for IDE Device Control Register
    5959; Bit 0 must be zero, unlisted bits are reserved.
    60 FLG_DEVCONTROL_HOB      EQU     (1<<7)  ; High Order Byte (ATA6+)
     60;FLG_DEVCONTROL_HOB     EQU     (1<<7)  ; High Order Byte (ATA6+)
    6161;FLG_DEVCONTROL_O8H     EQU     (1<<3)  ; Drive has more than 8 heads (pre-ATA only, 1 on ATA1, reserved on ATA2+)
    6262FLG_DEVCONTROL_SRST     EQU     (1<<2)  ; Software Reset
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrintCfg.asm

    r150 r158  
    6969PushBlockMode:
    7070    mov     ax, 1
    71     test    WORD [di+DPT.wFlags], FLG_DPT_BLOCK_MODE_SUPPORTED
     71    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
    7272    jz      SHORT .PushBlockSizeFromAX
    7373    mov     al, [di+DPT_ATA.bSetBlock]
     
    137137;--------------------------------------------------------------------
    138138PushResetStatus:
    139     mov     ax, [di+DPT.wFlags]
    140     and     ax, MASK_DPT_RESET
     139    mov     al, [di+DPT.bFlagsHigh]
     140    and     ax, MASKH_DPT_RESET
    141141    push    ax
    142142
  • trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm

    r152 r158  
    1616;--------------------------------------------------------------------
    1717Device_FinalizeDPT:
    18     test    WORD [di+DPT.wFlags], FLG_DPT_SERIAL_DEVICE
     18    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE
    1919    jnz     SHORT ReturnSuccessForSerialPort
    2020    jmp     IdeDPT_Finalize
     
    3434;--------------------------------------------------------------------
    3535Device_ResetMasterAndSlaveController:
    36     test    WORD [di+DPT.wFlags], FLG_DPT_SERIAL_DEVICE
     36    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE
    3737    jnz     SHORT ReturnSuccessForSerialPort
    3838    jmp     IdeCommand_ResetMasterAndSlaveController
     
    7676ALIGN JUMP_ALIGN
    7777Device_OutputCommandWithParameters:
    78     test    WORD [di+DPT.wFlags], FLG_DPT_SERIAL_DEVICE
     78    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE
    7979    jnz     SHORT .OutputCommandToSerialPort
    8080    jmp     IdeCommand_OutputWithParameters
     
    9797ALIGN JUMP_ALIGN
    9898Device_SelectDrive:
    99     test    WORD [di+DPT.wFlags], FLG_DPT_SERIAL_DEVICE
     99    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE
    100100    jnz     SHORT ReturnSuccessForSerialPort
    101101    jmp     IdeCommand_SelectDrive
     
    168168;--------------------------------------------------------------------
    169169TranslateRegisterAddressInDLifNecessaryThenJumpToBX:
    170     test    WORD [di+DPT.wFlags], FLG_DPT_REVERSED_A0_AND_A3
     170    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_REVERSED_A0_AND_A3
    171171    jz      SHORT .JumpToIoFunctionInSI
    172172
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm

    r157 r158  
    5454    ; Create fake DPT to be able to use Device.asm functions
    5555    call    FindDPT_ForNewDriveToDSDI
    56     xor     ax, ax
     56    eMOVZX  ax, bh
    5757    cmp     BYTE [cs:bp+IDEVARS.bDevice], DEVICE_XTIDE_WITH_REVERSED_A3_AND_A0
    58     eCMOVE  ax, FLG_DPT_REVERSED_A0_AND_A3
    59     or      al, bh
     58    eCMOVE  ah, FLGH_DPT_REVERSED_A0_AND_A3
    6059    mov     [di+DPT.wFlags], ax
    6160    mov     [di+DPT.bIdevarsOffset], bp
     
    6564    cmp     bp, BYTE ROMVARS.ideVars0
    6665    jne     SHORT .SkipLongWaitSinceDriveIsNotPrimaryMaster
    67     test    bh, FLG_DRVNHEAD_DRV
     66    test    al, FLG_DRVNHEAD_DRV
    6867    jnz     SHORT .SkipLongWaitSinceDriveIsNotPrimaryMaster
    6968    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_MOTOR_STARTUP, FLG_STATUS_BSY)
     
    8281
    8382    ; Clean stack and return
    84     lea     sp, [bp+SIZE_OF_FAKE_IDEPACK]   ; This assumes BP hasn't changed between Idepack_FakeToSSBP and here
     83    lea     sp, [bp+EXTRA_BYTES_FOR_INTPACK]    ; This assumes BP hasn't changed between Idepack_FakeToSSBP and here
    8584    pop     bp
    8685    ret
     
    103102ALIGN JUMP_ALIGN
    104103IdeCommand_OutputWithParameters:
    105     push    bx                          ; Store status register bits to poll
     104    push    bx                      ; Store status register bits to poll
    106105
    107106    ; Select Master or Slave drive and output head number or LBA28 top bits
     
    110109
    111110    ; Output Device Control Byte to enable or disable interrupts
    112     mov     dl, DEVICE_CONTROL_REGISTER_out
    113111    mov     al, [bp+IDEPACK.bDeviceControl]
    114     test    al, FLG_DEVCONTROL_nIEN
     112    test    al, FLG_DEVCONTROL_nIEN ; Interrupts disabled?
    115113    jnz     SHORT .DoNotSetInterruptInServiceFlag
    116     or      WORD [di+DPT.wFlags], FLG_DPT_INTERRUPT_IN_SERVICE
     114
     115    ; Clear Task Flag and set Interrupt In-Service Flag
     116    or      BYTE [di+DPT.bFlagsHigh], FLGH_DPT_INTERRUPT_IN_SERVICE
    117117    push    ds
    118     LOAD_BDA_SEGMENT_TO ds, cx, !       ; Also zero CX
    119     mov     [BDA.bHDTaskFlg], al
     118    LOAD_BDA_SEGMENT_TO ds, dx, !   ; Also zero DX
     119    mov     [BDA.bHDTaskFlg], dl
    120120    pop     ds
    121121.DoNotSetInterruptInServiceFlag:
     122    mov     dl, DEVICE_CONTROL_REGISTER_out
    122123    call    Device_OutputALtoIdeControlBlockRegisterInDL
    123124
     
    143144
    144145    ; Wait until command completed
    145     pop     bx                          ; Pop status and timeout for polling
    146     cmp     bl, FLG_STATUS_DRQ          ; Data transfer started?
    147     je      SHORT .StartDataTransfer
     146    pop     bx                      ; Pop status and timeout for polling
     147    cmp     bl, FLG_STATUS_DRQ      ; Data transfer started?
     148    je      SHORT IdeTransfer_StartWithCommandInAL
    148149    test    BYTE [bp+IDEPACK.bDeviceControl], FLG_DEVCONTROL_nIEN
    149150    jz      SHORT .WaitForIrqOrRdy
     
    153154.WaitForIrqOrRdy:
    154155    jmp     IdeWait_IRQorStatusFlagInBLwithTimeoutInBH
    155 ALIGN JUMP_ALIGN
    156 .StartDataTransfer:
    157     jmp     IdeTransfer_StartWithCommandInAL
    158156
    159157.DriveNotReady:
     
    179177    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_BSY, FLG_STATUS_BSY)
    180178    cmp     BYTE [bp+IDEPACK.bCommand], COMMAND_IDENTIFY_DEVICE
    181     eCMOVE  bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_IDENTIFY_DEVICE, FLG_STATUS_BSY)
     179    eCMOVE  bh, TIMEOUT_IDENTIFY_DEVICE
    182180    call    IdeWait_PollStatusFlagInBLwithTimeoutInBH
    183181    jc      SHORT ReturnSinceTimeoutWhenPollingBusy
     
    189187    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRDY, FLG_STATUS_DRDY)
    190188    cmp     BYTE [bp+IDEPACK.bCommand], COMMAND_IDENTIFY_DEVICE
    191     eCMOVE  bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_IDENTIFY_DEVICE, FLG_STATUS_DRDY)
     189    eCMOVE  bh, TIMEOUT_IDENTIFY_DEVICE
    192190    jmp     IdeWait_PollStatusFlagInBLwithTimeoutInBH
    193191
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeIrq.asm

    r152 r158  
    114114
    115115    ; Clear Interrupt In-Service Flag from DPT
    116     and     WORD [di+DPT.wFlags], ~FLG_DPT_INTERRUPT_IN_SERVICE
     116    and     BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_INTERRUPT_IN_SERVICE
    117117
    118118    ; Set Task Flag
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm

    r157 r158  
    166166; InitializePiovarsInSSBPwithSectorCountInAX
    167167;   Parameters:
    168 ;       AX:     Number of sectors to transfer (0=65536)
     168;       AX:     Number of sectors to transfer (1...65535)
    169169;       BX:     Offset to transfer function lookup table
    170170;       DS:DI:  Ptr to DPT (in RAMVARS segment)
     
    179179    ; Store number of blocks to transfer
    180180    eMOVZX  cx, BYTE [di+DPT_ATA.bSetBlock]     ; Block size in sectors
    181     xor     dx, dx
    182     test    ax, ax
    183     eCMOVZ  dl, 1       ; DX:AX = Sectors to transfer (1...65536)
     181    xor     dx, dx      ; DX:AX = Sectors to transfer (1...65535)
    184182    div     cx          ; AX = Full blocks to transfer
    185183    test    dx, dx
     
    197195
    198196    ; Get transfer function based on bus type
    199     xchg    ax, bx
     197    xchg    ax, bx                              ; Lookup table offset to AX
    200198    eMOVZX  bx, BYTE [di+DPT.bIdevarsOffset]    ; CS:BX now points to IDEVARS
    201199    mov     dx, [cs:bx+IDEVARS.wPort]           ; Load IDE Data port address
  • trunk/XTIDE_Universal_BIOS/Src/Device/Idepack.asm

    r155 r158  
    11; Project name  :   XTIDE Universal BIOS
    22; Description   :   Functions for managing IDEPACK struct.
    3 
    4 SIZE_OF_FAKE_IDEPACK        EQU     (IDEPACK_size - INTPACK_size)
    53
    64; Section containing code
     
    1816Idepack_FakeToSSBP:
    1917    pop     ax
    20     sub     sp, BYTE SIZE_OF_FAKE_IDEPACK
     18    sub     sp, BYTE EXTRA_BYTES_FOR_INTPACK
    2119    mov     bp, sp
    2220    jmp     ax
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm

    r150 r158  
    2222ALIGN JUMP_ALIGN
    2323AH24h_HandlerForSetMultipleBlocks:
    24     test    WORD [di+DPT.wFlags], FLG_DPT_BLOCK_MODE_SUPPORTED
     24    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
    2525    jnz     SHORT .TryToSetBlockMode
    2626    stc
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH2h_HRead.asm

    r155 r158  
    2828ALIGN JUMP_ALIGN
    2929AH2h_HandlerForReadDiskSectors:
    30     call    AH2h_ExitInt13hIfSectorCountInIntpackIsZero
     30    cmp     BYTE [bp+IDEPACK.intpack+INTPACK.al], 0
     31    je      SHORT AH2h_ExitInt13hSinceSectorCountInIntpackIsZero
     32
    3133    mov     ah, COMMAND_READ_SECTORS    ; Load sector mode command
    32     test    WORD [di+DPT.wFlags], FLG_DPT_BLOCK_MODE_SUPPORTED
     34    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
    3335    eCMOVNZ ah, COMMAND_READ_MULTIPLE   ; Load block mode command
    3436    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ)
     
    4446
    4547;--------------------------------------------------------------------
    46 ; AH2h_ExitInt13hIfSectorCountInIntpackIsZero
     48; AH2h_ExitInt13hSinceSectorCountInIntpackIsZero
    4749;   Parameters:
    48 ;       SS:BP:  Ptr to IDEPACK
    49 ;   Parameters on INTPACK:
    50 ;       AL:     Number of sectors to transfer (1...255)
     50;       Nothing
    5151;   Returns:
    52 ;       Nothing (does not return if error)
    53 ;   Corrupts registers:
    54 ;       Nothing
     52;       Jumps to Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    5553;--------------------------------------------------------------------
    56 ALIGN JUMP_ALIGN
    57 AH2h_ExitInt13hIfSectorCountInIntpackIsZero:
    58     cmp     BYTE [bp+IDEPACK.intpack+INTPACK.al], 0
    59     je      SHORT .InvalidSectorCount
    60     ret
    61 .InvalidSectorCount:
     54AH2h_ExitInt13hSinceSectorCountInIntpackIsZero:
    6255    mov     ah, RET_HD_INVALID
    6356    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH3h_HWrite.asm

    r155 r158  
    2727ALIGN JUMP_ALIGN
    2828AH3h_HandlerForWriteDiskSectors:
    29     call    AH2h_ExitInt13hIfSectorCountInIntpackIsZero
     29    cmp     BYTE [bp+IDEPACK.intpack+INTPACK.al], 0
     30    je      SHORT AH2h_ExitInt13hSinceSectorCountInIntpackIsZero
     31
    3032    mov     ah, COMMAND_WRITE_SECTORS   ; Load sector mode command
    31     test    WORD [di+DPT.wFlags], FLG_DPT_BLOCK_MODE_SUPPORTED
     33    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
    3234    eCMOVNZ ah, COMMAND_WRITE_MULTIPLE  ; Load block mode command
    3335    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ)
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH4h_HVerify.asm

    r155 r158  
    2626ALIGN JUMP_ALIGN
    2727AH4h_HandlerForVerifyDiskSectors:
    28     call    AH2h_ExitInt13hIfSectorCountInIntpackIsZero
     28    cmp     BYTE [bp+IDEPACK.intpack+INTPACK.al], 0
     29    je      SHORT AH2h_ExitInt13hSinceSectorCountInIntpackIsZero
     30
    2931    mov     ah, COMMAND_VERIFY_SECTORS
    3032    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRDY)
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm

    r157 r158  
    4646
    4747    ; Try to select drive and wait until ready
    48     or      WORD [di+DPT.wFlags], MASK_DPT_RESET        ; Everything uninitialized
     48    or      BYTE [di+DPT.bFlagsHigh], MASKH_DPT_RESET       ; Everything uninitialized
    4949    call    AccessDPT_GetDriveSelectByteToAL
    5050    mov     [bp+IDEPACK.bDrvAndHead], al
    5151    call    Device_SelectDrive
    5252    jc      SHORT .ReturnNotSuccessfull
    53     and     WORD [di+DPT.wFlags], ~FLG_DPT_RESET_nDRDY  ; Clear since success
     53    and     BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_RESET_nDRDY ; Clear since success
    5454
    5555    ; Initialize CHS parameters if LBA is not used
    5656    call    InitializeDeviceParameters
    5757    jc      SHORT .RecalibrateDrive
    58     and     WORD [di+DPT.wFlags], ~FLG_DPT_RESET_nINITPRMS
     58    and     BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_RESET_nINITPRMS
    5959
    6060    ; Recalibrate drive by seeking to cylinder 0
     
    6262    call    AH11h_RecalibrateDrive
    6363    jc      SHORT .InitializeBlockMode
    64     and     WORD [di+DPT.wFlags], ~FLG_DPT_RESET_nRECALIBRATE
     64    and     BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_RESET_nRECALIBRATE
    6565
    6666    ; Initialize block mode transfers
     
    6868    call    InitializeBlockMode
    6969    jc      SHORT .ReturnNotSuccessfull
    70     and     WORD [di+DPT.wFlags], ~FLG_DPT_RESET_nSETBLOCK  ; Keeps CF clear
     70    and     BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_RESET_nSETBLOCK ; Keeps CF clear
    7171
    7272.ReturnNotSuccessfull:
     
    9090InitializeDeviceParameters:
    9191    ; No need to initialize CHS parameters if LBA mode enabled
    92     test    BYTE [di+DPT.wFlags], FLG_DRVNHEAD_LBA  ; Clear CF
     92    test    BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA   ; Clear CF
    9393    jnz     SHORT ReturnSuccessSinceInitializationNotNeeded
    9494
     
    115115ALIGN JUMP_ALIGN
    116116InitializeBlockMode:
    117     test    WORD [di+DPT.wFlags], FLG_DPT_BLOCK_MODE_SUPPORTED  ; Clear CF
     117    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED ; Clear CF
    118118    jz      SHORT ReturnSuccessSinceInitializationNotNeeded
    119119
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Address.asm

    r155 r158  
    8989    ; (LCylinder << n) + (LHead / PHeadCount)
    9090    mov     dx, cx                  ; Copy L-CHS Cylinder number to DX
    91     mov     cl, [di+DPT.wFlags]     ; Load shift count
    92     and     cl, MASK_DPT_CHS_SHIFT_COUNT
     91    mov     cl, [di+DPT.bFlagsLow]  ; Load shift count
     92    and     cl, MASKL_DPT_CHS_SHIFT_COUNT
    9393    shl     dx, cl                  ; DX = LCylinder << n
    9494    add     ax, dx                  ; AX = P-CHS Cylinder number
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm

    r152 r158  
    115115    call    Idepack_FakeToSSBP
    116116    call    AH0h_ResetHardDisksHandledByOurBIOS
    117     add     sp, BYTE SIZE_OF_FAKE_IDEPACK
     117    add     sp, BYTE EXTRA_BYTES_FOR_INTPACK
    118118    ret
  • trunk/XTIDE_Universal_BIOS/Src/Main.asm

    r155 r158  
    157157; IDE Device support
    158158%include "IdeCommand.asm"
     159%include "IdeTransfer.asm"      ; Must be included after IdeCommand.asm
    159160%include "IdeDPT.asm"
    160161%include "IdeIO.asm"
    161162%include "IdeIrq.asm"
    162 %include "IdeTransfer.asm"
    163163%include "IdeWait.asm"
    164164%include "IdeError.asm"         ; Must be included after IdeWait.asm
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm

    r150 r158  
    3434AccessDPT_GetDeviceControlByteToAL:
    3535    xor     al, al
    36     test    BYTE [di+DPT.wFlags], FLG_DPT_ENABLE_IRQ
     36    test    BYTE [di+DPT.bFlagsLow], FLGL_DPT_ENABLE_IRQ
    3737    jnz     SHORT .EnableDeviceIrq
    3838    or      al, FLG_DEVCONTROL_nIEN ; Disable IRQ
     
    5252ALIGN JUMP_ALIGN
    5353AccessDPT_GetAddressingModeForWordLookToBX:
    54     mov     bl, [di+DPT.wFlags]
    55     and     bx, BYTE MASK_DPT_ADDRESSING_MODE
     54    mov     bl, [di+DPT.bFlagsLow]
     55    and     bx, BYTE MASKL_DPT_ADDRESSING_MODE
    5656    eSHR_IM bx, ADDRESSING_MODE_FIELD_POSITION-1
    5757    ret
     
    7272AccessDPT_GetLCHSfromPCHS:
    7373    xchg    ax, cx
    74     mov     cl, [di+DPT.wFlags]
    75     and     cl, MASK_DPT_CHS_SHIFT_COUNT    ; Load shift count
     74    mov     cl, [di+DPT.bFlagsLow]
     75    and     cl, MASKL_DPT_CHS_SHIFT_COUNT   ; Load shift count
    7676    mov     bx, [di+DPT.wPchsCylinders]     ; Load P-CHS cylinders
    7777    shr     bx, cl                          ; Shift to L-CHS cylinders
     
    115115    eMOVZX  bx, [di+DPT.bIdevarsOffset]         ; CS:BX points to IDEVARS
    116116    add     bx, BYTE IDEVARS.drvParamsMaster    ; CS:BX points to Master Drive DRVPARAMS
    117     test    BYTE [di+DPT.wFlags], FLG_DPT_SLAVE
     117    test    BYTE [di+DPT.bFlagsLow], FLGL_DPT_SLAVE
    118118    jz      SHORT .ReturnPointerToDRVPARAMS
    119119    add     bx, BYTE DRVPARAMS_size             ; CS:BX points to Slave Drive DRVPARAMS
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm

    r150 r158  
    6060    cmp     [cs:bp+IDEVARS.bIRQ], ah        ; Interrupts enabled?
    6161    jz      SHORT .StoreFlags               ;  If not, do not set interrupt flag
    62     or      al, FLG_DPT_ENABLE_IRQ
     62    or      al, FLGL_DPT_ENABLE_IRQ
    6363.StoreFlags:
    6464    mov     [di+DPT.wFlags], ax
     
    172172    cmp     BYTE [es:si+ATA1.bBlckSize], 1  ; Max block size in sectors
    173173    jbe     SHORT .BlockModeTransfersNotSupported
    174     or      WORD [di+DPT.wFlags], FLG_DPT_BLOCK_MODE_SUPPORTED
     174    or      BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
    175175.BlockModeTransfersNotSupported:
    176176    ; Fall to .StoreDeviceSpecificParameters
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm

    r152 r158  
    9898ALIGN JUMP_ALIGN
    9999IterateToSlaveAtPortCallback:
    100     test    BYTE [di+DPT.wFlags], FLG_DPT_SLAVE ; Clears CF
     100    test    BYTE [di+DPT.bFlagsLow], FLGL_DPT_SLAVE ; Clears CF
    101101    jnz     SHORT CompareBasePortAddress
    102102    ret     ; Wrong DPT
     
    104104ALIGN JUMP_ALIGN
    105105IterateToMasterAtPortCallback:
    106     test    BYTE [di+DPT.wFlags], FLG_DPT_SLAVE
     106    test    BYTE [di+DPT.bFlagsLow], FLGL_DPT_SLAVE
    107107    jnz     SHORT ReturnWrongDPT                ; Return if slave drive
    108108
     
    146146ALIGN JUMP_ALIGN
    147147IterateToDptWithInterruptInServiceFlagSet:
    148     test    WORD [di+DPT.wFlags], FLG_DPT_INTERRUPT_IN_SERVICE
     148    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_INTERRUPT_IN_SERVICE
    149149    jz      SHORT ReturnWrongDPT
    150150    stc                                     ; Set CF since wanted DPT
Note: See TracChangeset for help on using the changeset viewer.