Changeset 2913 in vbox
- Timestamp:
- May 29, 2007 12:29:12 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/BIOS/logo.c
r2880 r2913 446 446 /** 447 447 * Fade in and check for keystroke. 448 * @returns BIOS scan code if available, 0 if not.448 * @returns 1 if F12 was pressed, 0 if not. 449 449 */ 450 450 Bit8u fade_in(palette_seg, palette_size) … … 454 454 RGBPAL *palette; 455 455 Bit16u i, j; 456 Bit8u scode , scan_code = 0;456 Bit8u scode; 457 457 458 458 // Fade in … … 482 482 } 483 483 scode = wait(16 / WAIT_MS, 0); 484 if (scode )485 scan_code = scode;484 if (scode == F12_SCAN_CODE) 485 return 1; 486 486 } 487 487 488 return scan_code;488 return 0; // F12 not pressed 489 489 } 490 490 491 491 /** 492 492 * Fade out and check for keystroke. 493 * @returns BIOS scan code if available, 0 if not.493 * @returns 1 if F12 was pressed, 0 if not. 494 494 */ 495 495 Bit8u fade_out(palette_seg, palette_size) … … 499 499 RGBPAL *palette; 500 500 Bit16u i, j; 501 Bit8u scode , scan_code = 0;501 Bit8u scode; 502 502 503 503 // Fade out … … 527 527 } 528 528 scode = wait(16 / WAIT_MS, 0); 529 if (scode )530 scan_code = scode;529 if (scode == F12_SCAN_CODE) 530 return 1; 531 531 } 532 532 533 return scan_code;533 return 0; // F12 not pressed 534 534 } 535 535 … … 583 583 Bit16u address; 584 584 585 Bit8u scode, scan_code= 0;585 Bit8u scode, f12_pressed = 0; 586 586 Bit8u c; 587 587 … … 977 977 if (is_fade_in) 978 978 { 979 scode = fade_in(pal_seg, palette_size); 980 if (scode && scan_code != F12_SCAN_CODE) 981 scan_code = scode; 979 if (fade_in(pal_seg, palette_size)) 980 f12_pressed = 1; 982 981 } 983 982 984 983 // Wait (interval in milliseconds) 985 scode = wait(logo_time / WAIT_MS, 0); 986 if (scode && scan_code != F12_SCAN_CODE) 987 scan_code = scode; 988 989 // Fade out 990 if (is_fade_out) 991 { 992 scode = fade_out(pal_seg, palette_size); 993 if (scode && scan_code != F12_SCAN_CODE) 994 scan_code = scode; 984 if (!f12_pressed) 985 { 986 scode = wait(logo_time / WAIT_MS, 0); 987 if (scode == F12_SCAN_CODE) 988 f12_pressed = 1; 989 } 990 991 // Fade out (only if F12 was not pressed) 992 if (is_fade_out && !f12_pressed) 993 { 994 if (fade_out(pal_seg, palette_size)) 995 f12_pressed = 1; 995 996 } 996 997 } … … 1038 1039 1039 1040 // if the user has pressed F12 don't wait here 1040 if ( scan_code != F12_SCAN_CODE)1041 if (!f12_pressed) 1041 1042 { 1042 1043 // Wait for timeout or keystroke 1043 scan_code = wait(F12_WAIT_TIME, 1); 1044 scode = wait(F12_WAIT_TIME, 1); 1045 if (scode == F12_SCAN_CODE) 1046 f12_pressed = 1; 1044 1047 } 1045 1048 } 1046 1049 1047 1050 // If F12 pressed, show boot menu 1048 if ( scan_code == F12_SCAN_CODE)1051 if (f12_pressed) 1049 1052 { 1050 1053 // Hide cursor, clear screen and move cursor to starting position … … 1075 1078 1076 1079 // Show menu 1077 printf("\n"); 1078 printf("VirtualBox temporary boot device selection\n"); 1079 printf("\n"); 1080 printf(" 1) Floppy\n"); 1081 printf(" 2) Hard Disk\n"); 1082 printf(" 3) CD-ROM\n"); 1083 printf(" 4) LAN\n\n"); 1084 printf(" 0) Continue booting\n"); 1080 printf("\n" 1081 "VirtualBox temporary boot device selection\n" 1082 "\n" 1083 " 1) Floppy\n" 1084 " 2) Hard Disk\n" 1085 " 3) CD-ROM\n" 1086 " 4) LAN\n" 1087 "\n" 1088 " 0) Continue booting\n"); 1085 1089 1086 1090 // Wait for keystroke 1087 do1091 for (;;) 1088 1092 { 1089 scan_code = wait(WAIT_HZ, 1); 1090 } while (scan_code == 0); 1091 1092 // Change first boot device code to selected one 1093 if (scan_code > 0x02 && scan_code <= 0x05) 1094 { 1095 write_byte(ebda_seg,&EbdaData->uForceBootDrive, scan_code-1); 1093 do 1094 { 1095 scode = wait(WAIT_HZ, 1); 1096 } while (scode == 0); 1097 1098 // Change first boot device code to selected one 1099 if (scode > 0x02 && scode <= 0x05) 1100 { 1101 write_byte(ebda_seg,&EbdaData->uForceBootDrive, scode-1); 1102 break; 1103 } 1104 1105 // '0' ... continue 1106 if (scode == 0x0b) 1107 break; 1096 1108 } 1097 1109
Note:
See TracChangeset
for help on using the changeset viewer.