예제 #1
0
upse_psf_t *upse_load(char *path, upse_iofuncs_t * iofuncs)
{
    upse_psf_t *ret;

    _ENTER;

    psxInit();
    psxReset();

    SPUinit();
    SPUopen();

    if (!(ret = _upse_load(path, 0, 0, iofuncs)))
    {
	psxShutdown();

	return NULL;
    }

    if (ret->stop == (u32) ~ 0)
	ret->fade = 0;

    SPUsetlength(ret->stop, ret->fade);
    ret->length = ret->stop + ret->fade;

    _LEAVE;
    return ret;
}
예제 #2
0
int emuLoadRom( QString * romFile ){
    if( romFile->isEmpty()) return 0;
    SetIsoFile(romFile->toLatin1().data());
    if (psxInit() == -1) {
        printf("PSX emulator couldn't be initialized.\n");
        emuClose();
        return 0;
    }
    if (LoadPlugins() == -1) {
        printf("Failed loading plugins.\n");
        emuClose();
        return 0;
    }
    psxReset();
    return 1;
}
예제 #3
0
파일: Misc.c 프로젝트: mistydemeo/modizer
PSFINFO *sexy_load(char *path,const char *pathDir,int loop_infinite)
{
	PSFINFO *ret;

        if( psxInit() < 0 ) return(0);
        psxReset();

        sexySPUinit();
        sexySPUopen();

	if(!(ret=LoadPSF(path,0,0,pathDir)))
	{
	 psxShutdown();
	 return(0);
	}
	strcpy(save_path,path);
	strcpy(save_pathDir,pathDir);	

	// Taken from aosdk's eng_psf.c file ...
	// patch illegal Chocobo Dungeon 2 code - CaitSith2 put a jump in the delay slot from a BNE
	// and rely on Highly Experimental's buggy-ass CPU to rescue them.  Verified on real hardware
	// that the initial code is wrong.
	if (ret->game) {
		if (!strcmp(ret->game, "Chocobo Dungeon 2")) {
			if (psxMu32(0xbc090) == (0x0802f040))
			{
			 psxMemWrite32(0xbc090, 0);
			 psxMemWrite32(0xbc094, 0x0802f040);
			 psxMemWrite32(0xbc098, 0);
			}
		}
	}
	
	if(ret->stop==~0) {
		ret->fade=10000; // Infinity ? limit to 3 minutes
		ret->stop=170000;
	}
    
    if (loop_infinite) {
		ret->stop=~0;
	}

	sexysetlength(ret->stop,ret->fade);
	ret->length=ret->stop+ret->fade;

	return(ret);
}
예제 #4
0
PSFINFO *sexy_load(char *path) 
{
	PSFINFO *ret;

        psxInit();
        psxReset();

        SPUinit();
        SPUopen();

	if(!(ret=LoadPSF(path,0,0)))
	{
	 psxShutdown();
	 return(0);
	}

	if(ret->stop==~0) ret->fade=0; // Infinity+anything is still infinity...or is it?
	SPUsetlength(ret->stop,ret->fade);
	ret->length=ret->stop+ret->fade;

        return(ret);
}
예제 #5
0
파일: Misc.c 프로젝트: mistydemeo/modizer
PSFINFO *sexy_memload(char *addr, int size)
{
	PSFINFO *ret;

        psxInit();
        psxReset();

        sexySPUinit();
        sexySPUopen();

	if(!(ret=memLoadPSF(addr,size,0,0)))
	{
	 psxShutdown();
	 return(0);
	}

	// Taken from aosdk's eng_psf.c file ...
	// patch illegal Chocobo Dungeon 2 code - CaitSith2 put a jump in the delay slot from a BNE
	// and rely on Highly Experimental's buggy-ass CPU to rescue them.  Verified on real hardware
	// that the initial code is wrong.
	if (ret->game) {
		if (!strcmp(ret->game, "Chocobo Dungeon 2")) {
			if (psxMu32(0xbc090) == (0x0802f040))
			{
			 psxMemWrite32(0xbc090, 0);
			 psxMemWrite32(0xbc094, 0x0802f040);
			 psxMemWrite32(0xbc098, 0);
			}
		}
	}
    
	if(ret->stop==~0) ret->fade=0; // Infinity+anything is still infinity...or is it?
	setlength(ret->stop,ret->fade);
	ret->length=ret->stop+ret->fade;

        return(ret);
}
예제 #6
0
파일: plugin.c 프로젝트: lab313ru/psxida
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;
	}
}
예제 #7
0
파일: main.cpp 프로젝트: flpstr/Psx4all
void SysReset() {
	psxReset();
}
예제 #8
0
int emuReset(){
    psxReset();
}
예제 #9
0
void EmuReset() {
    FreeCheatSearchResults();
    FreeCheatSearchMem();

    psxReset();
}