Changeset 92 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm


Ignore:
Timestamp:
Jan 27, 2011, 5:44:27 PM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • Removed ROM Boot from boot menu and created a hotkey for it.
File:
1 edited

Legend:

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

    r88 r92  
    3939    ret
    4040
    41 
    42 ;--------------------------------------------------------------------
    43 ; Prints Floppy Drive hotkey string.
    44 ;
    45 ; BootMenuPrint_FloppyHotkeyString
    46 ;   Parameters:
    47 ;       BL:     Number of floppy drives in system
    48 ;   Returns:
    49 ;       Nothing
    50 ;   Corrupts registers:
    51 ;       AX, SI
    52 ;--------------------------------------------------------------------
    53 ALIGN JUMP_ALIGN
    54 BootMenuPrint_FloppyHotkeyString:
    55     test    bl, bl                  ; Any floppy drives?
    56     jz      SHORT NoFloppyDrivesOrHardDisksToPrint
    57     push    bp
    58 
    59     mov     bp, sp
    60     mov     al, 'A'
    61     push    ax                      ; 'A'
    62     dec     ax
    63     add     al, bl
    64     push    ax                      ; Last floppy drive letter
    65     ePUSH_T ax, g_szFDD
    66     ePUSH_T ax, g_szHDD
    67     jmp     SHORT PrintHotkeyString
    68 
    69 ;--------------------------------------------------------------------
    70 ; Prints Hard Disk hotkey string.
    71 ;
    72 ; BootMenuPrint_FloppyHotkeyString
    73 ;   Parameters:
    74 ;       BH:     Number of hard disks in system
    75 ;   Returns:
    76 ;       Nothing
    77 ;   Corrupts registers:
    78 ;       AX, CX, SI
    79 ;--------------------------------------------------------------------
    80 ALIGN JUMP_ALIGN
    81 BootMenuPrint_HardDiskHotkeyString:
    82     test    bh, bh                  ; Any hard disks?
    83     jz      SHORT NoFloppyDrivesOrHardDisksToPrint
    84     push    bp
    85 
    86     mov     bp, sp
    87     call    BootMenu_GetLetterForFirstHardDisk
    88     push    cx                      ; First hard disk letter
    89     dec     cx
    90     add     cl, bh
    91     push    cx                      ; Last hard disk letter
    92     ePUSH_T ax, g_szHDD
    93     ePUSH_T ax, g_szFDD
    94     ; Fall to PrintHotkeyString
    95 
    96 ALIGN JUMP_ALIGN
    97 PrintHotkeyString:
    98     mov     si, g_szBottomScrn
    99     jmp     BootMenuPrint_FormatCSSIfromParamsInSSBP
    100 NoFloppyDrivesOrHardDisksToPrint:
    101     ret
    10241
    10342;--------------------------------------------------------------------
     
    216155.HardDiskMenuitemForForeignDrive:
    217156    mov     si, g_szforeignHD
    218     jmp     PrintNullTerminatedStringFromCSSIandSetCF
    219 
    220 
    221 ;--------------------------------------------------------------------
    222 ; BootMenuPrint_FunctionMenuitem
    223 ;   Parameters:
    224 ;       DX:     Function ID
    225 ;   Returns:
    226 ;       CF:     Set if menu event was handled successfully
    227 ;   Corrupts registers:
    228 ;       AX, DX, SI, DI
    229 ;--------------------------------------------------------------------
    230 ALIGN JUMP_ALIGN
    231 BootMenuPrint_FunctionMenuitem:
    232     test    dx, dx                  ; ID_BOOTFUNC_ROMBOOT
    233     jz      SHORT .PrintRomBootMenuitem
    234     ret
    235 
    236 ALIGN JUMP_ALIGN
    237 .PrintRomBootMenuitem:
    238     mov     si, g_szRomBoot
    239157    jmp     PrintNullTerminatedStringFromCSSIandSetCF
    240158
     
    479397
    480398;--------------------------------------------------------------------
    481 ; Prints information strings to the bottom of the screen.
    482 ;
    483399; BootMenuPrint_TheBottomOfScreen
    484400;   Parameters:
     
    487403;       Nothing
    488404;   Corrupts registers:
    489 ;       AX, BX, CX, DX, SI
     405;       AX, BX, CX, DX, SI, DI
    490406;--------------------------------------------------------------------
    491407ALIGN JUMP_ALIGN
     
    495411    call    RamVars_GetHardDiskCountFromBDAtoCX
    496412    mov     bh, cl                  ; Hard Disk count to BH
    497     call    BootMenuPrint_GetCoordinatesForBottomStrings
    498     call    BootMenuPrint_SetCursorPosition
    499     call    BootMenuPrint_FloppyHotkeyString
    500     jmp     BootMenuPrint_HardDiskHotkeyString
    501 
    502 
    503 ;--------------------------------------------------------------------
    504 ; Returns coordinates for bottom strings.
    505 ;
    506 ; BootMenuPrint_GetCoordinatesForBottomStrings
    507 ;   Parameters:
    508 ;       BL:     Number of floppy drives in system
    509 ;       BH:     Number of hard disks in system
    510 ;   Returns:
    511 ;       DL:     Cursor X coordinate
    512 ;       DH:     Cursor Y coordinate
    513 ;   Corrupts registers:
    514 ;       Nothing
    515 ;--------------------------------------------------------------------
    516 ALIGN JUMP_ALIGN
    517 BootMenuPrint_GetCoordinatesForBottomStrings:
    518     mov     dx, 1800h               ; (0, 24)
    519     cmp     dl, bl                  ; Set CF if any floppy drives
    520     sbb     dh, dl                  ; Decrement Y-coordinate if necessary
    521     cmp     dl, bh                  ; Set CF if any hard disks
    522     sbb     dh, dl                  ; Decrement Y-coordinate if necessary
    523     ret
    524 
    525 
    526 ;--------------------------------------------------------------------
    527 ; Sets cursor to wanted screen coordinates.
    528 ;
    529 ; BootMenuPrint_SetCursorPosition
    530 ;   Parameters:
    531 ;       DL:     Cursor X coordinate
    532 ;       DH:     Cursor Y coordinate
    533 ;   Returns:
    534 ;       Nothing
    535 ;   Corrupts registers:
    536 ;       AX
    537 ;--------------------------------------------------------------------
    538 ALIGN JUMP_ALIGN
    539 BootMenuPrint_SetCursorPosition:
    540     push    di
    541     mov     ax, dx
     413    ; Fall to .MoveCursorToHotkeyStrings
     414
     415;--------------------------------------------------------------------
     416; .MoveCursorToHotkeyStrings
     417;   Parameters:
     418;       Nothing
     419;   Returns:
     420;       Nothing
     421;   Corrupts registers:
     422;       AX, DI
     423;--------------------------------------------------------------------
     424.MoveCursorToHotkeyStrings:
     425    CALL_DISPLAY_LIBRARY GetColumnsToALandRowsToAH
     426    xor     al, al
     427    dec     ah
    542428    CALL_DISPLAY_LIBRARY SetCursorCoordinatesFromAX
    543     pop     di
    544     ret
     429    ; Fall to .PrintHotkeyString
     430
     431;--------------------------------------------------------------------
     432; .PrintHotkeyString
     433;   Parameters:
     434;       BL:     Floppy Drives
     435;       BH:     Hard Drives
     436;   Returns:
     437;       Nothing
     438;   Corrupts registers:
     439;       AX, CX, DX, SI
     440;--------------------------------------------------------------------
     441.PrintHotkeyString:
     442    ; Display Library should not be called like this
     443    mov     si, ATTRIBUTE_CHARS.cTitle
     444    call    MenuAttribute_GetToAXfromTypeInSI
     445    xchg    cx, ax
     446    mov     si, ATTRIBUTE_CHARS.cHighlightedItem
     447    call    MenuAttribute_GetToAXfromTypeInSI
     448    xchg    dx, ax
     449
     450    test    bl, bl      ; Any Floppy Drives?
     451    jz      SHORT .SkipFloppyDriveHotkeys
     452    mov     ax, 'A' | (ANGLE_QUOTE_RIGHT<<8)
     453    mov     si, g_szFDD
     454    call    PushHotkeyParamsAndFormat
     455
     456.SkipFloppyDriveHotkeys:
     457    test    bh, bh      ; Any Hard Drives?
     458    jz      SHORT .SkipHardDriveHotkeys
     459    call    BootMenu_GetLetterForFirstHardDiskToCL
     460    mov     ch, ANGLE_QUOTE_RIGHT
     461    xchg    ax, cx
     462    mov     si, g_szHDD
     463    call    PushHotkeyParamsAndFormat
     464
     465.SkipHardDriveHotkeys:
     466    ; Fall to .PrintRomBootHotkey
     467
     468;--------------------------------------------------------------------
     469; .PrintRomBootHotkey
     470;   Parameters:
     471;       CX:     Key Attribute
     472;       DX:     Description Attribute
     473;   Returns:
     474;       Nothing
     475;   Corrupts registers:
     476;       AX, SI
     477;--------------------------------------------------------------------
     478.PrintRomBootHotkey:
     479    mov     ax, 'F' | ('8'<<8)      ; F8
     480    mov     si, g_szRomBoot
     481    ; Fall to PushHotkeyParamsAndFormat
     482
     483;--------------------------------------------------------------------
     484; PushHotkeyParamsAndFormat
     485;   Parameters:
     486;       AL:     First character
     487;       AH:     Second character
     488;       CX:     Key Attribute
     489;       DX:     Description Attribute
     490;       CS:SI:  Description string
     491;   Returns:
     492;       Nothing
     493;   Corrupts registers:
     494;       AX, SI
     495;--------------------------------------------------------------------
     496ALIGN JUMP_ALIGN
     497PushHotkeyParamsAndFormat:
     498    push    bp
     499    mov     bp, sp
     500
     501    push    cx          ; Key attribute
     502    push    ax          ; First character
     503    xchg    al, ah
     504    push    ax          ; Second character
     505    push    dx          ; Description attribute
     506    push    si          ; Description string
     507    push    cx          ; Key attribute for last space
     508    mov     si, g_szHotkey
     509    jmp     BootMenuPrint_FormatCSSIfromParamsInSSBP
Note: See TracChangeset for help on using the changeset viewer.