mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-25 07:46:01 +03:00
[PR #493] [MERGED] Cheats/Patches #1596
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#1596
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/493
Author: @DanielSvoboda
Created: 8/20/2024
Status: ✅ Merged
Merged: 8/29/2024
Merged by: @georgemoralis
Base:
main← Head:Cheats_Patches📝 Commits (10+)
10485afCheats/Patches4b84fedClang Format61fb15bseparate files1be30f6reuseb017b30initial implementation of cheat functionalityf326173Merge pull request #2 from CrazyBloo/Cheats_Patches2b45464Update cheats_patches.cppe938ecfmove eboot_address to module.h0e48887Merge pull request #3 from CrazyBloo/Cheats_Patches957d3e3Patchs menu and fixes📊 Changes
35 files changed (+12003 additions, -798 deletions)
View changed files
📝
CMakeLists.txt(+7 -2)📝
src/common/path_util.cpp(+2 -0)📝
src/common/path_util.h(+4 -0)📝
src/core/module.cpp(+13 -0)📝
src/emulator.cpp(+6 -0)➕
src/qt_gui/cheats_patches.cpp(+1264 -0)➕
src/qt_gui/cheats_patches.h(+115 -0)📝
src/qt_gui/gui_context_menus.h(+22 -0)📝
src/qt_gui/main_window.cpp(+107 -24)📝
src/qt_gui/main_window_ui.h(+6 -1)➕
src/qt_gui/memory_patcher.cpp(+347 -0)➕
src/qt_gui/memory_patcher.h(+47 -0)📝
src/qt_gui/translations/da_DK.ts(+414 -13)📝
src/qt_gui/translations/de.ts(+414 -13)📝
src/qt_gui/translations/el.ts(+414 -13)📝
src/qt_gui/translations/en.ts(+414 -13)📝
src/qt_gui/translations/es_ES.ts(+415 -14)📝
src/qt_gui/translations/fi.ts(+414 -13)📝
src/qt_gui/translations/fr.ts(+414 -13)📝
src/qt_gui/translations/hu_HU.ts(+401 -0)...and 15 more files
📄 Description
Add Support for
Cheats and PatchesThis PR adds the ability to apply cheats and patches to the emulator. Below are two explanations: one simplified and one with technical details for developers.
Cheats
Right-click on a game and select the 'Cheats/Patches' option. From there, you can download cheats from three repositories: wolf2022, GoldHEN, and shadPS4. If a cheat is available in more than one repository, you can delete the undesired file using a specific button. Cheats will only be downloaded for the specific serial and version of the installed game and will be renamed with the format serial+version+repository.
In the top menu, under "Settings -> Utils -> Download Cheats/Patches", you can download all cheats at once for the installed games. It is recommended to apply cheats only during gameplay.
Patches
In addition to cheats, you can also download patches. Unlike cheats, patches are downloaded for all games, not just one specific game. The patch file is quite small. Right-click on a game, select 'Cheats/Patches', go to the patches tab, check the patches you want to use, and click 'Save'. This ensures that these options will be applied automatically every time the emulator is started, without needing to reopen the panel. In the Patches tab, if you hover over them you can see the description on the left side.
Technical Explanation:
For developers who will maintain this code in the future:
Cheats
user\cheats\folder, with names in the format serial+version+repository. Some repositories may provide multiple files for the same serial+version, distinguished by suffixes like _2 or _3, indicating different authors. The emulator can read any file starting with serial+version, for example:hint:nullare treated as absolute addresses. If the tag is missing, they are considered relative. The emulator handles these cases correctly.Patches
Patches are downloaded to
user\patches\repository_name. After downloading the .xml files, afiles.jsonfile is created to map the files to the selected games, as patches are not named as systematically as cheats. Thefiles.jsonincludes information about the 'serial and version', ensuring that only the patch corresponding to the game's version is shown. Patches may also include a 'mask', with the title " (any version)".In the context menu (right-click), select the patches you want to activate and save the settings. These patches will be automatically applied every time the game is started in QT mode; patches are not applied in SDL mode. The support for various types present in the XML is provided: byte, bytes16, bytes32, bytes64, bytes, float32, float64, utf8, utf16, mask, mask_jump32.
The 'mask' functionality is still under testing, as there are currently few games using it.
Changes are made in eboot.bin, not tested with changes in .elf
I found some of the text too long to translate in parts,
so I replaced it with the text below, so the text only appears in the .ts translation file:
defaultTextEdit_MSG
CheatsNotFound_MSG
CheatsDownloadedSuccessfully_MSG
DownloadComplete_MSG
Repository for New Cheats/Patches
New cheats and patches can be added via the repository:
https://github.com/shadps4-emu/ps4_cheats
Interface based on issues/372
Authored-by: DanielSvoboda
Co-authored-by: CrazyBloo
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.