MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / ChangeDump

Method ChangeDump

pcsx2/GSDumpReplayer.cpp:117–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117bool GSDumpReplayer::ChangeDump(const char* filename)
118{
119 Console.WriteLn("(GSDumpReplayer) Switching to '%s'...", filename);
120
121 if (!VMManager::IsGSDumpFileName(filename))
122 {
123 Host::ReportFormattedErrorAsync("GSDumpReplayer", "'%s' is not a GS dump.", filename);
124 return false;
125 }
126
127 Error error;
128 std::unique_ptr<GSDumpFile> new_dump(GSDumpFile::OpenGSDump(filename));
129 if (!new_dump || !new_dump->ReadFile(&error))
130 {
131 Host::ReportErrorAsync("GSDumpReplayer", fmt::format("Failed to open or read '{}': {}",
132 Path::GetFileName(filename), error.GetDescription()));
133 return false;
134 }
135
136 s_dump_file = std::move(new_dump);
137 s_current_packet = 0;
138
139 // Don't forget to reset the GS!
140 GSDumpReplayerCpuReset();
141 return true;
142}
143
144void GSDumpReplayer::Shutdown()
145{

Callers

nothing calls this directly

Calls 5

GSDumpReplayerCpuResetFunction · 0.85
GetDescriptionMethod · 0.80
formatFunction · 0.50
WriteLnMethod · 0.45
ReadFileMethod · 0.45

Tested by

no test coverage detected