예제 #1
0
void CPU_Init() {
	coreState = CORE_POWERUP;
	currentCPU = &mipsr4k;
	numCPUs = 1;

	// Default memory settings
	// Seems to be the safest place currently..
	if (g_Config.iPSPModel == PSP_MODEL_FAT)
		Memory::g_MemorySize = Memory::RAM_NORMAL_SIZE; // 32 MB of ram by default
	else
		Memory::g_MemorySize = Memory::RAM_DOUBLE_SIZE;

	g_RemasterMode = false;
	g_DoubleTextureCoordinates = false;
	Memory::g_PSPModel = g_Config.iPSPModel;

	std::string filename = coreParameter.fileToStart;
	IdentifiedFileType type = Identify_File(filename);

	switch (type) {
	case FILETYPE_PSP_ISO:
	case FILETYPE_PSP_ISO_NP:
	case FILETYPE_PSP_DISC_DIRECTORY:
		InitMemoryForGameISO(filename);
		break;
	default:
		break;
	}

	Memory::Init();
	mipsr4k.Reset();

	host->AttemptLoadSymbolMap();

	if (coreParameter.enableSound) {
		Audio_Init();
	}

	CoreTiming::Init();

	// Init all the HLE modules
	HLEInit();

	// TODO: Check Game INI here for settings, patches and cheats, and modify coreParameter accordingly

	// Why did we check for CORE_POWERDOWN here?
	if (!LoadFile(filename, &coreParameter.errorString)) {
		CPU_Shutdown();
		coreParameter.fileToStart = "";
		CPU_SetState(CPU_THREAD_NOT_RUNNING);
		return;
	}


	if (coreParameter.updateRecent) {
		g_Config.AddRecent(filename);
	}

	coreState = coreParameter.startPaused ? CORE_STEPPING : CORE_RUNNING;
}
예제 #2
0
void CPU_Init() {
	currentCPU = &mipsr4k;
	numCPUs = 1;

	// Default memory settings
	// Seems to be the safest place currently..
	Memory::g_MemorySize = 0x2000000; // 32 MB of ram by default
	g_RemasterMode = false;
	g_DoubleTextureCoordinates = false;

	std::string filename = coreParameter.fileToStart;
	IdentifiedFileType type = Identify_File(filename);

	switch (type) {
	case FILETYPE_PSP_ISO:
	case FILETYPE_PSP_ISO_NP:
	case FILETYPE_PSP_DISC_DIRECTORY:
		InitMemoryForGameISO(filename);
		break;
	default:
		break;
	}

	Memory::Init();
	mipsr4k.Reset();
	mipsr4k.pc = 0;

	host->AttemptLoadSymbolMap();

	if (coreParameter.enableSound) {
		mixer = new PSPMixer();
		host->InitSound(mixer);
	}

	if (coreParameter.disableG3Dlog) {
		LogManager::GetInstance()->SetEnable(LogTypes::G3D, false);
	}

	CoreTiming::Init();

	// Init all the HLE modules
	HLEInit();

	// TODO: Check Game INI here for settings, patches and cheats, and modify coreParameter accordingly

	// Why did we check for CORE_POWERDOWN here?
	if (!LoadFile(filename, &coreParameter.errorString)) {
		CPU_Shutdown();
		coreParameter.fileToStart = "";
		CPU_SetState(CPU_THREAD_NOT_RUNNING);
		return;
	}

	if (coreParameter.updateRecent) {
		g_Config.AddRecent(filename);
	}

	coreState = coreParameter.startPaused ? CORE_STEPPING : CORE_RUNNING;
}
예제 #3
0
파일: System.cpp 프로젝트: chaserhkj/ppsspp
bool PSP_Init(const CoreParameter &coreParam, std::string *error_string)
{
	INFO_LOG(HLE, "PPSSPP %s", PPSSPP_GIT_VERSION);

	coreParameter = coreParam;
	currentCPU = &mipsr4k;
	numCPUs = 1;
	Memory::Init();
	mipsr4k.Reset();
	mipsr4k.pc = 0;

	host->AttemptLoadSymbolMap();

	if (coreParameter.enableSound)
	{
		mixer = new PSPMixer();
		host->InitSound(mixer);
	}

	if (coreParameter.disableG3Dlog)
	{
		LogManager::GetInstance()->SetEnable(LogTypes::G3D, false);
	}

	CoreTiming::Init();

	// Init all the HLE modules
	HLEInit();

	// TODO: Check Game INI here for settings, patches and cheats, and modify coreParameter accordingly

	std::string filename = coreParameter.fileToStart;
	if (!LoadFile(filename, error_string)) {
		pspFileSystem.Shutdown();
		CoreTiming::Shutdown();
		__KernelShutdown();
		HLEShutdown();
		host->ShutdownSound();
		Memory::Shutdown();
		coreParameter.fileToStart = "";
		return false;
	}

	if (coreParam.updateRecent)
		g_Config.AddRecent(filename);

	// Setup JIT here.
	if (coreParameter.startPaused)
		coreState = CORE_STEPPING;
	else
		coreState = CORE_RUNNING;
	return true;
}
예제 #4
0
파일: System.cpp 프로젝트: HomerSp/ppsspp
bool PSP_Init(const CoreParameter &coreParam, std::string *error_string)
{
	coreParameter = coreParam;
	currentCPU = &mipsr4k;
	numCPUs = 1;
	Memory::Init();
	mipsr4k.Reset();
	mipsr4k.pc = 0;

	if (coreParameter.enableSound)
	{
		mixer = new PSPMixer();
		host->InitSound(mixer);
	}

	if (coreParameter.disableG3Dlog)
	{
		LogManager::GetInstance()->SetEnable(LogTypes::G3D, false);
	}

	CoreTiming::Init();

	// Init all the HLE modules
	HLEInit();

	// TODO: Check Game INI here for settings, patches and cheats, and modify coreParameter accordingly

	if (!LoadFile(coreParameter.fileToStart.c_str(), error_string))
	{
		pspFileSystem.Shutdown();
		CoreTiming::Shutdown();
		__KernelShutdown();
		HLEShutdown();
		host->ShutdownSound();
		Memory::Shutdown();
		coreParameter.fileToStart = "";
		return false;
	}

	// Setup JIT here.
	if (coreParameter.startPaused)
		coreState = CORE_STEPPING;
	else
		coreState = CORE_RUNNING;
	return true;
}
예제 #5
0
파일: System.cpp 프로젝트: Myoko/ppsspp
bool PSP_Init(const CoreParameter &coreParam, std::string *error_string)
{
	coreParameter = coreParam;
	currentCPU = &mipsr4k;
	numCPUs = 1;
	Memory::Init();
	mipsr4k.Reset();
	mipsr4k.pc = 0;

	if (coreParameter.enableSound)
	{
		host->InitSound(new PSPMixer());
	}

	// Init all the HLE modules
	HLEInit();

	// TODO: Check Game INI here for settings, patches and cheats, and modify coreParameter accordingly

	if (!LoadFile(coreParameter.fileToStart.c_str(), error_string))
	{
		pspFileSystem.UnmountAll();
		CoreTiming::ClearPendingEvents();
		CoreTiming::UnregisterAllEvents();
		__KernelShutdown();
		HLEShutdown();
		host->ShutdownSound();
		Memory::Shutdown();
		coreParameter.fileToStart = "";
		return false;
	}

	shaderManager.DirtyShader();
	shaderManager.DirtyUniform(DIRTY_ALL);

	// Setup JIT here.
	if (coreParameter.startPaused)
		coreState = CORE_STEPPING;
	else
		coreState = CORE_RUNNING;
	return true;
}
예제 #6
0
파일: System.cpp 프로젝트: Alceris/ppsspp
void CPU_Init() {
	coreState = CORE_POWERUP;
	currentMIPS = &mipsr4k;
	
	g_symbolMap = new SymbolMap();

	// Default memory settings
	// Seems to be the safest place currently..
	Memory::g_MemorySize = Memory::RAM_NORMAL_SIZE; // 32 MB of ram by default

	g_RemasterMode = false;
	g_DoubleTextureCoordinates = false;
	Memory::g_PSPModel = g_Config.iPSPModel;

	std::string filename = coreParameter.fileToStart;
	loadedFile = ResolveFileLoaderTarget(ConstructFileLoader(filename));
#ifdef _M_X64
	if (g_Config.bCacheFullIsoInRam) {
		loadedFile = new RamCachingFileLoader(loadedFile);
	}
#endif
	IdentifiedFileType type = Identify_File(loadedFile);

	// TODO: Put this somewhere better?
	if (coreParameter.mountIso != "") {
		coreParameter.mountIsoLoader = ConstructFileLoader(coreParameter.mountIso);
	}

	MIPSAnalyst::Reset();
	Replacement_Init();

	switch (type) {
	case FILETYPE_PSP_ISO:
	case FILETYPE_PSP_ISO_NP:
	case FILETYPE_PSP_DISC_DIRECTORY:
		InitMemoryForGameISO(loadedFile);
		break;
	case FILETYPE_PSP_PBP:
		InitMemoryForGamePBP(loadedFile);
		break;
	case FILETYPE_PSP_PBP_DIRECTORY:
		// This is normal for homebrew.
		// ERROR_LOG(LOADER, "PBP directory resolution failed.");
		break;
	default:
		break;
	}

	// Here we have read the PARAM.SFO, let's see if we need any compatibility overrides.
	// Homebrew usually has an empty discID, and even if they do have a disc id, it's not
	// likely to collide with any commercial ones.
	std::string discID = g_paramSFO.GetValueString("DISC_ID");
	if (!discID.empty()) {
		coreParameter.compat.Load(discID);
	}

	Memory::Init();
	mipsr4k.Reset();

	host->AttemptLoadSymbolMap();

	if (coreParameter.enableSound) {
		Audio_Init();
	}

	CoreTiming::Init();

	// Init all the HLE modules
	HLEInit();

	// TODO: Check Game INI here for settings, patches and cheats, and modify coreParameter accordingly

	// Why did we check for CORE_POWERDOWN here?
	if (!LoadFile(&loadedFile, &coreParameter.errorString)) {
		CPU_Shutdown();
		coreParameter.fileToStart = "";
		CPU_SetState(CPU_THREAD_NOT_RUNNING);
		return;
	}


	if (coreParameter.updateRecent) {
		g_Config.AddRecent(filename);
	}

	coreState = coreParameter.startPaused ? CORE_STEPPING : CORE_RUNNING;
}
예제 #7
0
파일: System.cpp 프로젝트: Ekaseo/ppsspp
bool PSP_Init(const CoreParameter &coreParam, std::string *error_string)
{
	INFO_LOG(HLE, "PPSSPP %s", PPSSPP_GIT_VERSION);

	coreParameter = coreParam;
	currentCPU = &mipsr4k;
	numCPUs = 1;

	// Default memory settings
	// Seems to be the safest place currently..
	Memory::g_MemorySize = 0x2000000; // 32 MB of ram by default
	g_RemasterMode = false;
	g_DoubleTextureCoordinates = false;

	std::string filename = coreParam.fileToStart;
	EmuFileType type = Identify_File(filename);

	if(type == FILETYPE_PSP_ISO || type == FILETYPE_PSP_ISO_NP || type == FILETYPE_PSP_DISC_DIRECTORY)
		InitMemoryForGameISO(filename);

	Memory::Init();
	mipsr4k.Reset();
	mipsr4k.pc = 0;

	host->AttemptLoadSymbolMap();

	if (coreParameter.enableSound)
	{
		mixer = new PSPMixer();
		host->InitSound(mixer);
	}

	if (coreParameter.disableG3Dlog)
	{
		LogManager::GetInstance()->SetEnable(LogTypes::G3D, false);
	}

	CoreTiming::Init();

	// Init all the HLE modules
	HLEInit();

	// TODO: Check Game INI here for settings, patches and cheats, and modify coreParameter accordingly

	// Why did we check for CORE_POWERDOWN here?
	if (!LoadFile(filename, error_string)) { // || coreState == CORE_POWERDOWN) {
		pspFileSystem.Shutdown();
		CoreTiming::Shutdown();
		__KernelShutdown();
		HLEShutdown();
		host->ShutdownSound();
		Memory::Shutdown();
		coreParameter.fileToStart = "";
		return false;
	}

	if (coreParam.updateRecent)
		g_Config.AddRecent(filename);

	// Setup JIT here.
	if (coreParameter.startPaused)
		coreState = CORE_STEPPING;
	else
		coreState = CORE_RUNNING;
	return true;
}