widescreen: cinematic letterbox bars span the render width

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
khallaandClaude Opus 5.5 committed 2026-10-14 04:56:57 +02:00
1 parent d5e3da549a
commit 4ebcac713a
2 files changed
+15

No files matched your search

+4
View File
@@ -148,4 +148,8 @@ constexpr uint32_t kGrannyOrthoPushSequences[] = {0x0040ebc9, 0x0040f5cf, 0x0040
// push 1024: the height push, the width push follows 5 bytes later. // push 1024: the height push, the width push follows 5 bytes later.
constexpr uint32_t kLabelAreaPushes[] = {0x006272f8, 0x0060e940}; constexpr uint32_t kLabelAreaPushes[] = {0x006272f8, 0x0060e940};
// Cinematic letterbox bars (UI frame 0x7587b0): quads from x = 0 to 1024.0f,
// stored as immediates.
constexpr uint32_t kLetterboxRightImmediates[] = {0x0075895d, 0x007589f0, 0x00758aa5, 0x00758b29};
} // namespace game::addr } // namespace game::addr
+11
View File
@@ -236,6 +236,16 @@ void PatchLabelArea(int width, int height) {
static_cast<int>(std::size(game::addr::kLabelAreaPushes)) * 2); static_cast<int>(std::size(game::addr::kLabelAreaPushes)) * 2);
} }
// Cinematic bars span the screen width.
void PatchLetterbox(int width) {
int patched = 0;
for (uint32_t site : game::addr::kLetterboxRightImmediates) {
patched += re::PatchInstructionDword(site, FloatBits(1024.0f), FloatBits(static_cast<float>(width)));
}
re::Log("widescreen: %d/%d letterbox immediates patched", patched,
static_cast<int>(std::size(game::addr::kLetterboxRightImmediates)));
}
} // namespace } // namespace
void ApplyRenderSize(game::DxDisplayMode& mode, HWND window) { void ApplyRenderSize(game::DxDisplayMode& mode, HWND window) {
@@ -287,6 +297,7 @@ void ApplyRenderSize(game::DxDisplayMode& mode, HWND window) {
PatchCenterImmediates(width, height); PatchCenterImmediates(width, height);
PatchGrannyOrthoPushes(width, height); PatchGrannyOrthoPushes(width, height);
PatchLabelArea(width, height); PatchLabelArea(width, height);
PatchLetterbox(width);
} }
const double scaleX = width / kOriginalWidth; const double scaleX = width / kOriginalWidth;
const double scaleY = height / kOriginalHeight; const double scaleY = height / kOriginalHeight;