Changeset 92 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm
- Timestamp:
- Jan 27, 2011, 5:44:27 PM (14 years ago)
- google:author:
- aitotat
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.