Skip to content

Commit

Permalink
Merge pull request #16359 from unknownbrackets/marvel-upload
Browse files Browse the repository at this point in the history
GPU: Hook US version of Marvel Alliance upload
  • Loading branch information
hrydgard authored Nov 12, 2022
2 parents 2e3dce3 + 50f7095 commit 945288f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
20 changes: 13 additions & 7 deletions Core/HLE/ReplaceTables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1271,10 +1271,12 @@ static u32 marvelalliance1_copy_size = 0;
static int Hook_marvelalliance1_copy_a1_before() {
marvelalliance1_copy_src = currentMIPS->r[MIPS_REG_A1];
marvelalliance1_copy_dst = currentMIPS->r[MIPS_REG_V1];
marvelalliance1_copy_size = currentMIPS->r[MIPS_REG_V0] - currentMIPS->r[MIPS_REG_V1];
marvelalliance1_copy_size = currentMIPS->r[MIPS_REG_V0] - currentMIPS->r[MIPS_REG_A1];

gpu->PerformReadbackToMemory(marvelalliance1_copy_src, marvelalliance1_copy_size);
NotifyMemInfo(MemBlockFlags::WRITE, marvelalliance1_copy_src, marvelalliance1_copy_size, "marvelalliance1_copy_a1_before");
if (Memory::IsValidRange(marvelalliance1_copy_src, marvelalliance1_copy_size)) {
gpu->PerformReadbackToMemory(marvelalliance1_copy_src, marvelalliance1_copy_size);
NotifyMemInfo(MemBlockFlags::WRITE, marvelalliance1_copy_src, marvelalliance1_copy_size, "marvelalliance1_copy_a1_before");
}

return 0;
}
Expand All @@ -1284,15 +1286,19 @@ static int Hook_marvelalliance1_copy_a2_before() {
marvelalliance1_copy_dst = currentMIPS->r[MIPS_REG_V0];
marvelalliance1_copy_size = currentMIPS->r[MIPS_REG_A1] - currentMIPS->r[MIPS_REG_A2];

gpu->PerformReadbackToMemory(marvelalliance1_copy_src, marvelalliance1_copy_size);
NotifyMemInfo(MemBlockFlags::WRITE, marvelalliance1_copy_src, marvelalliance1_copy_size, "marvelalliance1_copy_a2_before");
if (Memory::IsValidRange(marvelalliance1_copy_src, marvelalliance1_copy_size)) {
gpu->PerformReadbackToMemory(marvelalliance1_copy_src, marvelalliance1_copy_size);
NotifyMemInfo(MemBlockFlags::WRITE, marvelalliance1_copy_src, marvelalliance1_copy_size, "marvelalliance1_copy_a2_before");
}

return 0;
}

static int Hook_marvelalliance1_copy_after() {
gpu->PerformWriteColorFromMemory(marvelalliance1_copy_dst, marvelalliance1_copy_size);
NotifyMemInfo(MemBlockFlags::READ, marvelalliance1_copy_dst, marvelalliance1_copy_size, "marvelalliance1_copy_after");
if (Memory::IsValidRange(marvelalliance1_copy_dst, marvelalliance1_copy_size)) {
gpu->PerformWriteColorFromMemory(marvelalliance1_copy_dst, marvelalliance1_copy_size);
NotifyMemInfo(MemBlockFlags::READ, marvelalliance1_copy_dst, marvelalliance1_copy_size, "marvelalliance1_copy_after");
}

return 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 @@ -355,6 +355,7 @@ static const HardHashTableEntry hardcodedHashes[] = {
{ 0x9f269daa6f0da803, 128, "dl_write_scissor_region", },
{ 0x9f7919eeb43982b0, 208, "__fixdfsi", },
{ 0xa1c9b0a2c71235bf, 1752, "marvelalliance1_copy" }, // Marvel Ultimate Alliance 1 (EU)
{ 0x9b76c7f2a41aa805, 1752, "marvelalliance1_copy" }, // Marvel Ultimate alliance 1 (US)
{ 0xa1ca0640f11182e7, 72, "strcspn", },
{ 0xa243486be51ce224, 272, "cosf", },
{ 0xa2bcef60a550a3ef, 92, "matrix_rot_z", },
Expand Down

0 comments on commit 945288f

Please sign in to comment.