Debugger: Bump GE dump version to ignore bad flag.

This commit is contained in:
Unknown W. Brackets 2022-08-11 20:28:56 -07:00
parent c74d69bc2d
commit 4467b7830f
2 changed files with 10 additions and 5 deletions

View file

@ -282,8 +282,8 @@ int BufMapping::slabGeneration_ = 0;
class DumpExecute {
public:
DumpExecute(const std::vector<u8> &pushbuf, const std::vector<Command> &commands)
: pushbuf_(pushbuf), commands_(commands), mapping_(pushbuf) {
DumpExecute(const std::vector<u8> &pushbuf, const std::vector<Command> &commands, uint32_t version)
: pushbuf_(pushbuf), commands_(commands), mapping_(pushbuf), version_(version) {
}
~DumpExecute();
@ -320,6 +320,7 @@ private:
const std::vector<u8> &pushbuf_;
const std::vector<Command> &commands_;
BufMapping mapping_;
uint32_t version_ = 0;
};
void DumpExecute::SyncStall() {
@ -564,7 +565,7 @@ void DumpExecute::Framebuf(int level, u32 ptr, u32 sz) {
u32 headerSize = (u32)sizeof(FramebufData);
u32 pspSize = sz - headerSize;
const bool isTarget = (framebuf->flags & 1) != 0;
const bool unchangedVRAM = (framebuf->flags & 2) != 0;
const bool unchangedVRAM = version_ >= 6 && (framebuf->flags & 2) != 0;
// TODO: Could use drawnVRAM flag, but it can be wrong.
// Could potentially always skip if !isTarget, but playing it safe for offset texture behavior.
if (Memory::IsValidRange(framebuf->addr, pspSize) && !unchangedVRAM && (!isTarget || !g_Config.bSoftwareRendering)) {
@ -708,11 +709,14 @@ bool RunMountedReplay(const std::string &filename) {
std::lock_guard<std::mutex> guard(executeLock);
Core_ListenStopRequest(&ReplayStop);
uint32_t version = 0;
if (lastExecFilename != filename) {
PROFILE_THIS_SCOPE("ReplayLoad");
u32 fp = pspFileSystem.OpenFile(filename, FILEACCESS_READ);
Header header;
pspFileSystem.ReadFile(fp, (u8 *)&header, sizeof(header));
version = header.version;
if (memcmp(header.magic, HEADER_MAGIC, sizeof(header.magic)) != 0 || header.version > VERSION || header.version < MIN_VERSION) {
ERROR_LOG(SYSTEM, "Invalid GE dump or unsupported version");
@ -751,7 +755,7 @@ bool RunMountedReplay(const std::string &filename) {
lastExecFilename = filename;
}
DumpExecute executor(lastExecPushbuf, lastExecCommands);
DumpExecute executor(lastExecPushbuf, lastExecCommands, version);
return executor.Run();
}

View file

@ -34,7 +34,8 @@ static const char *HEADER_MAGIC = "PPSSPPGE";
// Version 3: Adds FRAMEBUF0-FRAMEBUF9
// Version 4: Expanded header with game ID
// Version 5: Uses zstd
static const int VERSION = 5;
// Version 6: Corrects dirty VRAM flag
static const int VERSION = 6;
static const int MIN_VERSION = 2;
enum class CommandType : u8 {