Skip to content

MGS2: fix Japanese staff roll positions in the plant opening - #409

Open
elephasroseus wants to merge 4 commits into
ShizCalev:masterfrom
elephasroseus:mgs2-jp-d001p01-staffroll-position
Open

elephasroseus wants to merge 4 commits into
ShizCalev:masterfrom
elephasroseus:mgs2-jp-d001p01-staffroll-position

Conversation

@elephasroseus

Copy link
Copy Markdown
Contributor

The Japanese staff roll telop positions for the Plant chapter opening are defined in .gcx, but because they are compiled with #ifdef ENGLISH, the values are incorrect.
You can see that the position of the telop which should be displayed in the center has moved closer to the center.

vanilla fixed

A similar issue exists for the telops called from .sdt, which are fixed by this MOD.

@ShizCalev

ShizCalev commented Sep 15, 2026

Copy link
Copy Markdown
Owner

We do already have 2d_sprt.c -> GetResources() hooked in resolution_scaling_fixes to fix english titlecards that are also mispositioned. Would you mind merging both of these into a "mgs2_sprite_position_fixes" file? (and preferably merge the hook if possible)

MAKE_HOOK_MID(baseModule, "66 0F 6E F1 48 8B 4E", "MGS2: user\\shibata\\effect\\2d_sprt.c -> New2dSprite() -> GetResources() @l252 | tanker MGS2 logo", {
if (ctx.rdi != 0xA57131 || ctx.rcx != 519 || ctx.rax != 125)
{
//spdlog::info("rdi {}, rcx {}, rax {}", ctx.rdi, ctx.rcx, ctx.rax);
return;
}
if (!(MGS2_LinkVarBuf::GM_Configuration & MGS2_LinkVarBuf::GM_CONFIG_CUTSCENES_LETTERBOXED))
{
return;
}
//FULLSCREEN SETTINGS
//ctx.rcx = 519; // w
//ctx.rax = 125; // h
//*reinterpret_cast<float*>(ctx.rsp + 0x30) = 0.0f; // pos.x
//*reinterpret_cast<float*>(ctx.rsp + 0x34) = 20.0f; // pos.y
ctx.rcx = 346; // width
ctx.rax = 83; // height
*reinterpret_cast<float*>(ctx.rsp + 0x30) = 83.0f; // pos.x
*reinterpret_cast<float*>(ctx.rsp + 0x34) = 40.0f; // pos.y
});

@ShizCalev

Copy link
Copy Markdown
Owner

(0xA57131 = GV_Strcode("title_mgs2_alp_ovl"))

switch (tex)
{
// It's "sr##e", not "sr##j". That's why we need this fix.
case GameVars::GV_StrCode("sr04e_alp_ovl"):

@ShizCalev ShizCalev Sep 15, 2026

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constexpr for these please - otherwise we'll be rehashing these strings every frame

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in 9150dc1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants