Dolphin, the GameCube and Wii emulator - Forums

Full Version: Adding Custom Patches
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm hoping somebody can explain a bit about how Dolphin's patching features work, as I'd like to create some patches of my own.

My main question is: what happens when you enable them? The Hyrule Field Speed Hack for ZTP, for instance, is stored in the game's default INI under the Sys folder, and starts like so:

[OnFrame]
# Add memory patches to be applied every frame here.
$Hyrule Field Speed Hack
0x8003D50C:dword:0x60000000
0x8003D528:dword:0x60000000
0x8003D540:dword:0x60000000
0x8003D55C:dword:0x60000000

The [EmuState] field says:

EmulationIssues = Enable the "Hyrule Field Speed Hack" patch in game properties for a speed boost.

What exactly happens when you tick the checkbox to enable the hack? Does the [OnFrame] patch get copied to the game INI in your User folder, and that's what causes it to be enabled, or does the INI in the Sys folder get altered with some flag to enable the patch? (I don't have ZTP, so I can't find out for myself, unfortunately.) Do the [OnLoad] patches work the same way? I just want to patch some pointers, so I should be fine with an [OnLoad] patch, I think. Thanks!
The INI in the Sys folder is never altered. It gets saved in the user INI, but I don't remember exactly how. If you want to try out how the INI system works with patches, you can copy the Hyrule Field Speed Hack to the sys INI of any game you want. Just make sure that it's not enabled when you run the game, because that's not going to end well.

OnLoad works the same way with INIs as OnFrame.
Well, I tried your suggestion and found the setting that Dolphin applies:

[OnFrame_Enabled]
$Hyrule Field Speed Hack

goes into the game INI in the User folder to show that the patch is enabled. I wasn't able to do the same thing with [OnLoad] patches, though, so I guess the patches are stored in a different format? I tried moving the whole Hyrule Field Speed Hack into the [OnLoad] section, as well as only one line of it, but the patch tab under the game properties window is empty when I do. I also can't get the patch to appear in the patch tab if it's only in the User game INI, so I guess adding patches requires modification of the Sys INIs. Would anyone happen to know of a game that has an [OnLoad] patch, so I could test that?