Ejemplo n.º 1
0
static int gui_swap_cd(void)
{
	//Is a multi-cd image loaded? (EBOOT .pbp files support this)
	bool using_multicd = cdrIsoMultidiskCount > 1;

	if (using_multicd) {
		// Pass true to gui_select_multicd() so it knows CD is being swapped
		if (!gui_select_multicd(true)) {
			// User cancelled, return to menu
			return 0;
		} else {
			printf("CD swap selected image %d of %d in multi-CD\n", cdrIsoMultidiskSelect+1, cdrIsoMultidiskCount);
		}
	} else {
		static char isoname[PATH_MAX];
		const char *name = FileReq(Config.LastDir, NULL, isoname);
		if (name == NULL)
			return 0;

		SetIsoFile(name);
		printf("CD swap selected file: %s\n", name);
	}

	CdromId[0] = '\0';
	CdromLabel[0] = '\0';

	//Unregister multi-CD callback so handlepbp() or other cdriso
	// plugins don't ask for CD to boot from
	cdrIsoMultidiskCallback = NULL;

	if (ReloadCdromPlugin() < 0) {
		printf("Failed to re-initialize cdr\n");
		return 0;
	}

	if (CDR_open() < 0) {
		printf("Failed to open cdr\n");
		return 0;
	}

	SetCdOpenCaseTime(time(NULL) + 2);
	LidInterrupt();
	return 1;
}
Ejemplo n.º 2
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;
	}
}