- Timestamp:
- Jan 27, 2011, 5:44:27 PM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/XTIDE_Universal_BIOS
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Inc/BootMenu.inc
r88 r92 10 10 BOOT_MENU_WIDTH EQU 40 ; Menu width in characters 11 11 BOOT_MENU_HEIGHT_WITHOUT_ITEMS EQU (BOOT_MENU_TITLE_LINES + BOOT_MENU_INFO_LINES + 4) 12 MENU_SCREEN_BOTTOM_LINES EQU 1 12 13 13 ; Function IDs14 ID_BOOTFUNC_ROMBOOT EQU 0 ; ROM boot 14 ; Hotkeys 15 ROM_BOOT_HOTKEY_SCANCODE EQU 42h ; F8 15 16 16 17 -
trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc
r90 r92 31 31 FLG_ROMVARS_FULLMODE EQU (1<<0) ; Full operating mode (steals base RAM, supports EBIOS etc.) 32 32 FLG_ROMVARS_DRVXLAT EQU (1<<2) ; Enable drive number translation 33 FLG_ROMVARS_ROMBOOT EQU (1<<3) ; Include ROMBOOT to boot menu34 33 FLG_ROMVARS_MAXSIZE EQU (1<<5) ; Maximize size by sacrificing compatibility with some old BIOSes 35 34 -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenu.asm
r88 r92 27 27 cmp cx, BYTE NO_ITEM_SELECTED 28 28 je SHORT BootMenu_DisplayAndReturnSelection 29 jmp BootMenu_ConvertMenuitemToDriveOrFunction29 jmp SHORT BootMenu_ConvertMenuitemFromCXtoDriveInDX 30 30 31 31 … … 66 66 call FloppyDrive_GetCount 67 67 add ax, cx 68 call BootMenu_GetMenuFunctionCount69 add cx, ax70 ret71 72 ;--------------------------------------------------------------------73 ; Returns number of functions displayed in Boot Menu.74 ;75 ; BootMenu_GetMenuFunctionCount76 ; Parameters:77 ; Nothing78 ; Returns:79 ; CX: Number of boot menu functions80 ; Corrupts registers:81 ; Nothing82 ;--------------------------------------------------------------------83 ALIGN JUMP_ALIGN84 BootMenu_GetMenuFunctionCount:85 xor cx, cx86 test BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_ROMBOOT87 jz SHORT .DontIncludeRomBoot88 inc cx89 ALIGN JUMP_ALIGN90 .DontIncludeRomBoot:91 68 ret 92 69 … … 110 87 111 88 ;-------------------------------------------------------------------- 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' 117 92 ; Returns: 118 93 ; CX: Menuitem index … … 121 96 ;-------------------------------------------------------------------- 122 97 ALIGN JUMP_ALIGN 123 BootMenu_Convert HotkeyToMenuitem:124 call BootMenu_GetLetterForFirstHardDisk 98 BootMenu_ConvertAsciiHotkeyFromALtoMenuitemInCX: 99 call BootMenu_GetLetterForFirstHardDiskToCL 125 100 cmp al, cl ; Letter is for Hard Disk? 126 101 jae SHORT .StartFromHardDiskLetter … … 139 114 ; can be higher if more than two floppy drives are found. 140 115 ; 141 ; BootMenu_GetLetterForFirstHardDisk 116 ; BootMenu_GetLetterForFirstHardDiskToCL 142 117 ; Parameters: 143 118 ; Nothing … … 148 123 ;-------------------------------------------------------------------- 149 124 ALIGN JUMP_ALIGN 150 BootMenu_GetLetterForFirstHardDisk :125 BootMenu_GetLetterForFirstHardDiskToCL: 151 126 call FloppyDrive_GetCount 152 127 add cl, 'A' … … 156 131 157 132 ;-------------------------------------------------------------------- 158 ; Converts selected menuitem index to drive number or function ID. 159 ; 160 ; BootMenu_ConvertMenuitemToDriveOrFunction 133 ; BootMenu_ConvertMenuitemFromCXtoDriveInDX 161 134 ; Parameters: 162 135 ; CX: Index of menuitem selected from Boot Menu 163 136 ; DS: RAMVARS segment 164 137 ; 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 ;-------------------------------------------------------------------- 142 ALIGN JUMP_ALIGN 143 BootMenu_ConvertMenuitemFromCXtoDriveInDX: 174 144 mov dx, cx ; Copy menuitem index to DX 175 145 call FloppyDrive_GetCount … … 177 147 jb SHORT .ReturnFloppyDriveInDX 178 148 sub dx, cx ; Remove floppy drives from index 179 call RamVars_GetHardDiskCountFromBDAtoCX180 cmp dx, cx ; Hard disk?181 jb SHORT .ReturnHardDiskInDX182 sub dx, cx ; Remove hard disks from index183 jmp SHORT BootMenu_ConvertFunctionIndexToID184 ALIGN JUMP_ALIGN185 .ReturnHardDiskInDX:186 149 or dl, 80h 187 ALIGN JUMP_ALIGN188 150 .ReturnFloppyDriveInDX: 189 clc190 ret191 192 193 ;--------------------------------------------------------------------194 ; Converts selected menuitem index to drive number or function ID.195 ;196 ; BootMenu_ConvertFunctionIndexToID197 ; Parameters:198 ; CX: Menuitem index199 ; DX: Function index (Menuitem index - floppy count - HD count)200 ; Returns:201 ; DX: Function ID202 ; CF: Set to indicate function203 ; Corrupts registers:204 ; AX, CX205 ;--------------------------------------------------------------------206 ALIGN JUMP_ALIGN207 BootMenu_ConvertFunctionIndexToID:208 mov dx, ID_BOOTFUNC_ROMBOOT209 stc210 151 ret 211 152 -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuEvent.asm
r88 r92 62 62 mov BYTE [si+MENUINIT.bWidth], BOOT_MENU_WIDTH 63 63 call BootMenu_GetHeightToAHwithItemCountInCL 64 sub ah, MENU_SCREEN_BOTTOM_LINES*2 64 65 mov [si+MENUINIT.bHeight], ah 65 66 stc … … 90 91 call RamVars_GetSegmentToDS 91 92 call DriveXlate_Reset 92 call BootMenu_ConvertMenuitemToDriveOrFunction 93 jc SHORT .UpdatePreviousAndNewMenuitem ; Selection changed to a function 93 call BootMenu_ConvertMenuitemFromCXtoDriveInDX 94 94 call DriveXlate_SetDriveToSwap 95 96 .UpdatePreviousAndNewMenuitem:97 95 pop ax ; Update previous item 98 96 CALL_MENU_LIBRARY RefreshItemFromAX … … 109 107 ALIGN JUMP_ALIGN 110 108 .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 112 ALIGN JUMP_ALIGN 113 .CheckDriveHotkeys: 114 call BootMenu_ConvertAsciiHotkeyFromALtoMenuitemInCX 113 115 cmp cx, [bp+MENUINIT.wItems] 114 jae SHORT .Event NotHandled ; Invalid key116 jae SHORT .EventCompleted ; Invalid key 115 117 xchg ax, cx 116 118 CALL_MENU_LIBRARY HighlightItemFromAX … … 159 161 160 162 call RamVars_GetSegmentToDS 161 call BootMenu_ConvertMenuitemToDriveOrFunction 162 jc SHORT .DrawFunction 163 call BootMenu_ConvertMenuitemFromCXtoDriveInDX 163 164 test dl, 80h ; Floppy drive? 164 165 jz SHORT .DrawFloppyDrive 165 166 jmp [cs:bx+ITEM_TYPE_REFRESH.HardDisk] 166 ALIGN JUMP_ALIGN167 .DrawFunction:168 jmp [cs:bx+ITEM_TYPE_REFRESH.SpecialFunction]169 167 ALIGN JUMP_ALIGN 170 168 .DrawFloppyDrive: … … 177 175 at ITEM_TYPE_REFRESH.HardDisk, dw BootMenuPrint_HardDiskMenuitem 178 176 at ITEM_TYPE_REFRESH.FloppyDrive, dw BootMenuPrint_FloppyMenuitem 179 at ITEM_TYPE_REFRESH.SpecialFunction, dw BootMenuPrint_FunctionMenuitem180 177 iend 181 178 .rgwInformationItemTypeRefresh: … … 183 180 at ITEM_TYPE_REFRESH.HardDisk, dw BootMenuPrint_HardDiskMenuitemInformation 184 181 at ITEM_TYPE_REFRESH.FloppyDrive, dw BootMenuPrint_FloppyMenuitemInformation 185 at ITEM_TYPE_REFRESH.SpecialFunction, dw BootMenuPrint_ClearInformationArea186 182 iend -
trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm
r88 r92 39 39 ret 40 40 41 42 ;--------------------------------------------------------------------43 ; Prints Floppy Drive hotkey string.44 ;45 ; BootMenuPrint_FloppyHotkeyString46 ; Parameters:47 ; BL: Number of floppy drives in system48 ; Returns:49 ; Nothing50 ; Corrupts registers:51 ; AX, SI52 ;--------------------------------------------------------------------53 ALIGN JUMP_ALIGN54 BootMenuPrint_FloppyHotkeyString:55 test bl, bl ; Any floppy drives?56 jz SHORT NoFloppyDrivesOrHardDisksToPrint57 push bp58 59 mov bp, sp60 mov al, 'A'61 push ax ; 'A'62 dec ax63 add al, bl64 push ax ; Last floppy drive letter65 ePUSH_T ax, g_szFDD66 ePUSH_T ax, g_szHDD67 jmp SHORT PrintHotkeyString68 69 ;--------------------------------------------------------------------70 ; Prints Hard Disk hotkey string.71 ;72 ; BootMenuPrint_FloppyHotkeyString73 ; Parameters:74 ; BH: Number of hard disks in system75 ; Returns:76 ; Nothing77 ; Corrupts registers:78 ; AX, CX, SI79 ;--------------------------------------------------------------------80 ALIGN JUMP_ALIGN81 BootMenuPrint_HardDiskHotkeyString:82 test bh, bh ; Any hard disks?83 jz SHORT NoFloppyDrivesOrHardDisksToPrint84 push bp85 86 mov bp, sp87 call BootMenu_GetLetterForFirstHardDisk88 push cx ; First hard disk letter89 dec cx90 add cl, bh91 push cx ; Last hard disk letter92 ePUSH_T ax, g_szHDD93 ePUSH_T ax, g_szFDD94 ; Fall to PrintHotkeyString95 96 ALIGN JUMP_ALIGN97 PrintHotkeyString:98 mov si, g_szBottomScrn99 jmp BootMenuPrint_FormatCSSIfromParamsInSSBP100 NoFloppyDrivesOrHardDisksToPrint:101 ret102 41 103 42 ;-------------------------------------------------------------------- … … 216 155 .HardDiskMenuitemForForeignDrive: 217 156 mov si, g_szforeignHD 218 jmp PrintNullTerminatedStringFromCSSIandSetCF219 220 221 ;--------------------------------------------------------------------222 ; BootMenuPrint_FunctionMenuitem223 ; Parameters:224 ; DX: Function ID225 ; Returns:226 ; CF: Set if menu event was handled successfully227 ; Corrupts registers:228 ; AX, DX, SI, DI229 ;--------------------------------------------------------------------230 ALIGN JUMP_ALIGN231 BootMenuPrint_FunctionMenuitem:232 test dx, dx ; ID_BOOTFUNC_ROMBOOT233 jz SHORT .PrintRomBootMenuitem234 ret235 236 ALIGN JUMP_ALIGN237 .PrintRomBootMenuitem:238 mov si, g_szRomBoot239 157 jmp PrintNullTerminatedStringFromCSSIandSetCF 240 158 … … 479 397 480 398 ;-------------------------------------------------------------------- 481 ; Prints information strings to the bottom of the screen.482 ;483 399 ; BootMenuPrint_TheBottomOfScreen 484 400 ; Parameters: … … 487 403 ; Nothing 488 404 ; Corrupts registers: 489 ; AX, BX, CX, DX, SI 405 ; AX, BX, CX, DX, SI, DI 490 406 ;-------------------------------------------------------------------- 491 407 ALIGN JUMP_ALIGN … … 495 411 call RamVars_GetHardDiskCountFromBDAtoCX 496 412 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 542 428 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 ;-------------------------------------------------------------------- 496 ALIGN JUMP_ALIGN 497 PushHotkeyParamsAndFormat: 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 85 85 ; XT and XT+ Build default settings ; 86 86 ;-----------------------------------; 87 at ROMVARS.wFlags, dw FLG_ROMVARS_DRVXLAT | FLG_ROMVARS_ ROMBOOT | FLG_ROMVARS_MAXSIZE87 at ROMVARS.wFlags, dw FLG_ROMVARS_DRVXLAT | FLG_ROMVARS_MAXSIZE 88 88 at ROMVARS.bIdeCnt, db 1 ; Number of supported controllers 89 89 at ROMVARS.bBootDrv, db 80h ; Boot Menu default drive -
trunk/XTIDE_Universal_BIOS/Src/Strings.asm
r88 r92 15 15 g_szFloppyDrv: db "Floppy Drive",NULL 16 16 g_szHardDrv: db " Hard Drive ",NULL 17 g_szTryToBoot: db "Booting from %s %x", 175,"%x ... ",NULL17 g_szTryToBoot: db "Booting from %s %x",ANGLE_QUOTE_RIGHT,"%x ... ",NULL 18 18 g_szBootSector: db "Boot Sector",NULL 19 19 g_szFound: db "found",NULL 20 20 g_szSectRead: db "%s %s!",CR,LF,NULL 21 21 g_szReadError: db "Error %x!",CR,LF,NULL 22 g_sz18hCallback:db "Boot menu callback via INT 18h",NULL23 22 24 23 ; Boot menu bottom of screen strings 25 24 g_szFDD: db "FDD",NULL 26 25 g_szHDD: db "HDD",NULL 27 g_szBottomScrn: db "%c to %c boots from %s with %s mappings",CR,LF,NULL 26 g_szRomBoot: db "ROM Boot",NULL 27 g_szHotkey: db "%A%c%c%A%8s%a ",NULL 28 28 29 29 30 ; Boot Menu menuitem strings 30 31 g_szFDLetter: db "%s %c",NULL 31 32 g_szforeignHD: db "Foreign Hard Disk",NULL 32 g_szRomBoot: db "ROM Boot",NULL33 33 34 34 ; Boot Menu information strings … … 43 43 g_szLBA48: db "LBA48",NULL 44 44 g_szFddUnknown: db "%sUnknown",NULL 45 g_szFddSizeOr: db "%s5", 172,22h," or 3",171,22h," DD",NULL46 g_szFddSize: db "%s%c%c", 22h,", %u kiB",NULL ; 3½", 1440 kiB45 g_szFddSizeOr: db "%s5",ONE_QUARTER,QUOTATION_MARK," or 3",ONE_HALF,QUOTATION_MARK," DD",NULL 46 g_szFddSize: db "%s%c%c",QUOTATION_MARK,", %u kiB",NULL ; 3½", 1440 kiB
Note:
See TracChangeset
for help on using the changeset viewer.