Exemplo n.º 1
0
void PADhandleKey(int key) {
	char Text[255];
	int ret;

	if (Running == 0) return;
	switch (key) {
		case 0: break;
		case VK_F1:
			GetStateFilename(Text, StatesC);
			GPU_freeze(2, (GPUFreeze_t *)&StatesC);
			ret = SaveState(Text);
			if (ret == 0)
				 sprintf(Text, _("*PCSXR*: Saved State %d"), StatesC+1);
			else sprintf(Text, _("*PCSXR*: Error Saving State %d"), StatesC+1);
			GPU_displayText(Text);
			if (ShowPic) { ShowPic = 0; gpuShowPic(); }
			break;

		case VK_F2:
			if (StatesC < 8) StatesC++;
			else StatesC = 0;
			GPU_freeze(2, (GPUFreeze_t *)&StatesC);
			if (ShowPic) { ShowPic = 0; gpuShowPic(); }
			break;

		case VK_F3:
			GetStateFilename(Text, StatesC);
			ret = LoadState(Text);
			if (ret == 0)
				 sprintf(Text, _("*PCSXR*: Loaded State %d"), StatesC+1);
			else sprintf(Text, _("*PCSXR*: Error Loading State %d"), StatesC+1);
			GPU_displayText(Text);
			break;

		case VK_F4:
			gpuShowPic();
			break;

		case VK_F5:
			Config.SioIrq ^= 0x1;
			if (Config.SioIrq)
				 sprintf(Text, _("*PCSXR*: Sio Irq Always Enabled"));
			else sprintf(Text, _("*PCSXR*: Sio Irq Not Always Enabled"));
			GPU_displayText(Text);
			break;

		case VK_F6:
			Config.Mdec ^= 0x1;
			if (Config.Mdec)
				 sprintf(Text, _("*PCSXR*: Black&White Mdecs Only Enabled"));
			else sprintf(Text, _("*PCSXR*: Black&White Mdecs Only Disabled"));
			GPU_displayText(Text);
			break;

		case VK_F7:
			Config.Xa ^= 0x1;
			if (Config.Xa == 0)
				 sprintf (Text, _("*PCSXR*: Xa Enabled"));
			else sprintf (Text, _("*PCSXR*: Xa Disabled"));
			GPU_displayText(Text);
			break;

		case VK_F8:
			GPU_makeSnapshot();
			return;

		case VK_F9:
			GPU_displayText(_("*PCSXR*: CdRom Case Opened"));
			SetCdOpenCaseTime(-1);
			LidInterrupt();
			break;

		case VK_F10:
			GPU_displayText(_("*PCSXR*: CdRom Case Closed"));
			SetCdOpenCaseTime(0);
			LidInterrupt();
			break;

		case VK_F12:
			SysPrintf("*PCSXR*: CpuReset\n");
			psxReset();
			break;

		case VK_ESCAPE:
			ShowCursor(TRUE); // we want GUI to have cursor always
			Running = 0;
			ClosePlugins();
			SysRunGui();
			break;
	}
}
Exemplo n.º 2
0
void PADhandleKey(int key) {
	char Text[255];
	int ret;

	if (Running == 0) return;
	switch (key) {
		case 0: break;
		case VK_F1:
			sprintf(Text, "sstates\\%10.10s.%3.3d", CdromLabel, StatesC);
			GPU_freeze(2, (GPUFreeze_t *)&StatesC);
			ret = SaveState(Text);
			if (ret == 0)
				 sprintf(Text, _("*PCSX*: Saved State %d"), StatesC+1);
			else sprintf(Text, _("*PCSX*: Error Saving State %d"), StatesC+1);
			//GPU_displayText(Text);
			if (ShowPic) { ShowPic = 0; gpuShowPic(); }

			AgemoTrace("Status saved %d", StatesC+1);
			break;

		case VK_F2:
			if (StatesC < 4) StatesC++;
			else StatesC = 0;
			GPU_freeze(2, (GPUFreeze_t *)&StatesC);
			if (ShowPic) { ShowPic = 0; gpuShowPic(); }
			AgemoTrace("save slot selected %d", StatesC+1);
			break;

		case VK_F3:
			sprintf (Text, "sstates\\%10.10s.%3.3d", CdromLabel, StatesC);
			ret = LoadState(Text);
			if (ret == 0)
				 sprintf(Text, _("*PCSX*: Loaded State %d"), StatesC+1);
			else sprintf(Text, _("*PCSX*: Error Loading State %d"), StatesC+1);
			//GPU_displayText(Text);

			AgemoTrace("Status loaded %d, set total ops = 0", StatesC+1);
			break;

		case VK_F4:
			gpuShowPic();
			break;

		case VK_F5:
			if (Config.QKeys) break;
			Config.Sio ^= 0x1;
			if (Config.Sio)
				 sprintf(Text, _("*PCSX*: Sio Irq Always Enabled"));
			else sprintf(Text, _("*PCSX*: Sio Irq Not Always Enabled"));
			GPU_displayText(Text);
			break;

		case VK_F6:
			if (Config.QKeys) break;
			Config.Mdec ^= 0x1;
			if (Config.Mdec)
				 sprintf(Text, _("*PCSX*: Black&White Mdecs Only Enabled"));
			else sprintf(Text, _("*PCSX*: Black&White Mdecs Only Disabled"));
			GPU_displayText(Text);
			break;

		case VK_F7:
			if (Config.QKeys) break;
			Config.Xa ^= 0x1;
			if (Config.Xa == 0)
				 sprintf (Text, _("*PCSX*: Xa Enabled"));
			else sprintf (Text, _("*PCSX*: Xa Disabled"));
			GPU_displayText(Text);
			break;

		case VK_F8:
			if (Config.QKeys) break;
			GPU_makeSnapshot();
			return;

		case VK_F9:
			GPU_displayText(_("*PCSX*: CdRom Case Opened"));
			cdOpenCase = 1;
			break;

		case VK_F10:
			GPU_displayText(_("*PCSX*: CdRom Case Closed"));
			cdOpenCase = 0;
			break;

		case VK_F12:
			SysPrintf("*PCSX*: CpuReset\n");
			psxCpu->Reset();
			break;

		case VK_ESCAPE:
			Running = 0;
			ClosePlugins();
			SysRunGui();
			break;
	}
}