Changeset 294 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization


Ignore:
Timestamp:
Mar 4, 2012, 1:35:10 AM (12 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Commit 2/2 (BIOS):

  • Fixed a bug in AH1h_HStatus.asm.
  • Minor optimizations.
  • Fixed spelling and did some cleaning.
Location:
trunk/XTIDE_Universal_BIOS/Src/Initialization
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm

    r269 r294  
    2626    mov     cx, g_szDetectMaster
    2727    mov     bh, MASK_DRVNHEAD_SET                               ; Select Master drive
    28     call    StartDetectionWithDriveSelectByteInBHandStringInAX  ; Detect and create DPT + BOOTNFO
     28    call    StartDetectionWithDriveSelectByteInBHandStringInCX  ; Detect and create DPT + BOOTNFO
    2929
    3030    mov     cx, g_szDetectSlave
    3131    mov     bh, MASK_DRVNHEAD_SET | FLG_DRVNHEAD_DRV
    32     call    StartDetectionWithDriveSelectByteInBHandStringInAX
     32    call    StartDetectionWithDriveSelectByteInBHandStringInCX
    3333
    3434    pop     cx
     
    7272    mov     al, [es:BDA.bHDCount]
    7373    add     cl, al                      ; Add our drives to the system count
    74     mov     [es:BDA.bHDCount], cl       
    75     or      al, 80h                     ; Or in hard disk flag     
    76     mov     [RAMVARS.bFirstDrv], al     ; Store first drive number     
    77 
    78 .AddFloppies:       
    79 %ifdef MODULE_SERIAL_FLOPPY     
     74    mov     [es:BDA.bHDCount], cl
     75    or      al, 80h                     ; Or in hard disk flag
     76    mov     [RAMVARS.bFirstDrv], al     ; Store first drive number
     77
     78.AddFloppies:
     79%ifdef MODULE_SERIAL_FLOPPY
    8080;----------------------------------------------------------------------
    8181;
     
    8484    dec     ch
    8585    mov     al, ch
    86     js      .NoFloppies                     ; if no drives are present, we store 0ffh       
     86    js      .NoFloppies                     ; if no drives are present, we store 0ffh
    8787
    8888    call    FloppyDrive_GetCountFromBIOS_or_BDA
     
    9292    add     al, ch                          ; Add our drives to existing drive count
    9393    cmp     al, 3                           ; For BDA, max out at 4 drives (ours is zero based)
    94     jl      .MaxBDAFloppiesExceeded
    95     mov     al, 3                           
     94    jb      .MaxBDAFloppiesExceeded
     95    mov     al, 3
    9696.MaxBDAFloppiesExceeded:
    9797    eROR_IM al, 2                           ; move to bits 6-7
    9898    inc     ax                              ; low order bit, indicating floppy drive exists
    9999
    100     mov     ah, [es:BDA.wEquipment]         ; Load Equipment WORD low byte 
     100    mov     ah, [es:BDA.wEquipment]         ; Load Equipment WORD low byte
    101101    and     ah, 03eh                        ; Mask off drive number and drives present bit
    102102    or      al, ah                          ; Or in new values
     
    111111    shr     ch, 1                           ; number of drives, 1 or 2 only, to CF flag (clear=1, set=2)
    112112    rcl     al, 1                           ; starting drive number in upper 7 bits, number of drives in low bit
    113 .NoFloppies:   
     113.NoFloppies:
    114114    mov     [RAMVARS.xlateVars+XLATEVARS.bFlopCntAndFirst], al
    115115%endif
    116        
     116
    117117    ret
    118118
    119 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS       
     119%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
    120120    %if FLG_ROMVARS_SERIAL_SCANDETECT != 8
    121121        %error "DetectDrives is currently coded to assume that FLG_ROMVARS_SERIAL_SCANDETECT is the same bit as the ALT key code in the BDA.  Changes in the code will be needed if these values are no longer the same."
     
    125125
    126126;--------------------------------------------------------------------
    127 ; StartDetectionWithDriveSelectByteInBHandStringInAX
     127; StartDetectionWithDriveSelectByteInBHandStringInCX
    128128;   Parameters:
    129129;       BH:     Drive Select byte for Drive and Head Register
     
    137137;       AX, BX, CX, DX, SI, DI
    138138;--------------------------------------------------------------------
    139 StartDetectionWithDriveSelectByteInBHandStringInAX:
    140     call    DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP
     139StartDetectionWithDriveSelectByteInBHandStringInCX:
     140    call    DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP
    141141    ; Fall to .ReadAtaInfoFromHardDisk
    142142
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm

    r285 r294  
    2828
    2929;--------------------------------------------------------------------
    30 ; DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP
     30; DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP
    3131;   Parameters:
    3232;       CS:CX:  Ptr to "Master" or "Slave" string
     
    3838;       AX, SI, DI, CX
    3939;--------------------------------------------------------------------
    40 DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP:
     40DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP:
    4141    mov     ax, [cs:bp+IDEVARS.wPort]       ; for IDE: AX=port address, DH=.bDevice
    4242    mov     dx, [cs:bp+IDEVARS.bDevice-1]   ; for Serial: AL=port address>>2, AH=baud rate
     
    4848
    4949    mov     si, g_szDetectOuter             ; Load SI with default wrapper string "IDE %s at %s: "
    50        
     50
    5151    push    bp                              ; setup stack for call to
    5252    mov     bp, sp                          ; BootMenuPrint_FormatCSSIfromParamsInSSBP
     
    9898    mov     cl, (g_szDetectCOMSmall-$$) & 0xff  ; Setup secondary print string for "COMn/XXy00"
    9999
    100 .pushAndPrintSerial:   
     100.pushAndPrintSerial:
    101101    mov     si, g_szDetectOuterSerial       ; Finally load SI with wrapper string "Serial %s on %s: "
    102102
    103103.pushAndPrint:
    104104%endif
    105        
     105
    106106    push    cx                              ; Push print string
    107107    push    ax                              ; Push high order digits, or port address, or N/A
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DriveXlate.asm

    r248 r294  
    3939SwapFloppyDriveOrHardDisk:
    4040    mov     ah, 80h                 ; Assume hard disk
    41     mov     al, BYTE [RAMVARS.xlateVars+XLATEVARS.bHDSwap]
     41    mov     al, [RAMVARS.xlateVars+XLATEVARS.bHDSwap]
    4242    test    dl, ah                  ; Hard disk?
    4343    jnz     SHORT SwapDrive         ; If so, jump to swap
    44     mov     al, BYTE [RAMVARS.xlateVars+XLATEVARS.bFDSwap]
     44    mov     al, [RAMVARS.xlateVars+XLATEVARS.bFDSwap]
    4545    cbw
    4646    ; Fall to SwapDrive
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm

    r274 r294  
    127127;--------------------------------------------------------------------
    128128ALIGN JUMP_ALIGN
    129 FloppyDrive_GetCountToAX:       
     129FloppyDrive_GetCountToAX:
    130130%ifdef MODULE_SERIAL_FLOPPY
    131131    call    RamVars_UnpackFlopCntAndFirstToAL
    132132    js      .UseBIOSorBDA               ; We didn't add in any drives, counts here are not valid
    133        
    134     adc     al,1                        ; adds in the drive count bit, and adds 1 for count vs. 0-index, 
     133
     134    adc     al,1                        ; adds in the drive count bit, and adds 1 for count vs. 0-index,
    135135    jmp     .FinishCalc                 ; need to clear AH on the way out, and add in minimum drive numbers
    136136
    137 .UseBIOSorBDA: 
     137.UseBIOSorBDA:
    138138%endif
    139139    call    FloppyDrive_GetCountFromBIOS_or_BDA
    140140
    141 .FinishCalc:   
     141.FinishCalc:
    142142    mov     ah, [cs:ROMVARS.bMinFddCnt]
    143143    MAX_U   al, ah
    144144    cbw
    145        
    146     ret
    147 
    148 ALIGN JUMP_ALIGN       
     145
     146    ret
     147
     148ALIGN JUMP_ALIGN
    149149FloppyDrive_GetCountFromBIOS_or_BDA:
    150150    push    es
     
    152152;--------------------------------------------------------------------
    153153; Reads Floppy Drive Count from BIOS.
    154 ; Does not work on most XT systems. Call FloppyDrive_GetCountFromBDA
     154; Does not work on most XT systems. Call .GetCountFromBDA
    155155; if this function fails.
    156156;
    157 ; GetCountFromBIOS
     157; .GetCountFromBIOS
    158158;   Parameters:
    159159;       Nothing
    160160;   Returns:
    161161;       AL:     Number of Floppy Drives
    162 ;       CF:     Cleared if successfull
     162;       CF:     Cleared if successful
    163163;               Set if BIOS function not supported
    164164;   Corrupts registers:
     
    169169.GetCountFromBIOS:
    170170    push    di
    171     push    es
    172171    push    bx
    173172    push    cx
     
    182181    pop     cx
    183182    pop     bx
    184     pop     es
    185183    pop     di
    186184%endif
     
    188186;--------------------------------------------------------------------
    189187; Reads Floppy Drive Count (0...4) from BIOS Data Area.
    190 ; This function should be used only if FloppyDrive_GetCountFromBIOS fails.
    191 ;
    192 ; GetCountFromBDA
    193 ;   Parameters:
    194 ;       Nothing
    195 ;   Returns:
    196 ;       CL:     Number of Floppy Drives
    197 ;   Corrupts registers:
    198 ;       CH, ES
     188; This function should be used only if .GetCountFromBIOS fails.
     189;
     190; .GetCountFromBDA
     191;   Parameters:
     192;       Nothing
     193;   Returns:
     194;       AL:     Number of Floppy Drives
     195;   Corrupts registers:
     196;       AH, ES
    199197;--------------------------------------------------------------------
    200198%ifndef USE_AT
     
    203201    LOAD_BDA_SEGMENT_TO es, ax
    204202    mov     al, [es:BDA.wEquipment]         ; Load Equipment WORD low byte
    205     mov     ah, al                          ; Copy it to CH
     203    mov     ah, al                          ; Copy it to AH
    206204    and     ax, 0C001h                      ; Leave bits 15..14 and 0
    207205    eROL_IM ah, 2                           ; EW low byte bits 7..6 to 1..0
    208     add     al, ah                          ; CL = Floppy Drive count
     206    add     al, ah                          ; AL = Floppy Drive count
    209207%endif
    210208
    211209    pop     es
    212210    ret
    213        
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm

    r258 r294  
    6262    mov     di, ROMVARS.ideVars0            ; CS:SI points to first IDEVARS
    6363.IdeControllerLoop:
    64     mov     al, BYTE [cs:di+IDEVARS.bIRQ]
     64    mov     al, [cs:di+IDEVARS.bIRQ]
    6565    add     di, BYTE IDEVARS_size           ; Increment to next controller
    6666    call    .InstallLowOrHighIrqHandler
     
    147147;--------------------------------------------------------------------
    148148Interrupts_UnmaskInterruptControllerForDriveInDSDI:
    149     eMOVZX  bx, BYTE [di+DPT.bIdevarsOffset]
     149    eMOVZX  bx, [di+DPT.bIdevarsOffset]
    150150    mov     al, [cs:bx+IDEVARS.bIRQ]
    151151    test    al, al
Note: See TracChangeset for help on using the changeset viewer.