Exemplo n.º 1
0
/**
  * Show and process the "System" dialog (specific to winUAE cpu).
  */
void Dialog_SystemDlg(void)
{
    int i;
    int but;

    SDLGui_CenterDlg(systemdlg);

    /* Set up dialog from actual values: */

    /* System type: */
    for (i = DLGSYS_CUBE030; i <= DLGSYS_SLAB; i++)
    {
        systemdlg[i].state &= ~SG_SELECTED;
    }
    if (ConfigureParams.System.nMachineType == NEXT_CUBE030)
        systemdlg[DLGSYS_CUBE030].state |= SG_SELECTED;
    else if (ConfigureParams.System.nMachineType == NEXT_STATION)
        systemdlg[DLGSYS_SLAB].state |= SG_SELECTED;


    /* System overview */
    print_system_overview();


    /* Draw and process the dialog: */

    do
    {
        but = SDLGui_DoDialog(systemdlg, NULL);
        switch (but) {
        case DLGSYS_CUBE030:
            ConfigureParams.System.nMachineType = NEXT_CUBE030;
            get_default_values();
            break;

        case DLGSYS_CUBE:
            if (ConfigureParams.System.nMachineType!=NEXT_CUBE040) {
                ConfigureParams.System.bTurbo = false;
            }
            ConfigureParams.System.nMachineType = NEXT_CUBE040;
            get_default_values();
            break;

        case DLGSYS_CUBETURBO:
            if (ConfigureParams.System.bTurbo &&
                    ConfigureParams.System.nMachineType==NEXT_CUBE040) {
                ConfigureParams.System.bTurbo = false;
            } else {
                ConfigureParams.System.bTurbo = true;
            }
            ConfigureParams.System.nMachineType = NEXT_CUBE040;
            get_default_values();
            break;

        case DLGSYS_SLAB:
            if (ConfigureParams.System.nMachineType!=NEXT_STATION) {
                ConfigureParams.System.bTurbo = false;
            }
            ConfigureParams.System.nMachineType = NEXT_STATION;
            get_default_values();
            break;

        case DLGSYS_SLABCOLOR:
            if (ConfigureParams.System.nMachineType!=NEXT_STATION) {
                ConfigureParams.System.bTurbo = false;
            }
            if (ConfigureParams.System.bColor) {
                ConfigureParams.System.bColor = false;
            } else {
                ConfigureParams.System.bColor = true;
            }
            ConfigureParams.System.nMachineType = NEXT_STATION;
            get_default_values();
            break;

        case DLGSYS_SLABTURBO:
            if (ConfigureParams.System.bTurbo &&
                    ConfigureParams.System.nMachineType==NEXT_STATION) {
                ConfigureParams.System.bTurbo = false;
            } else {
                ConfigureParams.System.bTurbo = true;
            }
            ConfigureParams.System.nMachineType = NEXT_STATION;
            get_default_values();
            break;

        case DLGSYS_CUSTOMIZE:
            Dialog_AdvancedDlg();
            break;

        case DLGSYS_RESET:
            get_default_values();
            break;

        case DLGSYS_MEMORY:
            Dialog_MemDlg();
            break;

        default:
            break;
        }

        print_system_overview();
    }
    while (but != DLGSYS_EXIT && but != SDLGUI_QUIT
            && but != SDLGUI_ERROR && !bQuitProgram);


    /* Obsolete */
    ConfigureParams.System.bCompatibleCpu = 1;
    ConfigureParams.System.bBlitter = 0;
    ConfigureParams.System.bRealTimeClock = 0;
    ConfigureParams.System.bPatchTimerD = 0;
    ConfigureParams.System.bAddressSpace24 = 0;
    ConfigureParams.System.bCycleExactCpu = 0;
    ConfigureParams.System.bCompatibleFPU = 1;
    ConfigureParams.System.bMMU = 1;
}
Exemplo n.º 2
0
/**
 * This functions sets up the actual font and then displays the main dialog.
 */
