Changeset 92 in xtideuniversalbios


Ignore:
Timestamp:
Jan 27, 2011, 5:44:27 PM (11 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.
Location:
trunk/XTIDE_Universal_BIOS
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Inc/BootMenu.inc

    r88 r92  
    1010BOOT_MENU_WIDTH                 EQU 40  ; Menu width in characters
    1111BOOT_MENU_HEIGHT_WITHOUT_ITEMS  EQU (BOOT_MENU_TITLE_LINES + BOOT_MENU_INFO_LINES + 4)
     12MENU_SCREEN_BOTTOM_LINES        EQU 1
    1213
    13 ; Function IDs
    14 ID_BOOTFUNC_ROMBOOT             EQU 0   ; ROM boot
     14; Hotkeys
     15ROM_BOOT_HOTKEY_SCANCODE        EQU 42h ; F8
    1516
    1617
  • trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc

    r90 r92  
    3131FLG_ROMVARS_FULLMODE    EQU (1<<0)  ; Full operating mode (steals base RAM, supports EBIOS etc.)
    3232FLG_ROMVARS_DRVXLAT     EQU (1<<2)  ; Enable drive number translation
    33 FLG_ROMVARS_ROMBOOT     EQU (1<<3)  ; Include ROMBOOT to boot menu
    3433FLG_ROMVARS_MAXSIZE     EQU (1<<5)  ; Maximize size by sacrificing compatibility with some old BIOSes
    3534
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm

    r88 r92  
    2727    cmp     cx, BYTE NO_ITEM_SELECTED
    2828    je      SHORT BootMenu_DisplayAndReturnSelection
    29     jmp     BootMenu_ConvertMenuitemToDriveOrFunction
     29    jmp     SHORT BootMenu_ConvertMenuitemFromCXtoDriveInDX
    3030
    3131
     
    6666    call    FloppyDrive_GetCount
    6767    add     ax, cx
    68     call    BootMenu_GetMenuFunctionCount
    69     add     cx, ax
    70     ret
    71 
    72 ;--------------------------------------------------------------------
    73 ; Returns number of functions displayed in Boot Menu.
    74 ;
    75 ; BootMenu_GetMenuFunctionCount
    76 ;   Parameters:
    77 ;       Nothing
    78 ;   Returns:
    79 ;       CX:     Number of boot menu functions
    80 ;   Corrupts registers:
    81 ;       Nothing
    82 ;--------------------------------------------------------------------
    83 ALIGN JUMP_ALIGN
    84 BootMenu_GetMenuFunctionCount:
    85     xor     cx, cx
    86     test    BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_ROMBOOT
    87     jz      SHORT .DontIncludeRomBoot
    88     inc     cx
    89 ALIGN JUMP_ALIGN
    90 .DontIncludeRomBoot:
    9168    ret
    9269
     
    11087
    11188;--------------------------------------------------------------------
    112 ; Converts any hotkey to Boot Menu menuitem index.
    113 ;
    114 ; BootMenu_ConvertHotkeyToMenuitem
    115 ;   Parameters:
    116 ;       AX:     ASCII hotkey starting from upper case 'A'
     89; BootMenu_ConvertAsciiHotkeyFromALtoMenuitemInCX
     90;   Parameters:
     91;       AL:     ASCII hotkey starting from upper case 'A'
    11792;   Returns:
    11893;       CX:     Menuitem index
     
    12196;--------------------------------------------------------------------
    12297ALIGN JUMP_ALIGN
    123 BootMenu_ConvertHotkeyToMenuitem:
    124     call    BootMenu_GetLetterForFirstHardDisk
     98BootMenu_ConvertAsciiHotkeyFromALtoMenuitemInCX:
     99    call    BootMenu_GetLetterForFirstHardDiskToCL
    125100    cmp     al, cl                      ; Letter is for Hard Disk?
    126101    jae     SHORT .StartFromHardDiskLetter
     
    139114; can be higher if more than two floppy drives are found.
    140115;
    141 ; BootMenu_GetLetterForFirstHardDisk
     116; BootMenu_GetLetterForFirstHardDiskToCL
    142117;   Parameters:
    143118;       Nothing
     
    148123;--------------------------------------------------------------------
    149124ALIGN JUMP_ALIGN
    150 BootMenu_GetLetterForFirstHardDisk:
     125BootMenu_GetLetterForFirstHardDiskToCL:
    151126    call    FloppyDrive_GetCount
    152127    add     cl, 'A'
     
    156131
    157132;--------------------------------------------------------------------
    158 ; Converts selected menuitem index to drive number or function ID.
    159 ;
    160 ; BootMenu_ConvertMenuitemToDriveOrFunction
     133; BootMenu_ConvertMenuitemFromCXtoDriveInDX
    161134;   Parameters:
    162135;       CX:     Index of menuitem selected from Boot Menu
    163136;       DS:     RAMVARS segment
    164137;   Returns:
    165 ;       DX:     Drive number to be used for booting (if CF cleared)
    166 ;               Function ID (if CF set)
    167 ;       CF:     Cleared if drive selected
    168 ;               Set if function selected
    169 ;   Corrupts registers:
    170 ;       AX, CX
    171 ;--------------------------------------------------------------------
    172 ALIGN JUMP_ALIGN
    173 BootMenu_ConvertMenuitemToDriveOrFunction:
     138;       DX:     Drive number to be used for booting
     139;   Corrupts registers:
     140;       CX
     141;--------------------------------------------------------------------
     142ALIGN JUMP_ALIGN
     143BootMenu_ConvertMenuitemFromCXtoDriveInDX:
    174144    mov     dx, cx                  ; Copy menuitem index to DX
    175145    call    FloppyDrive_GetCount
     
    177147    jb      SHORT .ReturnFloppyDriveInDX
    178148    sub     dx, cx                  ; Remove floppy drives from index
    179     call    RamVars_GetHardDiskCountFromBDAtoCX
    180     cmp     dx, cx                  ; Hard disk?
    181     jb      SHORT .ReturnHardDiskInDX
    182     sub     dx, cx                  ; Remove hard disks from index
    183     jmp     SHORT BootMenu_ConvertFunctionIndexToID
    184 ALIGN JUMP_ALIGN
    185 .ReturnHardDiskInDX:
    186149    or      dl, 80h
    187 ALIGN JUMP_ALIGN
    188150.ReturnFloppyDriveInDX:
    189     clc
    190     ret
    191 
    192 
    193 ;--------------------------------------------------------------------
    194 ; Converts selected menuitem index to drive number or function ID.
    195 ;
    196 ; BootMenu_ConvertFunctionIndexToID
    197 ;   Parameters:
    198 ;       CX:     Menuitem index
    199 ;       DX:     Function index (Menuitem index - floppy count - HD count)
    200 ;   Returns:
    201 ;       DX:     Function ID
    202 ;       CF:     Set to indicate function
    203 ;   Corrupts registers:
    204 ;       AX, CX
    205 ;--------------------------------------------------------------------
    206 ALIGN JUMP_ALIGN
    207 BootMenu_ConvertFunctionIndexToID:
    208     mov     dx, ID_BOOTFUNC_ROMBOOT
    209     stc
    210151    ret
    211152
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuEvent.asm

    r88 r92  
    6262    mov     BYTE [si+MENUINIT.bWidth], BOOT_MENU_WIDTH
    6363    call    BootMenu_GetHeightToAHwithItemCountInCL
     64    sub     ah, MENU_SCREEN_BOTTOM_LINES*2
    6465    mov     [si+MENUINIT.bHeight], ah
    6566    stc
     
    9091    call    RamVars_GetSegmentToDS
    9192    call    DriveXlate_Reset
    92     call    BootMenu_ConvertMenuitemToDriveOrFunction
    93     jc      SHORT .UpdatePreviousAndNewMenuitem ; Selection changed to a function
     93    call    BootMenu_ConvertMenuitemFromCXtoDriveInDX
    9494    call    DriveXlate_SetDriveToSwap
    95 
    96 .UpdatePreviousAndNewMenuitem:
    9795    pop     ax      ; Update previous item
    9896    CALL_MENU_LIBRARY RefreshItemFromAX
     
    109107ALIGN JUMP_ALIGN
    110108.KeyStrokeInAX:
    111     xor     ah, ah                  ; ASCII drive letter now in AX
    112     call    BootMenu_ConvertHotkeyToMenuitem
     109    cmp     ah, ROM_BOOT_HOTKEY_SCANCODE
     110    jne     SHORT .CheckDriveHotkeys
     111    int     INTV_BOOT_FAILURE       ; ROM Boot, never returns
     112ALIGN JUMP_ALIGN
     113.CheckDriveHotkeys:
     114    call    BootMenu_ConvertAsciiHotkeyFromALtoMenuitemInCX
    113115    cmp     cx, [bp+MENUINIT.wItems]
    114     jae     SHORT .EventNotHandled  ; Invalid key
     116    jae     SHORT .EventCompleted   ; Invalid key
    115117    xchg    ax, cx
    116118    CALL_MENU_LIBRARY HighlightItemFromAX
     
    159161
    160162    call    RamVars_GetSegmentToDS
    161     call    BootMenu_ConvertMenuitemToDriveOrFunction
    162     jc      SHORT .DrawFunction
     163    call    BootMenu_ConvertMenuitemFromCXtoDriveInDX
    163164    test    dl, 80h                 ; Floppy drive?
    164165    jz      SHORT .DrawFloppyDrive
    165166    jmp     [cs:bx+ITEM_TYPE_REFRESH.HardDisk]
    166 ALIGN JUMP_ALIGN
    167 .DrawFunction:
    168     jmp     [cs:bx+ITEM_TYPE_REFRESH.SpecialFunction]
    169167ALIGN JUMP_ALIGN
    170168.DrawFloppyDrive:
     
    177175    at  ITEM_TYPE_REFRESH.HardDisk,         dw  BootMenuPrint_HardDiskMenuitem
    178176    at  ITEM_TYPE_REFRESH.FloppyDrive,      dw  BootMenuPrint_FloppyMenuitem
    179     at  ITEM_TYPE_REFRESH.SpecialFunction,  dw  BootMenuPrint_FunctionMenuitem
    180177iend
    181178.rgwInformationItemTypeRefresh:
     
    183180    at  ITEM_TYPE_REFRESH.HardDisk,         dw  BootMenuPrint_HardDiskMenuitemInformation
    184181    at  ITEM_TYPE_REFRESH.FloppyDrive,      dw  BootMenuPrint_FloppyMenuitemInformation
    185     at  ITEM_TYPE_REFRESH.SpecialFunction,  dw  BootMenuPrint_ClearInformationArea
    186182iend
  • 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
  • trunk/XTIDE_Universal_BIOS/Src/Main.asm

    r90 r92  
    8585; XT and XT+ Build default settings ;
    8686;-----------------------------------;
    87     at  ROMVARS.wFlags,         dw  FLG_ROMVARS_DRVXLAT | FLG_ROMVARS_ROMBOOT | FLG_ROMVARS_MAXSIZE
     87    at  ROMVARS.wFlags,         dw  FLG_ROMVARS_DRVXLAT | FLG_ROMVARS_MAXSIZE
    8888    at  ROMVARS.bIdeCnt,        db  1                       ; Number of supported controllers
    8989    at  ROMVARS.bBootDrv,       db  80h                     ; Boot Menu default drive
  • trunk/XTIDE_Universal_BIOS/Src/Strings.asm

    r88 r92  
    1515g_szFloppyDrv:  db  "Floppy Drive",NULL
    1616g_szHardDrv:    db  " Hard Drive ",NULL
    17 g_szTryToBoot:  db  "Booting from %s %x",175,"%x ... ",NULL
     17g_szTryToBoot:  db  "Booting from %s %x",ANGLE_QUOTE_RIGHT,"%x ... ",NULL
    1818g_szBootSector: db  "Boot Sector",NULL
    1919g_szFound:      db  "found",NULL
    2020g_szSectRead:   db  "%s %s!",CR,LF,NULL
    2121g_szReadError:  db  "Error %x!",CR,LF,NULL
    22 g_sz18hCallback:db  "Boot menu callback via INT 18h",NULL
    2322
    2423; Boot menu bottom of screen strings
    2524g_szFDD:        db  "FDD",NULL
    2625g_szHDD:        db  "HDD",NULL
    27 g_szBottomScrn: db  "%c to %c boots from %s with %s mappings",CR,LF,NULL
     26g_szRomBoot:    db  "ROM Boot",NULL
     27g_szHotkey:     db  "%A%c%c%A%8s%a ",NULL
     28
    2829
    2930; Boot Menu menuitem strings
    3031g_szFDLetter:   db  "%s %c",NULL
    3132g_szforeignHD:  db  "Foreign Hard Disk",NULL
    32 g_szRomBoot:    db  "ROM Boot",NULL
    3333
    3434; Boot Menu information strings
     
    4343g_szLBA48:      db  "LBA48",NULL
    4444g_szFddUnknown: db  "%sUnknown",NULL
    45 g_szFddSizeOr:  db  "%s5",172,22h," or 3",171,22h," DD",NULL
    46 g_szFddSize:    db  "%s%c%c",22h,", %u kiB",NULL    ; 3½", 1440 kiB
     45g_szFddSizeOr:  db  "%s5",ONE_QUARTER,QUOTATION_MARK," or 3",ONE_HALF,QUOTATION_MARK," DD",NULL
     46g_szFddSize:    db  "%s%c%c",QUOTATION_MARK,", %u kiB",NULL ; 3½", 1440 kiB
Note: See TracChangeset for help on using the changeset viewer.