Merge pull request #20067 from hrydgard/persona1-framebuffer-download

Hook framebuffer readback function in Persona 1.
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2025-03-03 11:15:20 +01:00
commit f40cd8b8e6
3 files changed
+28

No files matched your search

+12
View File
@@ -1280,6 +1280,17 @@ static int Hook_omertachinmokunookitethelegacy_download_frame() {
return 0;
}
// Function at 0886665C in US version
static int Hook_persona1_download_frame() {
const u32 fb_address = 0x04088000; // hardcoded at 088666D8
// const u32 dest_address = currentMIPS->r[MIPS_REG_A1]; // not relevant
if (Memory::IsVRAMAddress(fb_address)) {
gpu->PerformReadbackToMemory(fb_address, 0x00088000);
NotifyMemInfo(MemBlockFlags::WRITE, fb_address, 0x00088000, "persona1_download_frame");
}
return 0;
}
static int Hook_katamari_render_check() {
const u32 fb_address = Memory::Read_U32(currentMIPS->r[MIPS_REG_A0] + 0x3C);
const u32 fbInfoPtr = Memory::Read_U32(currentMIPS->r[MIPS_REG_A0] + 0x40);
@@ -1595,6 +1606,7 @@ static const ReplacementTableEntry entries[] = {
{ "ZZT3_select_hack", &Hook_ZZT3_select_hack, 0, REPFLAG_HOOKENTER, 0xC4 },
{ "blitz_fps_hack", &Hook_blitz_fps_hack, 0, REPFLAG_HOOKEXIT , 0 },
{ "brian_lara_fps_hack", &Hook_brian_lara_fps_hack, 0, REPFLAG_HOOKEXIT , 0 },
{ "persona1_download_frame", &Hook_persona1_download_frame, 0, REPFLAG_HOOKENTER, 0 },
{}
};
+1
View File
@@ -514,6 +514,7 @@ static const HardHashTableEntry hardcodedHashes[] = {
{ 0x7624dde603717640, 288, "ZZT3_select_hack", }, // Zettai Zetsumei Toshi 3 - bypasses softlock on character select screen #4901
{ 0x0dc5ca84f707863c, 452, "blitz_fps_hack", }, // Blitz: Overtime
{ 0xf93d3cd093595a6c, 856, "brian_lara_fps_hack", }, // Brian Lara 2007: Pressure Play
{ 0xc1d4af42a4c8860f, 964, "persona1_download_frame", }, // Persona 1 (issue #13079)
};
namespace MIPSAnalyst {
+15
View File
@@ -6,6 +6,7 @@
#include "Common/StringUtils.h"
#include "Common/File/FileUtil.h"
#include "Common/Data/Format/IniFile.h"
#include "Common/Data/Text/Parsers.h"
#include "Core/Config.h"
#include "Core/System.h"
#include "Core/RetroAchievements.h"
@@ -181,6 +182,20 @@ static void DrawGPRs(ImConfig &config, ImControl &control, const MIPSDebugInterf
bool noDiff = coreState == CORE_RUNNING_CPU || coreState == CORE_STEPPING_GE;
if (ImGui::Button("Copy all to clipboard")) {
char *buffer = new char[20000];
StringWriter w(buffer);
for (int i = 0; i < 32; i++) {
u32 value = mipsDebug->GetGPR32Value(i);
w.F("%s: %08x (%d)", mipsDebug->GetRegName(0, i).c_str(), value, value).endl();
}
w.F("hi: %08x", mipsDebug->GetHi()).endl();
w.F("lo: %08x", mipsDebug->GetLo()).endl();
w.F("pc: %08x", mipsDebug->GetPC()).endl();
System_CopyStringToClipboard(buffer);
delete[] buffer;
}
if (ImGui::BeginTable("gpr", 3, ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersH)) {
ImGui::TableSetupColumn("Reg", ImGuiTableColumnFlags_WidthFixed);
ImGui::TableSetupColumn("Value", ImGuiTableColumnFlags_WidthFixed);