From 6050b47c67f495f1d6aa46c9f95a2b64977ddc5b Mon Sep 17 00:00:00 2001 From: The Dax Date: Fri, 13 Dec 2013 13:06:44 -0500 Subject: [PATCH] Add an ini option to set the emulated PSP's firmware. --- Core/Config.cpp | 2 ++ Core/Config.h | 2 ++ Core/HLE/sceKernel.cpp | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index cb24c98c91..9965f35a3e 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -327,6 +327,7 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) { IniFile::Section *pspConfig = iniFile.GetOrCreateSection("SystemParam"); pspConfig->Get("PSPModel", &iPSPModel, PSP_MODEL_SLIM); + pspConfig->Get("PSPFirmwareVersion", &iFirmwareVersion, PSP_DEFAULT_FIRMWARE); #if !defined(_M_X64) && !defined(_WIN32) && !defined(__SYMBIAN32__) // 32-bit mmap cannot map more than 32MB contiguous iPSPModel = PSP_MODEL_FAT; @@ -569,6 +570,7 @@ void Config::Save() { IniFile::Section *pspConfig = iniFile.GetOrCreateSection("SystemParam"); pspConfig->Set("PSPModel", iPSPModel); + pspConfig->Set("PSPFirmwareVersion", iFirmwareVersion); 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 f585cfdb99..63bf3d088c 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -29,6 +29,7 @@ extern const char *PPSSPP_GIT_VERSION; const int MAX_CONFIG_VOLUME = 8; const int PSP_MODEL_FAT = 0; const int PSP_MODEL_SLIM = 1; +const int PSP_DEFAULT_FIRMWARE = 150; namespace http { class Download; @@ -239,6 +240,7 @@ public: bool bWlanPowerSave; int iPSPModel; + int iFirmwareVersion; // TODO: Make this work with your platform, too! #if defined(_WIN32) && !defined(USING_QT_UI) bool bBypassOSKWithKeyboard; diff --git a/Core/HLE/sceKernel.cpp b/Core/HLE/sceKernel.cpp index 8f8a49f119..3ee15ed888 100644 --- a/Core/HLE/sceKernel.cpp +++ b/Core/HLE/sceKernel.cpp @@ -287,7 +287,7 @@ void sceKernelExitGameWithStatus() u32 sceKernelDevkitVersion() { - int firmwareVersion = 150; + int firmwareVersion = g_Config.iFirmwareVersion; int major = firmwareVersion / 100; int minor = (firmwareVersion / 10) % 10; int revision = firmwareVersion % 10;