patches: more consistency with console messages

If the dev/verbose console source is enabled then there's no change.

If it's not enabled (i.e. most users), then:
- Don't show patch info messages twice on boot (regression from 27e7ecce).
- Show patch info messages when loading a saved state (never worked).
- Don't show patch info messages for the bios.

It still doesn't print the info when patches/fixes/etc are enabled or
disabled while a game is running, because such actions while a game is
running can have unexpected effects regardless (for instance, it's
technically impossible to unapply a patch).

If one really wants to follow the exact timing and info about patch
loading, just enable the dev/verbose console source at the console menu.
This commit is contained in:
Avi Halachmi (:avih) 2016-07-31 16:27:07 +03:00
parent 92ae8a5be7
commit 2aac8d875a
3 changed files with 28 additions and 17 deletions

View File

@ -121,6 +121,9 @@ extern void ForgetLoadedPatches();
extern const IConsoleWriter *PatchesCon;
// Patch loading is verbose only once after the crc changes, this makes it think that the crc changed.
extern void PatchesVerboseReset();
// The following prototypes seem unused in PCSX2, but maybe part of the cheats browser?
// regardless, they don't seem to have an implementation anywhere.
// extern int AddPatch(int Mode, int Place, int Address, int Size, u64 data);

View File

@ -295,7 +295,13 @@ static int loadGameSettings(Pcsx2Config& dest, const Game_Data& game) {
// applied patches if the game info hasn't changed. (avoids spam when suspending/resuming
// or using TAB or other things), but gets verbose again when booting (even if the same game).
// File scope since it gets reset externally when rebooting
static wxString curGameKey;
#define _UNKNOWN_GAME_KEY (L"_UNKNOWN_GAME_KEY")
static wxString curGameKey = _UNKNOWN_GAME_KEY;
void PatchesVerboseReset()
{
curGameKey = _UNKNOWN_GAME_KEY;
}
// PatchesCon points to either Console or ConsoleWriter_Null, such that if we're in Devel mode
// or the user enabled the devel/verbose console it prints all patching info whenever it's applied,
@ -368,7 +374,8 @@ static void _ApplySettings( const Pcsx2Config& src, Pcsx2Config& fixup )
if (ingame && !DiscSerial.IsEmpty()) gameSerial = L" [" + DiscSerial + L"]";
const wxString newGameKey(ingame ? SysGetDiscID() : SysGetBiosDiscID());
const bool verbose( newGameKey != curGameKey );
const bool verbose( newGameKey != curGameKey && ingame );
//Console.WriteLn(L"------> patches verbose: %d prev: '%s' new: '%s'", (int)verbose, WX_STR(curGameKey), WX_STR(newGameKey));
SetupPatchesCon(verbose);
curGameKey = newGameKey;
@ -469,6 +476,7 @@ static void _ApplySettings( const Pcsx2Config& src, Pcsx2Config& fixup )
void LoadAllPatchesAndStuff(const Pcsx2Config& cfg)
{
Pcsx2Config dummy;
PatchesVerboseReset();
_ApplySettings(cfg, dummy);
}
@ -547,10 +555,6 @@ void AppCoreThread::VsyncInThread()
void AppCoreThread::GameStartingInThread()
{
// Make AppCoreThread::ApplySettings get verbose again even if we're booting
// the same game, by making it think that the current CRC is a new one.
curGameKey = L"";
// Simulate a Close/Resume, so that settings get re-applied and the database
// lookups and other game-based detections are done.

View File

@ -27,6 +27,8 @@
#include <wx/wfstream.h>
#include <memory>
#include "Patch.h"
// Used to hold the current state backup (fullcopy of PS2 memory and plugin states).
//static VmStateBuffer state_buffer( L"Public Savestate Buffer" );
@ -604,6 +606,8 @@ protected:
// We use direct Suspend/Resume control here, since it's desirable that emulation
// *ALWAYS* start execution after the new savestate is loaded.
PatchesVerboseReset();
GetCoreThread().Pause();
SysClearExecutionCache();