예제 #1
0
파일: patchscene.cpp 프로젝트: 87maxi/oom
void PatchScene::keyPressEvent(QKeyEvent* event)
{
    if (event->key() == Qt::Key_Control)
        ctrl_down = true;

    if (event->key() == Qt::Key_Home)
    {
        zoom_fit();
        event->accept();
    }

    else if (ctrl_down)
    {
        if (event->key() == Qt::Key_Plus)
        {
            zoom_in();
            event->accept();
        }
        else if (event->key() == Qt::Key_Minus)
        {
            zoom_out();
            event->accept();
        }
        else if (event->key() == Qt::Key_1)
        {
            zoom_reset();
            event->accept();
        }
        else
            QGraphicsScene::keyPressEvent(event);
    }
    else
        QGraphicsScene::keyPressEvent(event);
}
예제 #2
0
void zoom_key_released(zoom_t *zc, int *flag_zoom_key, int source)	// source 1 is when the button is released, source 2 is while the button is being held down
{
	int td;
	int zko = *flag_zoom_key;						// save the original zoom_key state

	td = get_time_ms() - zc->zoom_key_time;					// time difference

	if (source==1 && *flag_zoom_key==0 && zc->zoom_key_time)		// if the button was just released as the zoom was off and the timer running
		zoom_toggle(zc, flag_zoom_key);					// turn the zoom on
	else if (source==1 && *flag_zoom_key && zc->zoom_key_time && td <= 500)	// if the button has been pressed for less than 0.5s and released
		zoom_toggle(zc, flag_zoom_key);					// turn off the zoom mode, don't reset the view

	if (source==2 && zc->zoom_key_time && td > 500)				// if the button is held down and for more than 0.5s and the button timer is running
		zoom_reset(zc, flag_zoom_key);					// reset everything
}
예제 #3
0
int
LoadManager ()
{
	int loadROM = OpenROM(GCSettings.LoadMethod);

	/***
	* check for autoloadsram / freeze
	***/
	if ( loadROM == 1 ) // if ROM was loaded, load the SRAM & settings
	{
		if ( GCSettings.AutoLoad == 1 )
			LoadSRAM(GCSettings.SaveMethod, SILENT);
		else if ( GCSettings.AutoLoad == 2 )
			NGCUnfreezeGame (GCSettings.SaveMethod, SILENT);

		// setup cheats
		SetupCheats();

		// reset zoom
		zoom_reset ();
	}

	return loadROM;
}
예제 #4
0
static void view_unzoom_cb(puObject *obj)
{
  zoom_reset();
}
예제 #5
0
int
GameMenu ()
{
	int gamemenuCount = 10;
	char gamemenu[][50] = {
	  "Return to Game",
	  "Reset Game",
	  "ROM Information",
	  "Cheats",
	  "Load SRAM", "Save SRAM",
	  "Load Game Snapshot", "Save Game Snapshot",
	  "Reset Zoom",
	  "Back to Main Menu"
	};

	int ret, retval = 0;
	int quit = 0;
	int oldmenu = menu;
	menu = 0;

	while (quit == 0)
	{
		// disable SRAM/SNAPSHOT saving/loading if AUTO is on

		if (GCSettings.AutoLoad == 1) // Auto Load SRAM
			gamemenu[4][0] = '\0';
		else if (GCSettings.AutoLoad == 2) // Auto Load SNAPSHOT
			gamemenu[6][0] = '\0';

		if (GCSettings.AutoSave == 1) // Auto Save SRAM
			gamemenu[5][0] = '\0';
		else if (GCSettings.AutoSave == 2) // Auto Save SNAPSHOT
			gamemenu[7][0] = '\0';
		else if (GCSettings.AutoSave == 3) // Auto Save BOTH
		{
			gamemenu[5][0] = '\0';
			gamemenu[7][0] = '\0';
		}

		// hide cheats menu if cheats file not present
		if(Cheat.num_cheats == 0)
			gamemenu[3][0] = '\0';

		ret = RunMenu (gamemenu, gamemenuCount, (char*)"Game Menu");

		switch (ret)
		{
			case 0: // Return to Game
				quit = retval = 1;
				break;

			case 1: // Reset Game
				zoom_reset ();
				S9xSoftReset ();
				quit = retval = 1;
				break;

			case 2: // ROM Information
				RomInfo();
				WaitButtonA ();
				break;

			case 3: // load cheats
				CheatMenu();
				break;

			case 4: // Load SRAM
				zoom_reset ();
				quit = retval = LoadSRAM(GCSettings.SaveMethod, NOTSILENT);
				break;

			case 5: // Save SRAM
				SaveSRAM(GCSettings.SaveMethod, NOTSILENT);
				break;

			case 6: // Load Freeze
				zoom_reset ();
				quit = retval = NGCUnfreezeGame (GCSettings.SaveMethod, NOTSILENT);
				break;

			case 7: // Save Freeze
				NGCFreezeGame (GCSettings.SaveMethod, NOTSILENT);
				break;

			case 8:	// Reset Zoom
				zoom_reset ();
				quit = retval = 1;
				break;

			case -1: // Button B
			case 9: // Return to previous menu
				retval = 0;
				quit = 1;
				break;
		}
	}

	menu = oldmenu;

	return retval;
}
예제 #6
0
파일: menu.cpp 프로젝트: feraligatr/vbagx
void
PreferencesMenu ()
{
	int ret = 0;
	int quit = 0;
	int oldmenu = menu;
	menu = 0;
	while (quit == 0)
	{
		// some load/save methods are not implemented - here's where we skip them
		// they need to be skipped in the order they were enumerated in vba.h

		// no USB ports on GameCube
		#ifdef HW_DOL
		if(GCSettings.LoadMethod == METHOD_USB)
			GCSettings.LoadMethod++;
		if(GCSettings.SaveMethod == METHOD_USB)
			GCSettings.SaveMethod++;
		#endif

		// saving to DVD is impossible
		if(GCSettings.SaveMethod == METHOD_DVD)
			GCSettings.SaveMethod++;

		// disable DVD in GC mode (not implemented)
		#ifdef HW_DOL
		if(GCSettings.LoadMethod == METHOD_DVD)
			GCSettings.LoadMethod++;
		#endif

		// disable SMB in GC mode (stalls out)
		#ifdef HW_DOL
		if(GCSettings.LoadMethod == METHOD_SMB)
			GCSettings.LoadMethod++;
		if(GCSettings.SaveMethod == METHOD_SMB)
			GCSettings.SaveMethod++;
		#endif

		// disable MC saving in Wii mode - does not work for some reason!
		#ifdef HW_RVL
		if(GCSettings.SaveMethod == METHOD_MC_SLOTA)
			GCSettings.SaveMethod++;
		if(GCSettings.SaveMethod == METHOD_MC_SLOTB)
			GCSettings.SaveMethod++;
		prefmenu[6][0] = 0;
		#else
		sprintf (prefmenu[6], "Verify MC Saves %s", GCSettings.VerifySaves == true ? " ON" : "OFF");
		#endif

		// correct load/save methods out of bounds
		if(GCSettings.LoadMethod > 4)
			GCSettings.LoadMethod = 0;
		if(GCSettings.SaveMethod > 6)
			GCSettings.SaveMethod = 0;

		if (GCSettings.LoadMethod == METHOD_AUTO) sprintf (prefmenu[0],"Load Method AUTO");
		else if (GCSettings.LoadMethod == METHOD_SD) sprintf (prefmenu[0],"Load Method SD");
		else if (GCSettings.LoadMethod == METHOD_USB) sprintf (prefmenu[0],"Load Method USB");
		else if (GCSettings.LoadMethod == METHOD_DVD) sprintf (prefmenu[0],"Load Method DVD");
		else if (GCSettings.LoadMethod == METHOD_SMB) sprintf (prefmenu[0],"Load Method Network");

		sprintf (prefmenu[1], "Load Folder %s",	GCSettings.LoadFolder);

		if (GCSettings.SaveMethod == METHOD_AUTO) sprintf (prefmenu[2],"Save Method AUTO");
		else if (GCSettings.SaveMethod == METHOD_SD) sprintf (prefmenu[2],"Save Method SD");
		else if (GCSettings.SaveMethod == METHOD_USB) sprintf (prefmenu[2],"Save Method USB");
		else if (GCSettings.SaveMethod == METHOD_SMB) sprintf (prefmenu[2],"Save Method Network");
		else if (GCSettings.SaveMethod == METHOD_MC_SLOTA) sprintf (prefmenu[2],"Save Method MC Slot A");
		else if (GCSettings.SaveMethod == METHOD_MC_SLOTB) sprintf (prefmenu[2],"Save Method MC Slot B");

		sprintf (prefmenu[3], "Save Folder %s",	GCSettings.SaveFolder);

		// disable changing load/save directories for now
		prefmenu[1][0] = '\0';
		prefmenu[3][0] = '\0';

		if (GCSettings.AutoLoad == 0) sprintf (prefmenu[4],"Auto Load OFF");
		else if (GCSettings.AutoLoad == 1) sprintf (prefmenu[4],"Auto Load SRAM");
		else if (GCSettings.AutoLoad == 2) sprintf (prefmenu[4],"Auto Load SNAPSHOT");

		if (GCSettings.AutoSave == 0) sprintf (prefmenu[5],"Auto Save OFF");
		else if (GCSettings.AutoSave == 1) sprintf (prefmenu[5],"Auto Save SRAM");
		else if (GCSettings.AutoSave == 2) sprintf (prefmenu[5],"Auto Save SNAPSHOT");
		else if (GCSettings.AutoSave == 3) sprintf (prefmenu[5],"Auto Save BOTH");

		sprintf (prefmenu[7], "Enable Zooming %s",
			GCSettings.Zoom == true ? " ON" : "OFF");

		// original mode not implemented
		if(GCSettings.render == 0)
			GCSettings.render++;

		if (GCSettings.render == 0)
			sprintf (prefmenu[8], "Video Rendering Original");
		if (GCSettings.render == 1)
			sprintf (prefmenu[8], "Video Rendering Filtered");
		if (GCSettings.render == 2)
			sprintf (prefmenu[8], "Video Rendering Unfiltered");

		sprintf (prefmenu[9], "Video Scaling %s",
			GCSettings.widescreen == true ? "16:9 Correction" : "Default");

		ret = RunMenu (prefmenu, prefmenuCount, (char*)"Preferences", 16);

		switch (ret)
		{
			case 0:
				GCSettings.LoadMethod ++;
				break;

			case 1:
				break;

			case 2:
				GCSettings.SaveMethod ++;
				break;

			case 3:
				break;

			case 4:
				GCSettings.AutoLoad ++;
				if (GCSettings.AutoLoad > 2)
					GCSettings.AutoLoad = 0;
				break;

			case 5:
				GCSettings.AutoSave ++;
				if (GCSettings.AutoSave > 3)
					GCSettings.AutoSave = 0;
				break;

			case 6:
				GCSettings.VerifySaves ^= 1;
				break;

			case 7:
				GCSettings.Zoom ^= 1;
				break;

			case 8:
				GCSettings.render++;
				if (GCSettings.render > 2)
					GCSettings.render = 0;
				// reset zoom
				zoom_reset ();
				break;

			case 9:
				GCSettings.widescreen ^= 1;
				break;

			case 10:
				DefaultSettings ();
				WaitPrompt((char *)"Preferences Reset");
				break;

			case 11:
			case -1: /*** Button B ***/
				SavePrefs(GCSettings.SaveMethod, SILENT);
				quit = 1;
				break;

		}
	}
	menu = oldmenu;
}
예제 #7
0
파일: menu.cpp 프로젝트: feraligatr/vbagx
int
GameMenu ()
{
	int gamemenuCount = 8;
	char gamemenu[][50] = {
	  "Return to Game",
	  "Reset Game",
	  "Load SRAM", "Save SRAM",
	  "Load Game Snapshot", "Save Game Snapshot",
	  "Reset Zoom",
	  "Back to Main Menu"
	};

	int ret, retval = 0;
	int quit = 0;
	int oldmenu = menu;
	menu = 0;

	while (quit == 0)
	{
		// disable SRAM/SNAPSHOT saving/loading if AUTO is on

		if (GCSettings.AutoLoad == 1) // Auto Load SRAM
			gamemenu[2][0] = '\0';
		else if (GCSettings.AutoLoad == 2) // Auto Load SNAPSHOT
			gamemenu[4][0] = '\0';

		if (GCSettings.AutoSave == 1) // Auto Save SRAM
			gamemenu[3][0] = '\0';
		else if (GCSettings.AutoSave == 2) // Auto Save SNAPSHOT
			gamemenu[5][0] = '\0';
		else if (GCSettings.AutoSave == 3) // Auto Save BOTH
		{
			gamemenu[3][0] = '\0';
			gamemenu[5][0] = '\0';
		}
		// disable Reset Zoom if Zooming is off
		if(!GCSettings.Zoom)
			gamemenu[6][0] = '\0';

		ret = RunMenu (gamemenu, gamemenuCount, (char*)"Game Menu");

		switch (ret)
		{
			case 0: // Return to Game
				quit = retval = 1;
				break;

			case 1: // Reset Game
				emulator.emuReset();
				quit = retval = 1;
				break;

			case 2: // Load Battery
				quit = retval = LoadBatteryOrState(GCSettings.SaveMethod, FILE_SRAM, NOTSILENT);
				emulator.emuReset();
				break;

			case 3: // Save Battery
				SaveBatteryOrState(GCSettings.SaveMethod, FILE_SRAM, NOTSILENT);
				break;

			case 4: // Load State
				quit = retval = LoadBatteryOrState(GCSettings.SaveMethod, FILE_SNAPSHOT, NOTSILENT);
				break;

			case 5: // Save State
				SaveBatteryOrState(GCSettings.SaveMethod, FILE_SNAPSHOT, NOTSILENT);
				break;

			case 6:	// Reset Zoom
				zoom_reset ();
				quit = retval = 1;
				break;

			case -1: // Button B
			case 7: // Return to previous menu
				retval = 0;
				quit = 1;
				break;
		}
	}

	menu = oldmenu;

	return retval;
}
예제 #8
0
void
VideoOptions ()
{
	int ret = 0;
	int quit = 0;
	int oldmenu = menu;
	menu = 0;
	while (quit == 0)
	{
		sprintf (videomenu[0], "Enable Zooming %s",
			GCSettings.Zoom == true ? " ON" : "OFF");

		// don't allow original render mode if progressive video mode detected
		if (GCSettings.render==0 && progressive)
			GCSettings.render++;

		if ( GCSettings.render == 0 )
			sprintf (videomenu[1], "Video Rendering Original");
		if ( GCSettings.render == 1 )
			sprintf (videomenu[1], "Video Rendering Filtered");
		if ( GCSettings.render == 2 )
			sprintf (videomenu[1], "Video Rendering Unfiltered");

		sprintf (videomenu[2], "Video Scaling %s",
			GCSettings.widescreen == true ? "16:9 Correction" : "Default");

		sprintf (videomenu[7], "Video Shift: %d, %d", GCSettings.xshift, GCSettings.yshift);

		ret = RunMenu (videomenu, videomenuCount, (char*)"Video Options");

		switch (ret)
		{
			case 0:
				GCSettings.Zoom ^= 1;
				break;

			case 1:
				GCSettings.render++;
				if (GCSettings.render > 2 )
					GCSettings.render = 0;
				// reset zoom
				zoom_reset ();
				break;

			case 2:
				GCSettings.widescreen ^= 1;
				break;

			case 3:
				// Move up
				GCSettings.yshift--;
				break;
			case 4:
				// Move down
				GCSettings.yshift++;
				break;
			case 5:
				// Move left
				GCSettings.xshift--;
				break;
			case 6:
				// Move right
				GCSettings.xshift++;
				break;

			case 7:
				break;

			case 8:
				// reset video shifts
				GCSettings.xshift = GCSettings.yshift = 0;
				WaitPrompt((char *)"Video Shift Reset");
				break;

			case -1: // Button B
			case 9:
				quit = 1;
				break;

		}
	}
	menu = oldmenu;
}