int Dialog_MainDlg(bool *bReset, bool *bLoadedSnapshot)
{
	int retbut;
	bool bOldMouseVisibility;
	int nOldMouseX, nOldMouseY;
	char *psNewCfg;

	*bReset = false;
	*bLoadedSnapshot = false;

	if (SDLGui_SetScreen(sdlscrn))
		return false;

	SDL_GetMouseState(&nOldMouseX, &nOldMouseY);
	bOldMouseVisibility = SDL_ShowCursor(SDL_QUERY);
	SDL_ShowCursor(SDL_ENABLE);

	SDLGui_CenterDlg(maindlg);

	maindlg[MAINDLG_NORESET].state |= SG_SELECTED;
	maindlg[MAINDLG_RESET].state &= ~SG_SELECTED;

	do
	{
		retbut = SDLGui_DoDialog(maindlg, NULL);
		switch (retbut)
		{
		 case MAINDLG_ABOUT:
			Dialog_AboutDlg();
			break;
		 case MAINDLG_FLOPPYS:
			DlgFloppy_Main();
			break;
		 case MAINDLG_HARDDISK:
			DlgHardDisk_Main();
			break;
		 case MAINDLG_ROM:
			DlgRom_Main();
			break;
		 case MAINDLG_MONITOR:
			Dialog_MonitorDlg();
			break;
		 case MAINDLG_WINDOW:
			Dialog_WindowDlg();
			break;
		 case MAINDLG_SYSTEM:
			Dialog_SystemDlg();
			break;
		 case MAINDLG_MEMORY:
			if (Dialog_MemDlg())
			{
				/* Memory snapshot has been loaded - leave GUI immediately */
				*bLoadedSnapshot = true;
				SDL_ShowCursor(bOldMouseVisibility);
				Main_WarpMouse(nOldMouseX, nOldMouseY);
				return true;
			}
			break;
		 case MAINDLG_JOY:
			Dialog_JoyDlg();
			break;
		 case MAINDLG_KEYBD:
			Dialog_KeyboardDlg();
			break;
		 case MAINDLG_DEVICES:
			Dialog_DeviceDlg();
			break;
		 case MAINDLG_SOUND:
			Dialog_SoundDlg();
			break;
		 case MAINDLG_LOADCFG:
			psNewCfg = SDLGui_FileSelect(sConfigFileName, NULL, false);
			if (psNewCfg)
			{
				strcpy(sConfigFileName, psNewCfg);
				Configuration_Load(NULL);
				free(psNewCfg);
			}
			break;
		 case MAINDLG_SAVECFG:
			psNewCfg = SDLGui_FileSelect(sConfigFileName, NULL, true);
			if (psNewCfg)
			{
				strcpy(sConfigFileName, psNewCfg);
				Configuration_Save();
				free(psNewCfg);
			}
			break;
		 case MAINDLG_QUIT:
			bQuitProgram = true;
			break;
		}
                gui_poll_events();

	}
	while (retbut != MAINDLG_OK && retbut != MAINDLG_CANCEL && retbut != SDLGUI_QUIT
	        && retbut != SDLGUI_ERROR && !bQuitProgram);


	if (maindlg[MAINDLG_RESET].state & SG_SELECTED)
		*bReset = true;

	SDL_ShowCursor(bOldMouseVisibility);
	Main_WarpMouse(nOldMouseX, nOldMouseY);

	return (retbut == MAINDLG_OK);
}
Exemplo n.º 3
0
Arquivo: dlgMain.c Projeto: engur/PUAE
/**
 * This functions sets up the actual font and then displays the main dialog.
 */
int Dialog_MainDlg(bool *bReset, bool *bLoadedSnapshot)
{
	int retbut=0;
	bool bOldMouseVisibility;
	int nOldMouseX, nOldMouseY;
	char *psNewCfg;

	*bReset = false;
	*bLoadedSnapshot = false;

	if (SDLGui_SetScreen(/*sdlscrn*/))
		return false;

	SDLGui_CenterDlg(maindlg);

	maindlg[MAINDLG_NORESET].state |= SG_SELECTED;
	maindlg[MAINDLG_RESET].state &= ~SG_SELECTED;

	do
	{
		retbut = SDLGui_DoDialog(maindlg, NULL);
		switch (retbut)
		{
		 case MAINDLG_ABOUT:
			Dialog_AboutDlg();
			break;

		 case MAINDLG_FLOPPYS:
			DlgFloppy_Main();
			break;

		 case MAINDLG_HARDDISK:
			DlgHardDisk_Main();
			break;

		 case MAINDLG_ROM:
			DlgRom_Main();
			break;

		 case MAINDLG_VIDEO:
			Dialog_VideoDlg();
			break;

		 case MAINDLG_SYSTEM:
			Dialog_SystemDlg();
			break;

		 case MAINDLG_MEMORY:
			if (Dialog_MemDlg())
			{
				/* Memory snapshot has been loaded - leave GUI immediately */
				*bLoadedSnapshot = true;
				//Main_WarpMouse(nOldMouseX, nOldMouseY);
				return true;
			}
			break;

		 case MAINDLG_MISC:
			Dialog_MiscDlg();
			break;

		 case MAINDLG_JOYSTICK:
			Dialog_JoyDlg();
			break;

		 case MAINDLG_SOUND:
			Dialog_SoundDlg();
			break;

		 case MAINDLG_LOADCFG:
			strcpy(sConfigFileName, ".uaerc");
			psNewCfg = SDLGui_FileSelect(sConfigFileName, NULL, false);
			if (psNewCfg)
			{
					default_prefs(& changed_prefs, 0);
					changed_prefs.chipmem_size = 0;
					changed_prefs.bogomem_size = 0;
					unmount_all_hdfs();
					int ret = cfgfile_load (& changed_prefs, psNewCfg, NULL,1,0);
					if (ret) {

						check_prefs_changed_cpu();
						check_prefs_changed_audio();
						check_prefs_changed_custom();

						MUSTRESET_CFG=1;
					}


				strcpy(sConfigFileName, psNewCfg);

			}
			break;

		 case MAINDLG_QUIT:
			bQuitProgram = true;
			break;
		}
                gui_poll_events();
	}
	while (retbut != MAINDLG_OK && retbut != MAINDLG_CANCEL && retbut != SDLGUI_QUIT
	        && retbut != SDLGUI_ERROR && !bQuitProgram);


	if (maindlg[MAINDLG_RESET].state & SG_SELECTED)
		*bReset = true;

	return (retbut == MAINDLG_OK);
}