Changeset 124 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS


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

Changes to XTIDE Universal BIOS:

  • Some boot menu fixes but menu does not work yet.
Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
4 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
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuEvent.asm

    r95 r124  
    88    .HardDisk           resb    2
    99    .FloppyDrive        resb    2
    10     .SpecialFunction    resb    2
    1110endstruc
    1211
     
    2928    jmp     [bx+.rgfnEventSpecificHandlers]
    3029.EventNotHandled:
    31 .IdleProcessing:
    3230    clc
    3331    ret
     
    3533ALIGN WORD_ALIGN
    3634.rgfnEventSpecificHandlers:
    37     dw      .InitializeMenuinitFromDSSI
    38     dw      .EventCompleted
    39     dw      .IdleProcessing
    40     dw      .ItemHighlightedFromCX
    41     dw      .ItemSelectedFromCX
    42     dw      .KeyStrokeInAX
    43     dw      BootMenuPrint_TitleStrings
    44     dw      .RefreshInformation
    45     dw      .RefreshItemFromCX
     35    dw      .InitializeMenuinitFromDSSI ; MENUEVENT.InitializeMenuinitFromDSSI
     36    dw      .EventCompleted             ; MENUEVENT.ExitMenu
     37    dw      .EventNotHandled            ; MENUEVENT.IdleProcessing
     38    dw      .ItemHighlightedFromCX      ; MENUEVENT.ItemHighlightedFromCX
     39    dw      .ItemSelectedFromCX         ; MENUEVENT.ItemSelectedFromCX
     40    dw      .KeyStrokeInAX              ; MENUEVENT.KeyStrokeInAX
     41    dw      BootMenuPrint_TitleStrings  ; MENUEVENT.RefreshTitle
     42    dw      .RefreshInformation         ; MENUEVENT.RefreshInformation
     43    dw      .RefreshItemFromCX          ; MENUEVENT.RefreshItemFromCX
    4644
    4745
     
    5553    call    RamVars_GetSegmentToDS
    5654    call    .GetDefaultMenuitemToDX
    57     call    BootMenu_GetMenuitemCountToCX
     55    call    BootMenu_GetMenuitemCountToAX
    5856    pop     ds
    59     mov     [si+MENUINIT.wItems], cx
     57    mov     [si+MENUINIT.wItems], ax
    6058    mov     [si+MENUINIT.wHighlightedItem], dx
    6159    mov     WORD [si+MENUINIT.wTitleAndInfoLines], BOOT_MENU_TITLE_AND_INFO_LINES
    6260    mov     BYTE [si+MENUINIT.bWidth], BOOT_MENU_WIDTH
    63     call    BootMenu_GetHeightToAHwithItemCountInCL
     61    call    BootMenu_GetHeightToAHwithItemCountInAL
    6462    mov     [si+MENUINIT.bHeight], ah
    6563    stc
     
    7270    jnc     SHORT .DoNotSetDefaultMenuitem
    7371    call    DriveXlate_SetDriveToSwap
    74     call    BootMenu_ConvertDriveToMenuitem
    75     mov     dx, cx
    76     ret
     72    jmp     BootMenu_GetMenuitemToDXforDriveInDL
    7773ALIGN JUMP_ALIGN
    7874.DoNotSetDefaultMenuitem:
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm

    r122 r124  
    362362ALIGN JUMP_ALIGN
    363363BootMenuPrint_TheBottomOfScreen:
    364     call    FloppyDrive_GetCount
     364    call    FloppyDrive_GetCountToCX
    365365    mov     bl, cl                  ; Floppy Drive count to BL
    366366    call    RamVars_GetHardDiskCountFromBDAtoCX
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm

    r102 r124  
    120120; Returns number of Floppy Drives in system.
    121121;
    122 ; FloppyDrive_GetCount
     122; FloppyDrive_GetCountToCX
    123123;   Parameters:
    124124;       Nothing
     
    129129;--------------------------------------------------------------------
    130130ALIGN JUMP_ALIGN
    131 FloppyDrive_GetCount:
     131FloppyDrive_GetCountToCX:
    132132    push    es
    133133%ifdef USE_AT
    134     call    FloppyDrive_GetCountFromBIOS
     134    call    GetCountFromBIOS
    135135%else
    136     call    FloppyDrive_GetCountFromBDA
     136    call    GetCountFromBDA
    137137%endif
    138138    MAX_U   cl, [cs:ROMVARS.bMinFddCnt]
     
    147147; if this function fails.
    148148;
    149 ; FloppyDrive_GetCountFromBIOS
     149; GetCountFromBIOS
    150150;   Parameters:
    151151;       Nothing
     
    159159%ifdef USE_AT
    160160ALIGN JUMP_ALIGN
    161 FloppyDrive_GetCountFromBIOS:
     161GetCountFromBIOS:
    162162    push    di
    163163    push    dx
     
    182182; This function should be used only if FloppyDrive_GetCountFromBIOS fails.
    183183;
    184 ; FloppyDrive_GetCountFromBDA
     184; GetCountFromBDA
    185185;   Parameters:
    186186;       Nothing
     
    192192%ifndef USE_AT
    193193ALIGN JUMP_ALIGN
    194 FloppyDrive_GetCountFromBDA:
     194GetCountFromBDA:
    195195    LOAD_BDA_SEGMENT_TO es, cx
    196196    mov     cl, [es:BDA.wEquipment]         ; Load Equipment WORD low byte
Note: See TracChangeset for help on using the changeset viewer.