diff options
author | Twinaphex | 2020-02-21 19:46:05 +0100 |
---|---|---|
committer | GitHub | 2020-02-21 19:46:05 +0100 |
commit | 3eb073975e1816abadd8b15f53fe62f74ee1c7a8 (patch) | |
tree | 1f83b397228d275a3c82643d053533822ed93c02 | |
parent | 37e4b2cc27ccb08c1063c3db575d92191d141133 (diff) | |
parent | 8c9468f18461e1193c479c560a435154387191a9 (diff) | |
download | pcsx_rearmed-3eb073975e1816abadd8b15f53fe62f74ee1c7a8.tar.gz pcsx_rearmed-3eb073975e1816abadd8b15f53fe62f74ee1c7a8.tar.bz2 pcsx_rearmed-3eb073975e1816abadd8b15f53fe62f74ee1c7a8.zip |
Merge pull request #388 from ZachCook/master
Fix second instance runahead without breaking reset
-rw-r--r-- | libpcsxcore/lightrec/plugin.c | 7 | ||||
-rw-r--r-- | libpcsxcore/misc.c | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/libpcsxcore/lightrec/plugin.c b/libpcsxcore/lightrec/plugin.c index 64587be..8c64c67 100644 --- a/libpcsxcore/lightrec/plugin.c +++ b/libpcsxcore/lightrec/plugin.c @@ -553,8 +553,11 @@ static void lightrec_plugin_execute(void) static void lightrec_plugin_clear(u32 addr, u32 size) { - /* size * 4: PCSX uses DMA units */ - lightrec_invalidate(lightrec_state, addr, size * 4); + if (addr == 0 && size == UINT32_MAX) + lightrec_invalidate_all(lightrec_state); + else + /* size * 4: PCSX uses DMA units */ + lightrec_invalidate(lightrec_state, addr, size * 4); } static void lightrec_plugin_shutdown(void) diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index 56b7552..d877513 100644 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -657,6 +657,11 @@ int LoadState(const char *file) { if (Config.HLE) psxBiosInit(); +#if defined(LIGHTREC) + if (Config.Cpu != CPU_INTERPRETER) + psxCpu->Clear(0, UINT32_MAX); //clear all + else +#endif psxCpu->Reset(); SaveFuncs.seek(f, 128 * 96 * 3, SEEK_CUR); |