diff --git a/.gitignore b/.gitignore index d6d8e9a3b2..4fa78a5d40 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .gradle build build_android/build -build_android/src/main/assets/patches.xml +build_android/src/main/assets/GameConfig.xml build_android/local.properties build_android/proguard-project.txt build_android/.* diff --git a/Source/ee/PS2OS.cpp b/Source/ee/PS2OS.cpp index 7f293e8feb..748922d611 100644 --- a/Source/ee/PS2OS.cpp +++ b/Source/ee/PS2OS.cpp @@ -61,7 +61,6 @@ // game's lifetime doesn't seem to be used, so this bug probably doesn't have any side effect. #define SEMA_ID_BASE 0 -#define PATCHESFILENAME "patches.xml" #define GAMECONFIG_FILENAME "GameConfig.xml" #define LOG_NAME ("ps2os") @@ -437,7 +436,6 @@ void CPS2OS::LoadELF(Framework::CStream* stream, const char* executablePath, con }(); LoadExecutableInternal(); - ApplyPatches(); ApplyGameConfig(); OnExecutableChange(); @@ -571,70 +569,6 @@ uint32 CPS2OS::LoadExecutable(const char* path, const char* section) return result; } -void CPS2OS::ApplyPatches() -{ - std::unique_ptr document; - try - { -#ifdef __ANDROID__ - Framework::Android::CAssetStream patchesStream(PATCHESFILENAME); -#else - auto patchesPath = Framework::PathUtils::GetAppResourcesPath() / PATCHESFILENAME; - Framework::CStdStream patchesStream(Framework::CreateInputStdStream(patchesPath.native())); -#endif - document = Framework::Xml::CParser::ParseDocument(patchesStream); - if(!document) return; - } - catch(const std::exception& exception) - { - CLog::GetInstance().Print(LOG_NAME, "Failed to open patch definition file: %s.\r\n", exception.what()); - return; - } - - auto patchesNode = document->Select("Patches"); - if(patchesNode == NULL) - { - return; - } - - for(Framework::Xml::CFilteringNodeIterator itNode(patchesNode, "Executable"); !itNode.IsEnd(); itNode++) - { - auto executableNode = (*itNode); - - const char* name = executableNode->GetAttribute("Name"); - if(name == NULL) continue; - - if(!strcmp(name, GetExecutableName())) - { - //Found the right executable - unsigned int patchCount = 0; - - for(Framework::Xml::CFilteringNodeIterator itNode(executableNode, "Patch"); !itNode.IsEnd(); itNode++) - { - auto patch = (*itNode); - - const char* addressString = patch->GetAttribute("Address"); - const char* valueString = patch->GetAttribute("Value"); - - if(addressString == nullptr) continue; - if(valueString == nullptr) continue; - - uint32 value = 0, address = 0; - if(sscanf(addressString, "%x", &address) == 0) continue; - if(sscanf(valueString, "%x", &value) == 0) continue; - - *(uint32*)&m_ram[address] = value; - - patchCount++; - } - - CLog::GetInstance().Print(LOG_NAME, "Applied %i patch(es).\r\n", patchCount); - - break; - } - } -} - void CPS2OS::ApplyGameConfig() { std::unique_ptr document; diff --git a/Source/ee/PS2OS.h b/Source/ee/PS2OS.h index b30ac3be00..8dab342463 100644 --- a/Source/ee/PS2OS.h +++ b/Source/ee/PS2OS.h @@ -342,7 +342,6 @@ class CPS2OS : public CBiosDebugInfoProvider void LoadExecutableInternal(); void UnloadExecutable(); - void ApplyPatches(); void ApplyGameConfig(); void DisassembleSysCall(uint8); diff --git a/Source/ui_ios/CMakeLists.txt b/Source/ui_ios/CMakeLists.txt index 5059370b1e..6af3f8bce0 100644 --- a/Source/ui_ios/CMakeLists.txt +++ b/Source/ui_ios/CMakeLists.txt @@ -131,7 +131,7 @@ set(OSX_HEADERS ) set(OSX_RES - ${CMAKE_CURRENT_SOURCE_DIR}/../../patches.xml + ${CMAKE_CURRENT_SOURCE_DIR}/../../GameConfig.xml ${CMAKE_CURRENT_SOURCE_DIR}/Base.lproj/Main.storyboard ${CMAKE_CURRENT_SOURCE_DIR}/Resources/icon@2x.png ${CMAKE_CURRENT_SOURCE_DIR}/Resources/boxart.png diff --git a/Source/ui_qt/CMakeLists.txt b/Source/ui_qt/CMakeLists.txt index 731a6b8f24..6e3a1bf7b4 100644 --- a/Source/ui_qt/CMakeLists.txt +++ b/Source/ui_qt/CMakeLists.txt @@ -277,7 +277,7 @@ if(TARGET_PLATFORM_MACOS) FILE(GLOB ARCADE_DEFS ${CMAKE_CURRENT_SOURCE_DIR}/../../arcadedefs/*.arcadedef) set(OSX_RES ${CMAKE_CURRENT_SOURCE_DIR}/macos/AppIcon.icns - ${CMAKE_CURRENT_SOURCE_DIR}/../../patches.xml + ${CMAKE_CURRENT_SOURCE_DIR}/../../GameConfig.xml ) if(DEBUGGER_INCLUDED) list(APPEND OSX_RES ${CMAKE_CURRENT_SOURCE_DIR}/../../ee_functions.xml) diff --git a/build_android/build.gradle b/build_android/build.gradle index b5a7ecbea6..d137b0f23c 100644 --- a/build_android/build.gradle +++ b/build_android/build.gradle @@ -106,7 +106,7 @@ android { } task copyPatchesFile(type: Copy) { - from '../patches.xml' + from '../GameConfig.xml' into 'src/main/assets' } diff --git a/installer_win32/installer32.nsi b/installer_win32/installer32.nsi index 474dcf5e1f..2929d6184a 100644 --- a/installer_win32/installer32.nsi +++ b/installer_win32/installer32.nsi @@ -80,7 +80,7 @@ Section "Play! (required)" File /oname=platforms\qwindows.dll "${BINARY_INPUT_PATH}\platforms\qwindows.dll" File /oname=styles\qwindowsvistastyle.dll "${BINARY_INPUT_PATH}\styles\qwindowsvistastyle.dll" File /oname=imageformats\qjpeg.dll "${BINARY_INPUT_PATH}\imageformats\qjpeg.dll" - File "..\Patches.xml" + File "..\GameConfig.xml" File "..\states.db" SetOutPath $INSTDIR\arcadedefs @@ -131,7 +131,7 @@ Section "Uninstall" Delete $INSTDIR\platforms\qwindows.dll Delete $INSTDIR\styles\qwindowsvistastyle.dll Delete $INSTDIR\imageformats\qjpeg.dll - Delete $INSTDIR\Patches.xml + Delete $INSTDIR\GameConfig.xml Delete $INSTDIR\states.db Delete $INSTDIR\arcadedefs\* Delete $INSTDIR\uninstall.exe diff --git a/installer_win32/installer64.nsi b/installer_win32/installer64.nsi index a0577014f5..dc14697898 100644 --- a/installer_win32/installer64.nsi +++ b/installer_win32/installer64.nsi @@ -81,7 +81,6 @@ Section "Play! (required)" File /oname=platforms\qwindows.dll "${BINARY_INPUT_PATH}\platforms\qwindows.dll" File /oname=styles\qwindowsvistastyle.dll "${BINARY_INPUT_PATH}\styles\qwindowsvistastyle.dll" File /oname=imageformats\qjpeg.dll "${BINARY_INPUT_PATH}\imageformats\qjpeg.dll" - File "..\Patches.xml" File "..\GameConfig.xml" File "..\states.db" @@ -135,7 +134,6 @@ Section "Uninstall" Delete $INSTDIR\platforms\qwindows.dll Delete $INSTDIR\styles\qwindowsvistastyle.dll Delete $INSTDIR\imageformats\qjpeg.dll - Delete $INSTDIR\Patches.xml Delete $INSTDIR\GameConfig.xml Delete $INSTDIR\states.db Delete $INSTDIR\arcadedefs\* diff --git a/patches.xml b/patches.xml deleted file mode 100644 index 1c5b3057b7..0000000000 --- a/patches.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - -