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


Ignore:
Timestamp:
Mar 2, 2011, 7:42:19 PM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • Some boot menu fixes but menu does not work yet.
File:
1 edited

Legend:

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

    r95 r124  
    4949; Returns number of menuitems in Boot Menu.
    5050;
    51 ; BootMenu_GetMenuitemCountToCX
     51; BootMenu_GetMenuitemCountToAX
    5252;   Parameters:
    5353;       DS:     RAMVARS segment
    5454;   Returns:
    55 ;       CX:     Number of boot menu items
     55;       AX:     Number of boot menu items
    5656;   Corrupts registers:
    57 ;       AX
     57;       CX
    5858;--------------------------------------------------------------------
    5959ALIGN JUMP_ALIGN
    60 BootMenu_GetMenuitemCountToCX:
     60BootMenu_GetMenuitemCountToAX:
    6161    call    RamVars_GetHardDiskCountFromBDAtoCX
    6262    xchg    ax, cx
    63     call    FloppyDrive_GetCount
     63    call    FloppyDrive_GetCountToCX
    6464    add     ax, cx
    6565    ret
     
    6767
    6868;--------------------------------------------------------------------
    69 ; BootMenu_GetHeightToALwithItemCountInCL
     69; BootMenu_GetHeightToAHwithItemCountInAL
    7070;   Parameters:
    71 ;       CL:     Number of menuitems
     71;       AL:     Number of menuitems
    7272;   Returns:
    7373;       AH:     Boot menu height
    7474;   Corrupts registers:
    75 ;       AL, CL, DI
     75;       AL, CX, DI
    7676;--------------------------------------------------------------------
    7777ALIGN JUMP_ALIGN
    78 BootMenu_GetHeightToAHwithItemCountInCL:
     78BootMenu_GetHeightToAHwithItemCountInAL:
     79    xchg    cx, ax
    7980    add     cl, BOOT_MENU_HEIGHT_WITHOUT_ITEMS
    8081    CALL_DISPLAY_LIBRARY GetColumnsToALandRowsToAH
    81     sub     ah, MENU_SCREEN_BOTTOM_LINES*2
     82    sub     ah, MENU_SCREEN_BOTTOM_LINES*2  ; Leave space for bottom info
    8283    MIN_U   ah, cl
    8384    ret
     
    104105.StartFromHardDiskLetter:
    105106    sub     al, cl                      ; Hard Disk index
    106     call    FloppyDrive_GetCount
     107    call    FloppyDrive_GetCountToCX
    107108    add     cx, ax                      ; Menuitem index
    108109    ret
     
    122123ALIGN JUMP_ALIGN
    123124BootMenu_GetLetterForFirstHardDiskToCL:
    124     call    FloppyDrive_GetCount
     125    call    FloppyDrive_GetCountToCX
    125126    add     cl, 'A'
    126127    MAX_U   cl, 'C'
     
    141142BootMenu_ConvertMenuitemFromCXtoDriveInDX:
    142143    mov     dx, cx                  ; Copy menuitem index to DX
    143     call    FloppyDrive_GetCount
     144    call    FloppyDrive_GetCountToCX
    144145    cmp     dx, cx                  ; Floppy drive?
    145146    jb      SHORT .ReturnFloppyDriveInDX
     
    151152
    152153;--------------------------------------------------------------------
    153 ; Converts Floppy or Hard Disk Drive number to menuitem index.
    154 ; This function does not check does the drive really exists.
    155 ;
    156 ; BootMenu_ConvertDriveToMenuitem
     154; BootMenu_GetMenuitemToDXforDriveInDL
    157155;   Parameters:
    158156;       DL:     Drive number
    159157;   Returns:
    160 ;       CX:     Menuitem index (assuming drive is available)
     158;       DX:     Menuitem index (assuming drive is available)
    161159;   Corrupts registers:
    162 ;       AX
     160;       Nothing
    163161;--------------------------------------------------------------------
    164162ALIGN JUMP_ALIGN
    165 BootMenu_ConvertDriveToMenuitem:
    166     test    dl, 80h                 ; Floppy drive?
    167     jz      SHORT .ReturnFloppyMenuitem
    168     call    FloppyDrive_GetCount
    169     mov     ax, 7Fh                 ; Load mask to clear floppy bit
    170     and     ax, dx                  ; AX = Hard Disk index
    171     add     cx, ax                  ; Add hard disk index to floppy drive count
    172     ret
    173 ALIGN JUMP_ALIGN
    174 .ReturnFloppyMenuitem:
    175     eMOVZX  cx, dl                  ; Drive number and item index are equal
     163BootMenu_GetMenuitemToDXforDriveInDL:
     164    xor     dh, dh                      ; Drive number now in DX
     165    test    dl, 80h
     166    jz      SHORT .ReturnItemIndexInDX  ; Return if floppy drive (HD bit not set)
     167    call    FloppyDrive_GetCountToCX
     168    add     dx, cx
     169.ReturnItemIndexInDX:
    176170    ret
    177171
     
    198192    jmp     SHORT .CompareDriveNumberToDriveCount
    199193.IsFloppyDriveIsInSystem:
    200     call    FloppyDrive_GetCount                ; Floppy Drive count to CX
     194    call    FloppyDrive_GetCountToCX
    201195.CompareDriveNumberToDriveCount:
    202     cmp     dl, cl
     196    cmp     dl, cl                              ; Set CF when DL is smaller
    203197    ret
Note: See TracChangeset for help on using the changeset viewer.