8000 Hook framebuffer readback function in Persona 1. by hrydgard · Pull Request #20067 · hrydgard/ppsspp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Hook framebuffer readback function in Persona 1. #20067

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Core/HLE/ReplaceTables.cpp
< 8000 tr data-hunk="e874ca69ed220bcb2aa4a28d15395155c6d6ee0616f311f632c2faf6a199a722" class="show-top-border">
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 },
{}
};

Expand Down
1 change: 1 addition & 0 deletions Core/MIPS/MIPSAnalyst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
15 changes: 15 additions & 0 deletions UI/ImDebugger/ImDebugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down
Loading
0