Compare commits

...

2 Commits

Author SHA1 Message Date
JordanTheToaster
affdb78a65 GameDB: Change LSW 2 fixes 2024-12-09 12:14:24 -05:00
Ty Lamontagne
313ddb7879 EE Cache: Writeback dirty cache entries when exiting the interpreter. 2024-12-08 17:49:33 -05:00
4 changed files with 29 additions and 8 deletions

View File

@@ -13205,8 +13205,8 @@ SLED-54315:
name: "LEGO Star Wars II - The Original Trilogy [Demo]"
region: "PAL-M5"
gsHWFixes:
halfPixelOffset: 4 # Mostly aligns post processing.
nativeScaling: 1 # Fixes post processing smoothness and position.
halfPixelOffset: 1 # Aligns post processing.
nativeScaling: 2 # Fixes post processing smoothness and position.
SLED-54327:
name: "FIFA 07"
region: "PAL-M7"
@@ -24396,8 +24396,8 @@ SLES-54221:
name: "LEGO Star Wars II - The Original Trilogy"
region: "PAL-M6"
gsHWFixes:
halfPixelOffset: 4 # Mostly aligns post processing.
nativeScaling: 1 # Fixes post processing smoothness and position.
halfPixelOffset: 1 # Aligns post processing.
nativeScaling: 2 # Fixes post processing smoothness and position.
memcardFilters: # Allows import of characters from Lego Star Wars 1.
- "SLES-54221"
- "SLES-53194"
@@ -46148,8 +46148,8 @@ SLPM-66572:
name-en: "LEGO Star Wars II - The Original Trilogy"
region: "NTSC-J"
gsHWFixes:
halfPixelOffset: 4 # Mostly aligns post processing.
nativeScaling: 1 # Fixes post processing smoothness and position.
halfPixelOffset: 1 # Aligns post processing.
nativeScaling: 2 # Fixes post processing smoothness and position.
memcardFilters:
- "SLPM-66572"
- "SLPS-20423"
@@ -66094,8 +66094,8 @@ SLUS-21409:
name: "LEGO Star Wars II - The Original Trilogy"
region: "NTSC-U"
gsHWFixes:
halfPixelOffset: 4 # Mostly aligns post processing.
nativeScaling: 1 # Fixes post processing smoothness and position.
halfPixelOffset: 1 # Aligns post processing.
nativeScaling: 2 # Fixes post processing smoothness and position.
memcardFilters:
- "SLUS-21409"
- "SLUS-21083"

View File

@@ -163,6 +163,17 @@ void resetCache()
std::memset(&cache, 0, sizeof(cache));
}
void writebackCache()
{
for (int i = 0; i < 64; i++)
{
for (int j = 0; j < 2; j++)
{
cache.lineAt(i, j).writeBackIfNeeded();
}
}
}
static bool findInCache(const CacheSet& set, uptr ppf, int* way)
{
auto check = [&](int checkWay) -> bool {

View File

@@ -8,6 +8,9 @@
#include "common/SingleRegisterTypes.h"
void resetCache();
// Dumps all dirty cache entries to memory
// This is necessary to fix a bug when enabled the recompiler while the cache was enabled.
void writebackCache();
void writeCache8(u32 mem, u8 value, bool validPFN = true);
void writeCache16(u32 mem, u16 value, bool validPFN = true);
void writeCache32(u32 mem, u32 value, bool validPFN = true);

View File

@@ -5,6 +5,7 @@
#include "R5900OpcodeTables.h"
#include "VMManager.h"
#include "Elfheader.h"
#include "Cache.h"
#include "DebugTools/Breakpoints.h"
@@ -555,6 +556,8 @@ static void intEventTest()
if (intExitExecution)
{
intExitExecution = false;
if (CHECK_EEREC)
writebackCache();
fastjmp_jmp(&intJmpBuf, 1);
}
}
@@ -566,7 +569,11 @@ static void intSafeExitExecution()
if (eeEventTestIsActive)
intExitExecution = true;
else
{
if (CHECK_EEREC)
writebackCache();
fastjmp_jmp(&intJmpBuf, 1);
}
}
static void intCancelInstruction()