mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-04 03:35:19 +02:00
Add facility for __KernelGPUReplay to request to be called again
This commit is contained in:
@@ -1984,21 +1984,26 @@ bool __KernelLoadExec(const char *filename, u32 paramPtr, std::string *error_str
|
||||
bool __KernelLoadGEDump(const std::string &base_filename, std::string *error_string) {
|
||||
__KernelLoadReset();
|
||||
|
||||
mipsr4k.pc = PSP_GetUserMemoryBase();
|
||||
constexpr u32 codeStart = PSP_GetUserMemoryBase();
|
||||
mipsr4k.pc = codeStart;
|
||||
|
||||
const static u32_le runDumpCode[] = {
|
||||
// Save the filename.
|
||||
MIPS_MAKE_ORI(MIPS_REG_S0, MIPS_REG_A0, 0),
|
||||
MIPS_MAKE_ORI(MIPS_REG_S1, MIPS_REG_A1, 0),
|
||||
// Call the actual render.
|
||||
// Call the actual render. Jump here to start over.
|
||||
MIPS_MAKE_SYSCALL("FakeSysCalls", "__KernelGPUReplay"),
|
||||
MIPS_MAKE_NOP(),
|
||||
// Re-run immediately if requested by the return value from __KernelGPUReplay
|
||||
MIPS_MAKE_BNEZ(codeStart + 4 * 4, codeStart + 8, MIPS_REG_V0),
|
||||
MIPS_MAKE_NOP(),
|
||||
// Make sure we don't get out of sync.
|
||||
MIPS_MAKE_LUI(MIPS_REG_A0, 0),
|
||||
MIPS_MAKE_SYSCALL("sceGe_user", "sceGeDrawSync"),
|
||||
// Wait for the next vblank to render again.
|
||||
MIPS_MAKE_J(mipsr4k.pc + 8),
|
||||
MIPS_MAKE_J(codeStart + 8),
|
||||
MIPS_MAKE_SYSCALL("sceDisplay", "sceDisplayWaitVblankStart"),
|
||||
// This never gets reached, just here to be safe.
|
||||
// This never gets reached, just here to be "safe".
|
||||
MIPS_MAKE_BREAK(0),
|
||||
};
|
||||
|
||||
@@ -2021,13 +2026,13 @@ bool __KernelLoadGEDump(const std::string &base_filename, std::string *error_str
|
||||
return true;
|
||||
}
|
||||
|
||||
void __KernelGPUReplay() {
|
||||
int __KernelGPUReplay() {
|
||||
// Special ABI: s0 and s1 are the "args". Not null terminated.
|
||||
const char *filenamep = Memory::GetCharPointer(currentMIPS->r[MIPS_REG_S1]);
|
||||
if (!filenamep) {
|
||||
ERROR_LOG(Log::G3D, "Failed to load dump filename");
|
||||
Core_Stop();
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string filename(filenamep, currentMIPS->r[MIPS_REG_S0]);
|
||||
@@ -2042,6 +2047,7 @@ void __KernelGPUReplay() {
|
||||
System_SendDebugScreenshot(std::string((const char *)&topaddr[0], linesize * 272), 272);
|
||||
Core_Stop();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceKernelLoadExec(const char *filename, u32 paramPtr)
|
||||
|
||||
Reference in New Issue
Block a user