␉␉␉}␊ |
}␊ |
␉␊ |
␉␉if( bootArgs->Video.v_display == GRAPHICS_MODE )␊ |
␉␉if( bootArgs->Video.v_display != VGA_TEXT_MODE )␊ |
␉␉{␊ |
␉␉␉drawProgressBar( gui.screen.pixmap, 100, gui.progressbar.pos , ( multi * 100 / multi_buff ) );␊ |
␉␉␉gui.redraw = true;␊ |
|
␊ |
//==========================================================================␊ |
//Azi: bootargs reminder␊ |
static char gBootArgs[BOOT_STRING_LEN];␊ |
//static - getc --> getchar␊ |
char gBootArgs[BOOT_STRING_LEN];␊ |
static char * gBootArgsPtr = gBootArgs;␊ |
static char * gBootArgsEnd = gBootArgs + BOOT_STRING_LEN - 1;␊ |
static char booterCommand[BOOT_STRING_LEN];␊ |
|
␉gBootArgsPtr = gBootArgs;␊ |
␉memset(gBootArgs, '\0', BOOT_STRING_LEN);␊ |
␊ |
␉if (bootArgs->Video.v_display == GRAPHICS_MODE) {␊ |
␉if (bootArgs->Video.v_display != VGA_TEXT_MODE) {␊ |
␉␉clearGraphicBootPrompt();␊ |
␉}␊ |
}␊ |
|
␉␉clearScreenRows( row, kScreenLastRow );␊ |
␉}␊ |
␊ |
␉clearBootArgs();␊ |
//␉clearBootArgs();␊ |
␊ |
␉if (visible) {␊ |
␉␉if (bootArgs->Video.v_display == VGA_TEXT_MODE) {␊ |
|
␉␉␉␉printf( bootRescanPrompt );␊ |
␉␉␉} else {␊ |
␉␉␉␉printf( bootPrompt );␊ |
␉␉␉␉printf( gBootArgs );␊ |
␉␉␉}␊ |
␉␉}␊ |
␉} else {␊ |
␉␉if (bootArgs->Video.v_display == GRAPHICS_MODE) {␊ |
␉␉␉clearGraphicBootPrompt();␊ |
␉␉if (bootArgs->Video.v_display != VGA_TEXT_MODE) {␊ |
//␉␉␉clearGraphicBootPrompt();␊ |
␉␉} else {␊ |
␉␉␉printf("Press Enter to start up the foreign OS. ");␊ |
␉␉}␊ |
|
case kBackspaceKey:␊ |
if ( gBootArgsPtr > gBootArgs )␊ |
{␊ |
*--gBootArgsPtr = '\0';␊ |
␊ |
int x, y, t;␊ |
getCursorPositionAndType( &x, &y, &t );␊ |
if ( x == 0 && y )␊ |
{␊ |
x = 80; y--;␊ |
}␊ |
if (x)␊ |
␉␉␉␉␉x--;␊ |
if (x) x--;␊ |
␊ |
␉␉␉␉if( bootArgs->Video.v_display == VGA_TEXT_MODE )␊ |
␉␉␉␉{␊ |
␉␉␉␉␉setCursorPosition( x, y, 0 );␊ |
␉␉␉␉␉putca(' ', 0x07, 1);␊ |
␉␉␉␉} else␊ |
␉␉␉␉␉updateGraphicBootPrompt(kBackspaceKey);␊ |
␉␉␉␊ |
␉␉␉␉*gBootArgsPtr-- = '\0';␊ |
␉␉␉}␊ |
␊ |
␉␉␉␉}␊ |
else␊ |
{␊ |
updateGraphicBootPrompt();␊ |
}␊ |
} ␊ |
␉␉␉break;␊ |
␊ |
default:␊ |
if ( key >= ' ' && gBootArgsPtr < gBootArgsEnd)␊ |
{␊ |
␉␉␉␉if( bootArgs->Video.v_display == VGA_TEXT_MODE )␊ |
␉␉␉␉␉putchar(key); // echo to screen␊ |
␉␉␉␉else␊ |
␉␉␉␉␉updateGraphicBootPrompt(key);␊ |
␉␉␉␉␊ |
␉␉␉␉*gBootArgsPtr++ = key;␊ |
*gBootArgsPtr++ = key;␊ |
␊ |
if( bootArgs->Video.v_display != VGA_TEXT_MODE ) updateGraphicBootPrompt();␊ |
else if ( key >= ' ' && key < 0x7f) putchar(key);␊ |
␉␉␉}␊ |
␊ |
␉␉␉break;␊ |
|
␉␊ |
␉// Draw the visible items.␊ |
␊ |
␉if( bootArgs->Video.v_display == GRAPHICS_MODE )␊ |
␉if( bootArgs->Video.v_display != VGA_TEXT_MODE )␊ |
␉␊ |
␉␉drawDeviceList(gMenuStart, gMenuEnd, gMenuSelection);␊ |
␊ |
|
if ( gMenuItems == NULL )␊ |
␉␉return 0;␊ |
␊ |
␉if( bootArgs->Video.v_display == GRAPHICS_MODE )␊ |
␉if( bootArgs->Video.v_display != VGA_TEXT_MODE )␊ |
␉{␊ |
␉␉int res;␊ |
␉␉␊ |
|
␉}␊ |
␊ |
␉// ensure we're in graphics mode if gui is setup␊ |
␉if (gui.initialised && bootArgs->Video.v_display == VGA_TEXT_MODE)␊ |
␉if (firstRun && gui.initialised && bootArgs->Video.v_display == VGA_TEXT_MODE)␊ |
␉{␊ |
␉␉setVideoMode(GRAPHICS_MODE, 0);␊ |
␉}␊ |
|
␉␉}␊ |
␉}␊ |
␊ |
␉if (bootArgs->Video.v_display == GRAPHICS_MODE) {␊ |
␉if (bootArgs->Video.v_display != VGA_TEXT_MODE) {␊ |
␉␉// redraw the background buffer␊ |
␉␉gui.logo.draw = true;␊ |
␉␉drawBackground();␊ |
|
␉showBootPrompt( nextRow, showPrompt );␊ |
␉␊ |
␉do {␊ |
␉␉if (bootArgs->Video.v_display == GRAPHICS_MODE) {␊ |
␉␉if (bootArgs->Video.v_display != VGA_TEXT_MODE) {␊ |
␉␉␉// redraw background␊ |
␉␉␉memcpy( gui.backbuffer->pixels, gui.screen.pixmap->pixels, gui.backbuffer->width * gui.backbuffer->height * 4 );␊ |
␉␉␉// reset cursor co-ords␊ |
␉␉␉gui.debug.cursor = pos( gui.screen.width - 160 , 10 );␊ |
␉␉}␊ |
␉␉key = getc(); //getchar(); Azi: getc stuff␊ |
␉␉key = getchar();␊ |
␉␉updateMenu( key, (void **) &menuBVR );␊ |
␉␉newShowPrompt = (gDeviceCount == 0) || (menuBVR->flags & kBVFlagNativeBoot);␊ |
␊ |
|
␉␉␉␉*/␊ |
␉␉␉␉if (strcmp( booterCommand, "video" ) == 0)␊ |
␉␉␉␉{␊ |
␉␉␉␉␉if (bootArgs->Video.v_display == GRAPHICS_MODE)␊ |
␉␉␉␉␉if (bootArgs->Video.v_display != VGA_TEXT_MODE)␊ |
␉␉␉␉␉{␊ |
␉␉␉␉␉␉showInfoBox(getVBEInfoString(), getVBEModeInfoString());␊ |
␉␉␉␉␉}␊ |
|
␉␉␉␉}␊ |
␉␉␉␉else if ( strcmp( booterCommand, "memory" ) == 0)␊ |
␉␉␉␉{␊ |
␉␉␉␉␉if (bootArgs->Video.v_display == GRAPHICS_MODE )␊ |
␉␉␉␉␉if (bootArgs->Video.v_display != VGA_TEXT_MODE )␊ |
␉␉␉␉␉{␊ |
␉␉␉␉␉␉showInfoBox("Memory Map", getMemoryInfoString());␊ |
␉␉␉␉␉}␊ |
|
␉␉// AutoResolution - Reapply the patch if Graphics Mode was incorrect␊ |
␉␉// or EDID Info was insane. ␊ |
␉␉case kF2Key:␊ |
␉␉␉reloadAutoRes();␊ |
␉␉␉reloadAutoRes(); // clearBootArgs is on the function␊ |
␉␉␉break;␊ |
␉␉␉␊ |
␉␉case kF5Key:␊ |
|
␉␉␉// Switch between text & graphic interfaces␊ |
␉␉␉// Only Permitted if started in graphics interface␊ |
␉␉␉if (useGUI) {␊ |
␉␉␉␉if (bootArgs->Video.v_display == GRAPHICS_MODE) {␊ |
␉␉␉␉if (bootArgs->Video.v_display != VGA_TEXT_MODE) {␊ |
␉␉␉␉␉setVideoMode(VGA_TEXT_MODE, 0);␊ |
␊ |
␉␉␉␉␉setCursorPosition(0, 0, 0);␊ |
|
␉␉␉␉␉gui.redraw = true;␊ |
␉␉␉␉␉setVideoMode(GRAPHICS_MODE, 0);␊ |
␉␉␉␉␉updateVRAM();␊ |
␉␉␉␉␉updateGraphicBootPrompt();␊ |
␉␉␉␉}␊ |
␉␉␉}␊ |
␉␉␉key = 0;␊ |
|
␉int␉line_offset;␊ |
␉int␉c;␊ |
␊ |
␉if (bootArgs->Video.v_display == GRAPHICS_MODE) {␊ |
␉if (bootArgs->Video.v_display != VGA_TEXT_MODE) {␊ |
␉␉showInfoBox( "Press q to quit\n",buf );␊ |
␉␉return;␊ |
␉}␊ |
|
␉␉␉printf("[Type %s%sq to quit viewer]", (line_offset > 0) ? "p for previous page, " : "", (*bp != '\1') ? "space for next page, " : "");␊ |
␉␉}␊ |
␊ |
␉␉c = getc(); //getchar(); Azi: getc stuff␊ |
␉␉c = getchar();␊ |
␉␉if (c == 'q' || c == 'Q') {␊ |
␉␉␉break;␊ |
␉␉}␊ |
|
␊ |
void showHelp(void)␊ |
{␊ |
␉if (bootArgs->Video.v_display == GRAPHICS_MODE) {␊ |
␉if (bootArgs->Video.v_display != VGA_TEXT_MODE) {␊ |
␉␉showInfoBox("Help. Press q to quit.\n", (char *)BootHelp_txt);␊ |
␉} else {␊ |
␉␉showTextBuffer((char *)BootHelp_txt, BootHelp_txt_len);␊ |
|
␉printf("Typical boot devices are 80 (First HD), 81 (Second HD)\n");␊ |
␉printf("Enter two-digit hexadecimal boot device [%02x]: ", bootdevice);␊ |
␉do {␊ |
␉␉key = getc(); //getchar(); Azi: getc stuff␊ |
␉␉key = getchar();␊ |
␉␉switch (key & kASCIIKeyMask) {␊ |
␉␉case kBackspaceKey:␊ |
␉␉␉if (digitsI > 0) {␊ |
|
bool promptForRescanOption(void)␊ |
{␊ |
␉printf("\nWould you like to enable media rescan option?\nPress ENTER to enable or any key to skip.\n");␊ |
␉if ( getc()/*getchar(); Azi: getc stuff*/ == kReturnKey) {␊ |
␉if (getchar() == kReturnKey) {␊ |
␉␉return true;␊ |
␉} else {␊ |
␉␉return false;␊ |