Skip to content

Commit 68c39d9

Browse files
committed
RenderMefiress Resolution Patch
Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>
1 parent dc0da0e commit 68c39d9

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

MarathonRecomp/patches/video_patches.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ void SetMSAALevel(PPCRegister& val)
66
val.u32 = 0;
77
}
88

9+
std::string g_blockName;
10+
11+
void BeginBlock(PPCRegister& name)
12+
{
13+
auto pName = xpointer(reinterpret_cast<char*>(name.u32));
14+
g_blockName = std::string(pName.get());
15+
}
16+
17+
// Blocks can be nested, so this is actually
18+
// incorrect, but we only care about one that isn't
19+
void EndBlock()
20+
{
21+
g_blockName.clear();
22+
}
23+
924
float ReflectionScaleFactor(EReflectionResolution ref) {
1025
switch (ref) {
1126
case EReflectionResolution::Eighth:
@@ -35,6 +50,13 @@ PPC_FUNC(sub_82619D00)
3550
ReflectionScaleFactor(Config::ReflectionResolution));
3651
}
3752

53+
// RenderMefiress
54+
if (*pName == "user0")
55+
{
56+
ctx.r5.u32 = (int32_t)Config::ShadowResolution.Value;
57+
ctx.r6.u32 = (int32_t)Config::ShadowResolution.Value;
58+
}
59+
3860
__imp__sub_82619D00(ctx, base);
3961
}
4062

@@ -56,6 +78,13 @@ PPC_FUNC(sub_82619B88)
5678
ctx.r5.u32++;
5779
}
5880

81+
// RenderMefiress
82+
if (*pName == "depthstencil_256" && g_blockName == "user0")
83+
{
84+
ctx.r5.u32 = (int32_t)Config::ShadowResolution.Value;
85+
ctx.r6.u32 = (int32_t)Config::ShadowResolution.Value;
86+
}
87+
5988
__imp__sub_82619B88(ctx, base);
6089
}
6190

MarathonRecompLib/config/Marathon.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,3 +263,12 @@ registers = ["r8"]
263263
name = "MovieVoiceLang"
264264
address = 0x8264B4E4
265265
registers = ["r19"]
266+
267+
[[midasm_hook]]
268+
name = "BeginBlock"
269+
address = 0x82607854
270+
registers = ["r4"]
271+
272+
[[midasm_hook]]
273+
name = "EndBlock"
274+
address = 0x826078D8

0 commit comments

Comments
 (0)