Changeset 128 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm


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

Changes to the XTIDE Universal BIOS:

  • Size optimizations in various files.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.