Esempio n. 1
0
void
UpdateEMUCore(Config *config)
{
    int ntsccol, ntsctint, ntschue, flag, start, end;
    std::string cpalette;

    config->getOption("SDL.NTSCpalette", &ntsccol);
    config->getOption("SDL.Tint", &ntsctint);
    config->getOption("SDL.Hue", &ntschue);
    FCEUI_SetNTSCTH(ntsccol, ntsctint, ntschue);

    config->getOption("SDL.Palette", &cpalette);
    if(cpalette.size()) {
        LoadCPalette(cpalette);
    }

    config->getOption("SDL.PAL", &flag);
    FCEUI_SetVidSystem(flag ? 1 : 0);

    config->getOption("SDL.GameGenie", &flag);
    FCEUI_SetGameGenie(flag ? 1 : 0);

    config->getOption("SDL.Sound.LowPass", &flag);
    FCEUI_SetLowPass(flag ? 1 : 0);

    config->getOption("SDL.DisableSpriteLimit", &flag);
    FCEUI_DisableSpriteLimitation(flag ? 1 : 0);

    //Not used anymore.
    //config->getOption("SDL.SnapName", &flag);
    //FCEUI_SetSnapName(flag ? true : false);

    config->getOption("SDL.ScanLineStart", &start);
    config->getOption("SDL.ScanLineEnd", &end);

#if DOING_SCANLINE_CHECKS
    for(int i = 0; i < 2; x++) {
        if(srendlinev[x]<0 || srendlinev[x]>239) srendlinev[x]=0;
        if(erendlinev[x]<srendlinev[x] || erendlinev[x]>239) erendlinev[x]=239;
    }
#endif

    FCEUI_SetRenderedLines(start + 8, end - 8, start, end);
}
Esempio n. 2
0
void UpdateEMUCore(Config *config)
{
	FCEUI_SetVidSystem(0);

	FCEUI_SetGameGenie(0);

	FCEUI_SetLowPass(0);

	FCEUI_DisableSpriteLimitation(0);

	int start = 0, end = 239;
// TODO: tsone: can be removed? not sure what this is.. it's disabled due to #define
#if DOING_SCANLINE_CHECKS
	for(int i = 0; i < 2; x++) {
		if(srendlinev[x]<0 || srendlinev[x]>239) srendlinev[x]=0;
		if(erendlinev[x]<srendlinev[x] || erendlinev[x]>239) erendlinev[x]=239;
	}
#endif
	FCEUI_SetRenderedLines(start + 8, end - 8, start, end);
}
bool Emulator_Implementation_InitSettings()
{
	LOG_DBG("Emulator_Implementation_InitSettings()");

	memset((&Settings), 0, (sizeof(Settings)));

	currentconfig.Clear();

	#ifdef SYS_CONFIG_FILE
		try_load_config_file(SYS_CONFIG_FILE, currentconfig);
	#endif

	//PS3 - General settings	
	if (currentconfig.Exists("PS3General::KeepAspect"))
	{
		Settings.PS3KeepAspect		=	currentconfig.GetBool("PS3General::KeepAspect");
	}
	else
	{
		Settings.PS3KeepAspect		=	true;
	}

	if (currentconfig.Exists("PS3General::Smooth"))
	{
		Settings.PS3Smooth		=	currentconfig.GetBool("PS3General::Smooth");
	}
	else
	{
		Settings.PS3Smooth		=	false;
	}

	if (currentconfig.Exists("PS3General::OverscanEnabled"))
	{
		Settings.PS3OverscanEnabled	= currentconfig.GetBool("PS3General::OverscanEnabled");
	}
	else
	{
		Settings.PS3OverscanEnabled	= false;
	}
	if (currentconfig.Exists("PS3General::OverscanAmount"))
	{
		Settings.PS3OverscanAmount	= currentconfig.GetInt("PS3General::OverscanAmount");
	}
	else
	{
		Settings.PS3OverscanAmount	= 0;
	}

	if (currentconfig.Exists("FCEU::Controlstyle"))
	{
		Settings.FCEUControlstyle = currentconfig.GetInt("FCEU::Controlstyle");
		control_style = (ControlStyle)(((int)Settings.FCEUControlstyle));
	}
	else
	{
		Settings.FCEUControlstyle = CONTROL_STYLE_ORIGINAL;
		control_style = CONTROL_STYLE_ORIGINAL;
	}

	if (currentconfig.Exists("FCEU::DisableSpriteLimitation"))
	{
		Settings.FCEUDisableSpriteLimitation = currentconfig.GetBool("FCEU::DisableSpriteLimitation");
		FCEUI_DisableSpriteLimitation(Settings.FCEUDisableSpriteLimitation);
	}
	else
	{
		Settings.FCEUDisableSpriteLimitation = false;
	}

	if (currentconfig.Exists("PS3General::PS3CurrentShader"))
	{
		Settings.PS3CurrentShader.assign(currentconfig.GetString("PS3General::PS3CurrentShader"));
	}
	else
	{
		Settings.PS3CurrentShader.assign(DEFAULT_SHADER_FILE);
	}

	if (currentconfig.Exists("PS3General::PS3CurrentResolution"))
	{
		Settings.PS3CurrentResolution = currentconfig.GetInt("PS3General::PS3CurrentResolution");
	}
	else
	{
		Settings.PS3CurrentResolution = NULL;
	}

	if (currentconfig.Exists("FCEU::GameGenie"))
	{
		Settings.FCEUGameGenie = currentconfig.GetBool("FCEU::GameGenie");
		FCEUI_SetGameGenie(Settings.FCEUGameGenie);
	}
	else
	{
		Settings.FCEUGameGenie = false;
	}
	FCEUI_SetGameGenie(Settings.FCEUGameGenie);
	if (currentconfig.Exists("PS3General::PS3PALTemporalMode60Hz"))
	{
		Settings.PS3PALTemporalMode60Hz = currentconfig.GetBool("PS3General::PS3PALTemporalMode60Hz");
	}
	else
	{
		Settings.PS3PALTemporalMode60Hz = false;
	}
	//RSound Settings
	if(currentconfig.Exists("RSound::RSoundEnabled"))
	{
		Settings.RSoundEnabled		= currentconfig.GetBool("RSound::RSoundEnabled");
	}
	else
	{
		Settings.RSoundEnabled		= false;
	}
	if(currentconfig.Exists("RSound::RSoundServerIPAddress"))
	{
		Settings.RSoundServerIPAddress	= currentconfig.GetString("RSound::RSoundServerIPAddress");
	}
	else
	{
		Settings.RSoundServerIPAddress = "0.0.0.0";
	}
	if(currentconfig.Exists("PS3General::Throttled"))
	{
		Settings.Throttled		= currentconfig.GetInt("PS3General::Throttled");
	}
	else
	{
		Settings.Throttled		= 1;
	}
	// PS3 Path Settings
	if (currentconfig.Exists("PS3Paths::PathSaveStates"))
	{
		Settings.PS3PathSaveStates		= currentconfig.GetString("PS3Paths::PathSaveStates");
	}
	else
	{
		Settings.PS3PathSaveStates		= USRDIR;
	}
	
	if (currentconfig.Exists("PS3Paths::PathSRAM"))
	{
		Settings.PS3PathSRAM		= currentconfig.GetString("PS3Paths::PathSRAM");
	}
	else
	{
		Settings.PS3PathSRAM		= USRDIR;
	}

	if (currentconfig.Exists("PS3Paths::PathCheats"))
	{
		Settings.PS3PathCheats		= currentconfig.GetString("PS3Paths::PathCheats");
	}
	else
	{
		Settings.PS3PathCheats		= USRDIR;
	}
	
	if (currentconfig.Exists("PS3Paths::PathScreenshots"))
	{
		Settings.PS3PathScreenshots		= currentconfig.GetString("PS3Paths::PathScreenshots");
	}
	else
	{
		Settings.PS3PathScreenshots		= USRDIR;
	}
	
	if (currentconfig.Exists("PS3Paths::PathROMDirectory"))
	{
		Settings.PS3PathROMDirectory		= currentconfig.GetString("PS3Paths::PathROMDirectory");
	}
	else
	{
		Settings.PS3PathROMDirectory		= "/";
	}
	if (currentconfig.Exists("PS3Paths::BaseDirectory"))
	{
		Settings.PS3PathBaseDirectory		= currentconfig.GetString("PS3Paths::PathBaseDirectory");
	}
	else
	{
		Settings.PS3PathBaseDirectory		= USRDIR;
	}
	if (currentconfig.Exists("PS3General::ControlScheme"))
	{
		Settings.ControlScheme = currentconfig.GetInt("PS3General::ControlScheme");
	}
	else
	{
		Settings.ControlScheme = CONTROL_SCHEME_DEFAULT;
	}
	Emulator_Implementation_SwitchControlScheme();

	LOG_DBG("SUCCESS - Emulator_Implementation_InitSettings()");
	return true;
}
Esempio n. 4
0
int VideoEnhancements()
{	
	int menu = 0;
	int quit = 0;
	short j;
	int redraw = 1;
	int i;
	unsigned char r,g,b;

	line = 0;
	scrollerx = 320 - MARGIN;

	while ( quit == 0)
	{
		if ( redraw )
			DrawMenu(&vemenu[0], vecount, menu );

		redraw = 0;

		j = PAD_ButtonsDown(0);

		if ( j & PAD_BUTTON_DOWN ) {
			menu++;
			redraw = 1;
		}

		if ( j & PAD_BUTTON_UP ) {
			menu--;
			redraw = 1;
		}

		if ( j & PAD_BUTTON_A ) {
			redraw = 1;
			switch ( menu ) {
				case 0:	/*** Scaler ***/
					screenscaler++;
					screenscaler = ( screenscaler > 2 ) ? 0 : screenscaler;

					switch ( screenscaler )
					{
						case 2: strcpy(vemenu[0], "Screen Scaler - GX"); break;
						case 1: strcpy(vemenu[0], "Screen Scaler - Cheesy"); break;
						case 0:	strcpy(vemenu[0], "Screen Scaler - 2x"); break;
					}
					break;
				case 1: /*** Palette ***/
					currpal++;
					if ( currpal > MAXPAL )
						currpal = 0;

					if ( currpal == 0 ) {
						strcpy(vemenu[1],"Palette - Default");
						/*** Do palette reset ***/
						FCEU_ResetPalette();
					} else {
						strcpy(vemenu[1],"Palette - ");
						strcat(vemenu[1], palettes[currpal-1].name);

						/*** Now setup this palette ***/
						for ( i = 0; i < 64; i++ )
						{
							r = palettes[currpal-1].data[i] >> 16;
							g = ( palettes[currpal-1].data[i] & 0xff00 ) >> 8;
							b = ( palettes[currpal-1].data[i] & 0xff );
							FCEUD_SetPalette( i, r, g, b);
							FCEUD_SetPalette( i+64, r, g, b);
							FCEUD_SetPalette( i+128, r, g, b);
							FCEUD_SetPalette( i+192, r, g, b);

						}
					}

					break;

				case 2: slimit ^=1;
					if ( slimit )
						strcpy(vemenu[2], "8 Sprite Limit - ON ");
					else
						strcpy(vemenu[2], "8 Sprite Limit - OFF");
					FCEUI_DisableSpriteLimitation( slimit );
					break;

				case 3: timing ^= 1;
					if ( timing )
						strcpy(vemenu[3], "Timing - PAL ");
					else
						strcpy(vemenu[3], "Timing - NTSC");

					FCEUI_SetVidSystem( timing );
					
					break;

				case 4: quit = 1; break;

				default: break;

			}
		}
		
		if ( j & PAD_BUTTON_B ) quit = 1;
		if ( menu < 0 )
			menu = vecount - 1;

		if ( menu == vecount )
			menu = 0;

		scroller(SCROLLY, &vestext[0], 2);	
        VIDEO_WaitVSync();

	}