Esempio n. 1
0
/**
 * Shortcut to toggle full-screen
 */
static void ShortCut_FullScreen(void)
{
	if (!bInFullScreen)
	{
		Screen_EnterFullScreen();
	}
	else
	{
		Screen_ReturnFromFullScreen();
	}
}
Esempio n. 2
0
File: change.c Progetto: juddy/PrEV
/**
 * Copy details back to configuration and perform reset.
 */
bool Change_CopyChangedParamsToConfiguration(CNF_PARAMS *current, CNF_PARAMS *changed, bool bForceReset)
{
	bool NeedReset;
	bool bReInitSCSIEmu = false;
	bool bReInitEnetEmu = false;
    bool bReInitSoundEmu = false;
	bool bReInitIoMem = false;
	bool bScreenModeChange = false;
	int i;

	Dprintf("Changes for:\n");
	/* Do we need to warn user that changes will only take effect after reset? */
	if (bForceReset)
		NeedReset = bForceReset;
	else
		NeedReset = Change_DoNeedReset(current, changed);
    
    /* Do we need to change SCSI disks? */
    for (i = 0; i < ESP_MAX_DEVS; i++) {
        if (!NeedReset &&
            (current->SCSI.target[i].bDiskInserted != changed->SCSI.target[i].bDiskInserted ||
             current->SCSI.target[i].bWriteProtected != changed->SCSI.target[i].bWriteProtected ||
             strcmp(current->SCSI.target[i].szImageName, changed->SCSI.target[i].szImageName))) {
            bReInitSCSIEmu = true;
            break;
        }
    }
    
    /* Note: MO and floppy disk insert/eject called from GUI */
    
    /* Do we need to change Ethernet connection? */
    if (!NeedReset && current->Ethernet.bEthernetConnected != changed->Ethernet.bEthernetConnected) {
        bReInitEnetEmu = true;
    }
    
    /* Do we need to change Sound configuration? */
    if (!NeedReset &&
        (current->Sound.bEnableSound != changed->Sound.bEnableSound ||
         current->Sound.bEnableMicrophone != changed->Sound.bEnableMicrophone)) {
        bReInitSoundEmu = true;
    }

	/* Copy details to configuration,
	 * so it can be saved out or set on reset
	 */
	if (changed != &ConfigureParams)
	{
		ConfigureParams = *changed;
	}

	/* Copy details to global, if we reset copy them all */
	Configuration_Apply(NeedReset);
    
    /* Check if all necessary files exist */
    Dialog_CheckFiles();
    if (bQuitProgram)
    {
        SDL_Quit();
        exit(-2);
    }

	/* Re-init IO memory map? */
	if (bReInitIoMem)
	{
		Dprintf("- IO mem<\n");
		IoMem_Init();
	}
    
    /* Re-init SCSI disks? */
    if (bReInitSCSIEmu) {
        Dprintf("- SCSI disks<\n");
        SCSI_Reset();
    }
    
    /* Re-init Ethernet? */
    if (bReInitEnetEmu) {
        Dprintf("- Ethernet<\n");
        Ethernet_Reset(false);
    }
    
    /* Re-init Sound? */
    if (bReInitSoundEmu) {
        Dprintf("- Sound<\n");
        Sound_Reset();
    }

	/* Force things associated with screen change */
	if (bScreenModeChange)
	{
		Dprintf("- screenmode<\n");
		Screen_ModeChanged();
	}

	/* Do we need to perform reset? */
	if (NeedReset)
	{
		const char *err_msg;
		Dprintf("- reset\n");
		err_msg=Reset_Cold();
//		if (err_msg!=NULL) {
//			DlgAlert_Notice(err_msg);
//			return false;
//		}
	}

	/* Go into/return from full screen if flagged */
	if (!bInFullScreen && ConfigureParams.Screen.bFullScreen)
		Screen_EnterFullScreen();
	else if (bInFullScreen && !ConfigureParams.Screen.bFullScreen)
		Screen_ReturnFromFullScreen();

	/* update statusbar info (CPU, MHz, mem etc) */
	Statusbar_UpdateInfo();
	Dprintf("done.\n");
	return true;
}