Skip to content
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

Fix intra-buffer blit, Tales of Phantasia X save pictures #6263

Merged
merged 3 commits into from
Jun 8, 2014
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
3 changes: 3 additions & 0 deletions Core/Debugger/DisassemblyManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ DisassemblyFunction::DisassemblyFunction(u32 _address, u32 _size): address(_addr

void DisassemblyFunction::recheck()
{
if (!PSP_IsInited()) {
return;
}
u32 newHash = computeHash(address,size);
if (hash != newHash)
{
Expand Down
10 changes: 10 additions & 0 deletions Core/HLE/ReplaceTables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,15 @@ static int Hook_starocean_write_stencil() {
return 0;
}

static int Hook_topx_create_saveicon() {
u32 fb_address = currentMIPS->r[MIPS_REG_V0];
if (Memory::IsVRAMAddress(fb_address)) {
gpu->PerformMemoryDownload(fb_address, 0x00044000);
CBreakPoints::ExecMemCheck(fb_address, true, 0x00044000, currentMIPS->pc);
}
return 0;
}

// Can either replace with C functions or functions emitted in Asm/ArmAsm.
static const ReplacementTableEntry entries[] = {
// TODO: I think some games can be helped quite a bit by implementing the
Expand Down Expand Up @@ -546,6 +555,7 @@ static const ReplacementTableEntry entries[] = {
{ "godseaterburst_blit_texture", &Hook_godseaterburst_blit_texture, 0, REPFLAG_HOOKENTER},
{ "hexyzforce_monoclome_thread", &Hook_hexyzforce_monoclome_thread, 0, REPFLAG_HOOKENTER, 0x58},
{ "starocean_write_stencil", &Hook_starocean_write_stencil, 0, REPFLAG_HOOKENTER, 0x260},
{ "topx_create_saveicon", &Hook_topx_create_saveicon, 0, REPFLAG_HOOKENTER, 0x34},
{}
};

Expand Down
1 change: 1 addition & 0 deletions Core/MIPS/MIPSAnalyst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ static const HardHashTableEntry hardcodedHashes[] = {
{ 0xe32cb5c062d1a1c4, 700, "_strtoull_r", },
{ 0xe3835fb2c9c04e59, 44, "vmmul_q", },
{ 0xe527c62d8613f297, 136, "strcpy", },
{ 0xe6002fc9affd678e, 480, "topx_create_saveicon", }, // Tales of Phantasia X
{ 0xe7b36c2c1348551d, 148, "tan", },
{ 0xe83a7a9d80a21c11, 4448, "_strtod_r", },
{ 0xe894bda909a8a8f9, 1064, "expensive_wipeout_pulse", },
Expand Down
2 changes: 1 addition & 1 deletion GPU/GLES/Framebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2177,7 +2177,7 @@ bool FramebufferManager::NotifyBlockTransferBefore(u32 dstBasePtr, int dstStride
if (srcX != dstX || srcY != dstY) {
WARN_LOG_ONCE(dstsrc, G3D, "Intra-buffer block transfer %08x -> %08x", srcBasePtr, dstBasePtr);
if (g_Config.bBlockTransferGPU) {
FBO *tempFBO = GetTempFBO(dstBuffer->width, dstBuffer->height, dstBuffer->colorDepth);
FBO *tempFBO = GetTempFBO(dstBuffer->renderWidth, dstBuffer->renderHeight, dstBuffer->colorDepth);
VirtualFramebuffer tempBuffer = *dstBuffer;
tempBuffer.fbo = tempFBO;
BlitFramebuffer_(&tempBuffer, srcX, srcY, dstBuffer, srcX, srcY, dstWidth, dstHeight, bpp);
Expand Down