Fix world map 3D to 2D projection.

This commit is contained in:
Skyth 2025-01-10 16:42:35 +03:00
parent c6e2dbcce0
commit 63a622740c
2 changed files with 11 additions and 0 deletions

View file

@ -941,3 +941,9 @@ PPC_FUNC(sub_826906A8)
ctx.f1.f64 = 0.25;
}
}
void WorldMapProjectionMidAsmHook(PPCVRegister& v63, PPCVRegister& v62)
{
v63.f32[3] *= std::max(NARROW_ASPECT_RATIO, g_aspectRatio) / WIDE_ASPECT_RATIO;
v62.f32[2] *= NARROW_ASPECT_RATIO / std::min(NARROW_ASPECT_RATIO, g_aspectRatio);
}

View file

@ -628,3 +628,8 @@ registers = ["r3"]
name = "ObjGetItemFieldOfViewMidAsmHook"
address = 0x82692934
registers = ["r1", "f1"]
[[midasm_hook]]
name = "WorldMapProjectionMidAsmHook"
address = 0x82574E00
registers = ["v63", "v62"]