Changeset 128 in xtideuniversalbios


Ignore:
Timestamp:
Mar 4, 2011, 1:47:17 PM (14 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes to the XTIDE Universal BIOS:

  • Size optimizations in various files.
Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootInfo.asm

    r121 r128  
    7373    stosw
    7474    loop    .CopyNextWord
    75     xor     ax, ax
     75    xor     ax, ax                      ; Zero AX and clear CF
    7676    stosb                               ; Terminate with NULL
    7777
     
    7979    pop     si
    8080    pop     ds
    81     clc
    8281    ret
    8382
     
    9493;   Corrupts registers:
    9594;       Nothing
    96 ;--------------------------------------------------------------------   
     95;--------------------------------------------------------------------
    9796ALIGN JUMP_ALIGN
    9897BootInfo_GetTotalSectorCount:
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm

    r127 r128  
    2424    cmp     cx, BYTE NO_ITEM_SELECTED
    2525    je      SHORT BootMenu_DisplayAndReturnSelection    ; Clear screen and display menu
    26     jmp     SHORT BootMenu_ConvertMenuitemFromCXtoDriveInDX
     26    ; Fall through to BootMenu_ConvertMenuitemFromCXtoDriveInDX
     27
     28;--------------------------------------------------------------------
     29; BootMenu_ConvertMenuitemFromCXtoDriveInDX
     30;   Parameters:
     31;       CX:     Index of menuitem selected from Boot Menu
     32;       DS:     RAMVARS segment
     33;   Returns:
     34;       DX:     Drive number to be used for booting
     35;   Corrupts registers:
     36;       CX
     37;--------------------------------------------------------------------
     38ALIGN JUMP_ALIGN
     39BootMenu_ConvertMenuitemFromCXtoDriveInDX:
     40    mov     dx, cx                  ; Copy menuitem index to DX
     41    call    FloppyDrive_GetCountToCX
     42    cmp     dx, cx                  ; Floppy drive?
     43    jb      SHORT .ReturnFloppyDriveInDX
     44    sub     dx, cx                  ; Remove floppy drives from index
     45    or      dl, 80h
     46.ReturnFloppyDriveInDX:
     47    ret
    2748
    2849
     
    7798ALIGN JUMP_ALIGN
    7899BootMenu_GetHeightToAHwithItemCountInAL:
     100    add     al, BOOT_MENU_HEIGHT_WITHOUT_ITEMS
    79101    xchg    cx, ax
    80     add     cl, BOOT_MENU_HEIGHT_WITHOUT_ITEMS
    81102    CALL_DISPLAY_LIBRARY GetColumnsToALandRowsToAH
    82103    sub     ah, MENU_SCREEN_BOTTOM_LINES*2  ; Leave space for bottom info
     
    109130    ret
    110131
     132
    111133;--------------------------------------------------------------------
    112134; Returns letter for first hard disk. Usually it will be 'c' but it
     
    130152
    131153;--------------------------------------------------------------------
    132 ; BootMenu_ConvertMenuitemFromCXtoDriveInDX
    133 ;   Parameters:
    134 ;       CX:     Index of menuitem selected from Boot Menu
    135 ;       DS:     RAMVARS segment
    136 ;   Returns:
    137 ;       DX:     Drive number to be used for booting
    138 ;   Corrupts registers:
    139 ;       CX
    140 ;--------------------------------------------------------------------
    141 ALIGN JUMP_ALIGN
    142 BootMenu_ConvertMenuitemFromCXtoDriveInDX:
    143     mov     dx, cx                  ; Copy menuitem index to DX
    144     call    FloppyDrive_GetCountToCX
    145     cmp     dx, cx                  ; Floppy drive?
    146     jb      SHORT .ReturnFloppyDriveInDX
    147     sub     dx, cx                  ; Remove floppy drives from index
    148     or      dl, 80h
    149 .ReturnFloppyDriveInDX:
    150     ret
    151 
    152 
    153 ;--------------------------------------------------------------------
    154154; BootMenu_GetMenuitemToDXforDriveInDL
    155155;   Parameters:
     
    163163BootMenu_GetMenuitemToDXforDriveInDL:
    164164    xor     dh, dh                      ; Drive number now in DX
    165     test    dl, 80h
    166     jz      SHORT .ReturnItemIndexInDX  ; Return if floppy drive (HD bit not set)
     165    test    dl, dl
     166    jns     SHORT .ReturnItemIndexInDX  ; Return if floppy drive (HD bit not set)
    167167    call    FloppyDrive_GetCountToCX
    168168    and     dl, ~80h                    ; Clear HD bit
     
    187187ALIGN JUMP_ALIGN
    188188BootMenu_IsDriveInSystem:
    189     test    dl, 80h                             ; Floppy drive?
    190     jz      SHORT .IsFloppyDriveIsInSystem
     189    test    dl, dl                              ; Floppy drive?
     190    jns     SHORT .IsFloppyDriveIsInSystem
    191191    call    RamVars_GetHardDiskCountFromBDAtoCX ; Hard Disk count to CX
    192192    or      cl, 80h                             ; Set Hard Disk bit to CX
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuEvent.asm

    r127 r128  
    157157    call    RamVars_GetSegmentToDS
    158158    call    BootMenu_ConvertMenuitemFromCXtoDriveInDX
    159     test    dl, 80h                 ; Floppy drive?
    160     jz      SHORT .DrawFloppyDrive
     159    test    dl, dl                  ; Floppy drive?
     160    jns     SHORT .DrawFloppyDrive
    161161    jmp     [cs:bx+ITEM_TYPE_REFRESH.HardDisk]
    162162ALIGN JUMP_ALIGN
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm

    r127 r128  
    2222    CALL_DISPLAY_LIBRARY PrintNewlineCharacters
    2323    mov     si, ROMVARS.szVersion
    24     jmp     BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
     24    ; Fall through to BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
     25
     26
     27;--------------------------------------------------------------------
     28; BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
     29;   Parameters:
     30;       CS:SI:  Ptr to NULL terminated string to print
     31;   Returns:
     32;       CF:     Set since menu event was handled successfully
     33;   Corrupts registers:
     34;       AX
     35;--------------------------------------------------------------------
     36ALIGN JUMP_ALIGN
     37BootMenuPrint_NullTerminatedStringFromCSSIandSetCF:
     38    push    di
     39    CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI
     40    pop     di
     41    stc
     42    ret
    2543
    2644
     
    5371BootMenuPrint_FloppyMenuitem:
    5472    push    bp
    55 
    5673    mov     bp, sp
    5774    mov     si, g_szFDLetter
     
    109126.HardDiskMenuitemForForeignDrive:
    110127    mov     si, g_szforeignHD
    111     jmp     BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
     128    jmp     SHORT BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
    112129
    113130
     
    177194.PrintKnownFloppyType:
    178195    push    bp
    179 
    180196    mov     bp, sp
    181197    mov     si, g_szFddSize
     
    320336
    321337;--------------------------------------------------------------------
    322 ; BootMenuPrint_NullTerminatedStringFromCSSIandSetCF
    323 ;   Parameters:
    324 ;       CS:SI:  Ptr to NULL terminated string to print
    325 ;   Returns:
    326 ;       CF:     Set since menu event was handled successfully
    327 ;   Corrupts registers:
    328 ;       AX
    329 ;--------------------------------------------------------------------
    330 ALIGN JUMP_ALIGN
    331 BootMenuPrint_NullTerminatedStringFromCSSIandSetCF:
    332     push    di
    333     CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI
    334     pop     di
    335     stc
    336     ret
    337 
    338 
    339 ;--------------------------------------------------------------------
    340338; BootMenuPrint_ClearInformationArea
    341339;   Parameters:
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootPrint.asm

    r120 r128  
    2121
    2222    mov     ax, g_szHDD
    23     test    dl, 80h
    24     eCMOVZ  ax, g_szFDD
     23    test    dl, dl
     24    js      SHORT .NotFDD
     25    mov     ax, g_szFDD
     26.NotFDD:
    2527    push    ax
    2628
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootSector.asm

    r96 r128  
    2323    jc      SHORT .FailedToLoadFirstSector
    2424
    25     test    dl, 80h
    26     jz      SHORT .AlwaysBootFromFloppyDriveForBooterGames
     25    test    dl, dl
     26    jns     SHORT .AlwaysBootFromFloppyDriveForBooterGames
    2727    cmp     WORD [es:bx+510], 0AA55h        ; Valid boot sector?
    2828    jne     SHORT .FirstHardDiskSectorNotBootable
     
    8484.ResetBootDriveFromDL:
    8585    xor     ax, ax                          ; AH=0h, Disk Controller Reset
    86     test    dl, 80h                         ; Floppy drive?
    87     eCMOVNZ ah, 0Dh                         ; AH=Dh, Reset Hard Disk (Alternate reset)
     86    test    dl, dl                          ; Floppy drive?
     87    jns     SHORT .SkipAltReset
     88    mov     ah, 0Dh                         ; AH=Dh, Reset Hard Disk (Alternate reset)
     89.SkipAltReset:
    8890    int     INTV_DISK_FUNC
    8991    ret
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm

    r84 r128  
    1 ; File name     :   AH0h_HReset.asm
    2 ; Project name  :   IDE BIOS
    3 ; Created date  :   27.9.2007
    4 ; Last update   :   13.1.2011
    5 ; Author        :   Tomi Tilli,
    6 ;               :   Krister Nordvall (optimizations)
     1; Project name  :   XTIDE Universal BIOS
    72; Description   :   Int 13h function AH=0h, Disk Controller Reset.
    83
     
    3631    eMOVZX  bx, dl                      ; Copy requested drive to BL, zero BH to assume no errors
    3732    call    ResetFloppyDrivesWithInt40h
    38     test    bl, 80h
    39     jz      SHORT .SkipHardDiskReset
     33    test    bl, bl
     34    jns     SHORT .SkipHardDiskReset
    4035    call    ResetForeignHardDisks
    4136    call    AH0h_ResetHardDisksHandledByOurBIOS
     
    5651;   Corrupts registers:
    5752;       AX, DL, DI
    58 ;--------------------------------------------------------------------   
     53;--------------------------------------------------------------------
    5954ALIGN JUMP_ALIGN
    6055ResetFloppyDrivesWithInt40h:
     
    7570;   Corrupts registers:
    7671;       AX, DL, DI
    77 ;--------------------------------------------------------------------   
     72;--------------------------------------------------------------------
    7873ALIGN JUMP_ALIGN
    7974ResetForeignHardDisks:
     
    9489;   Corrupts registers:
    9590;       DI
    96 ;--------------------------------------------------------------------   
     91;--------------------------------------------------------------------
    9792ALIGN JUMP_ALIGN
    9893GetDriveNumberForForeignBiosesToDL:
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DriveXlate.asm

    r126 r128  
    141141;   Corrupts registers:
    142142;       AX
    143 ;--------------------------------------------------------------------   
     143;--------------------------------------------------------------------
    144144ALIGN JUMP_ALIGN
    145145DriveXlate_Reset:
     
    160160;   Corrupts registers:
    161161;       Nothing
    162 ;--------------------------------------------------------------------   
     162;--------------------------------------------------------------------
    163163ALIGN JUMP_ALIGN
    164164DriveXlate_SetDriveToSwap:
    165     test    dl, 80h             ; Floppy drive?
    166     jnz     SHORT .SetHardDiskToSwap
     165    test    dl, dl              ; Floppy drive?
     166    js      SHORT .SetHardDiskToSwap
    167167.SetFloppyDriveToSwap:
    168168    mov     [RAMVARS.xlateVars+XLATEVARS.bFDSwap], dl
     
    187187;   Corrupts registers:
    188188;       Nothing
    189 ;--------------------------------------------------------------------   
     189;--------------------------------------------------------------------
    190190ALIGN JUMP_ALIGN
    191191DriveXlate_DoesFunctionReturnSomethingInDL:
    192192    cmp     ah, 08h         ; AH=08h, Read Disk Drive Parameters?
    193193    je      SHORT DriveXlate_FunctionReturnsSomethingInDL
    194     test    dl, 80h
    195     jz      SHORT DriveXlate_DoesFloppyFunctionReturnSomethingInDL
     194    test    dl, dl
     195    jns     SHORT DriveXlate_DoesFloppyFunctionReturnSomethingInDL
    196196    ; Fall to DriveXlate_DoesHardDiskFunctionReturnSomethingInDL
    197197
     
    211211;   Corrupts registers:
    212212;       Nothing
    213 ;--------------------------------------------------------------------   
     213;--------------------------------------------------------------------
    214214; ALIGN JUMP_ALIGN
    215215DriveXlate_DoesHardDiskFunctionReturnSomethingInDL:
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm

    r99 r128  
    232232    ; Make sure that more drives can be accepted
    233233    mov     dl, [es:BDA.bHDCount]   ; Load number of hard disks
    234     test    dl, 80h                 ; Hard disks at maximum?
     234    test    dl, dl                  ; Hard disks at maximum?
    235235    stc                             ; Assume error
    236     jnz     SHORT .TooManyDrives    ;  If so, return
     236    js      SHORT .TooManyDrives    ;  If so, return
    237237
    238238    ; Store drive number to DPT
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm

    r116 r128  
    130130    cmp     ah, 08h         ; Read Disk Drive Parameters?
    131131    jne     SHORT RamVars_IsDriveHandledByThisBIOS
    132     test    dl, 80h         ; We dot not handle floppy drives
    133     jz      SHORT .FunctionIsNotHandledByOurBIOS
     132    test    dl, dl          ; We do not handle floppy drives
     133    jns     SHORT .FunctionIsNotHandledByOurBIOS
    134134ALIGN JUMP_ALIGN
    135135.FunctionIsHandledByOurBIOS:
Note: See TracChangeset for help on using the changeset viewer.