PNACH: combined patch effects

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech 2020-08-17 01:39:01 +02:00 committed by refractionpcsx2
parent a0cb6dda94
commit 86ed9f68f6
2 changed files with 13 additions and 1 deletions

View File

@ -61,9 +61,20 @@ enum patch_data_type {
// PCSX2 currently supports the following values:
// 0 - apply the patch line once on game boot/startup
// 1 - apply the patch line continuously (technically - on every vsync)
// 2 - effect of 0 and 1 combined, see below
// Note:
// - while it may seem that a value of 1 does the same as 0, but also later
// continues to apply the patch on every vsync - it's not.
// The current (and past) behavior is that these patches are applied at different
// places at the code, and it's possible, depending on circumstances, that 0 patches
// will get applied before the first vsync and therefore earlier than 1 patches.
// - There's no "place" value which indicates to apply both once on startup
// and then also continuously, however such behavior can be achieved by
// duplicating the line where one has a 0 place and the other has a 1 place.
enum patch_place_type {
PPT_ONCE_ON_LOAD = 0,
PPT_CONTINUOUSLY = 1,
PPT_COMBINED_0_1 = 2,
_PPT_END_MARKER
};

View File

@ -245,6 +245,7 @@ void SysCoreThread::DoCpuReset()
void SysCoreThread::VsyncInThread()
{
ApplyLoadedPatches(PPT_CONTINUOUSLY);
ApplyLoadedPatches(PPT_COMBINED_0_1);
}
void SysCoreThread::GameStartingInThread()
@ -256,7 +257,7 @@ void SysCoreThread::GameStartingInThread()
sApp.PostAppMethod(&Pcsx2App::resetDebugger);
ApplyLoadedPatches(PPT_ONCE_ON_LOAD);
ApplyLoadedPatches(PPT_CONTINUOUSLY);
ApplyLoadedPatches(PPT_COMBINED_0_1);
#ifdef USE_SAVESLOT_UI_UPDATES
UI_UpdateSysControls();
#endif