From 5d310e60145e204a48f155ae8a32cb396f62e465 Mon Sep 17 00:00:00 2001 From: The Dax Date: Thu, 28 Nov 2013 12:35:15 -0500 Subject: [PATCH] Add an option to allow the emulated PSP model to be changed. Some games require a PSP-2000 for features such as multiplayer. --- Core/Config.cpp | 3 +++ Core/Config.h | 1 + Core/HLE/scePower.cpp | 6 ++++-- UI/GameSettingsScreen.cpp | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index 2cf4ece238..86c379d378 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -294,6 +294,8 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) { } IniFile::Section *pspConfig = iniFile.GetOrCreateSection("SystemParam"); + // 0 = PSP Fat, 1 = PSP Slim + pspConfig->Get("PSPModel", &iPSPModel, 0); pspConfig->Get("NickName", &sNickName, "PPSSPP"); pspConfig->Get("proAdhocServer", &proAdhocServer, "localhost"); pspConfig->Get("MacAddress", &localMacAddress, "01:02:03:04:05:06"); @@ -520,6 +522,7 @@ void Config::Save() { IniFile::Section *pspConfig = iniFile.GetOrCreateSection("SystemParam"); + pspConfig->Set("PSPModel", iPSPModel); pspConfig->Set("NickName", sNickName.c_str()); pspConfig->Set("proAdhocServer", proAdhocServer.c_str()); pspConfig->Set("MacAddress", localMacAddress.c_str()); diff --git a/Core/Config.h b/Core/Config.h index c2803bd71b..978fca81c6 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -213,6 +213,7 @@ public: bool bEncryptSave; int iWlanAdhocChannel; bool bWlanPowerSave; + int iPSPModel; // TODO: Make this work with your platform, too! #ifdef _WIN32 bool bBypassOSKWithKeyboard; diff --git a/Core/HLE/scePower.cpp b/Core/HLE/scePower.cpp index 8130ec6d57..32760e5299 100644 --- a/Core/HLE/scePower.cpp +++ b/Core/HLE/scePower.cpp @@ -55,7 +55,7 @@ static bool volatileMemLocked; static int powerCbSlots[numberOfCBPowerSlots]; static std::vector volatileWaitingThreads; -// this should belong here on in CoreTiming? +// Should this belong here, or in CoreTiming? static int pllFreq = 222; static int busFreq = 111; @@ -412,7 +412,9 @@ int scePowerTick() { u32 IsPSPNonFat() { - return PSP_MODEL_FAT; + DEBUG_LOG(HLE, "%d=scePower_a85880d0_IsPSPNonFat()", g_Config.iPSPModel); + + return g_Config.iPSPModel; } static const HLEFunction scePower[] = { diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 9d57987d0e..1520b7b56b 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -295,6 +295,9 @@ void GameSettingsScreen::CreateViews() { systemSettings->Add(new PopupMultiChoice(&g_Config.iTimeFormat, s->T("Time Format"), timeFormat, 1, 2, s, screenManager())); static const char *buttonPref[] = { "Use O to confirm", "Use X to confirm" }; systemSettings->Add(new PopupMultiChoice(&g_Config.iButtonPreference, s->T("Confirmation Button"), buttonPref, 0, 2, s, screenManager())); + static const char *pspModels[] = { "PSP-1000 (Fat)", "PSP-2000 (Slim)" }; + systemSettings->Add(new PopupMultiChoice(&g_Config.iPSPModel, s->T("PSP Model"), pspModels, 0, 2, s, screenManager())); + } UI::EventReturn GameSettingsScreen::OnRenderingMode(UI::EventParams &e) {