diff --git a/src/game/addresses.h b/src/game/addresses.h index aab92bd..6409a08 100644 --- a/src/game/addresses.h +++ b/src/game/addresses.h @@ -78,6 +78,11 @@ constexpr uint32_t kCenterImmediates[][2] = { {0x0062b4c6, 0x0062b4e9}, {0x0062cc40, 0x0062cc50}, {0x0062dcc6, 0x0062dce1}, {0x0062e398, 0x0062e3a9}, {0x0062f967, 0x0062f96d}, {0x0062fe60, 0x0062fe7d}, {0x006315aa, 0x006315b0}, {0x00631aca, 0x00631ae7}, {0x00631c53, 0x00631c70}, + // screen positions stored for later (list at +0xce14, up to 1024 entries) + {0x0041b184, 0x0041b1a1}, {0x0041b25c, 0x0041b27e}, {0x0041b3f6, 0x0041b3e4}, + {0x0041b4d6, 0x0041b4c4}, + // floating texts (damage numbers): world -> screen, and back (sub) + {0x0041e560, 0x0041e596}, {0x0041eb07, 0x0041eaf7}, }; // cWorldView0 is allocated with `push 970F4h; call operator new` here. @@ -138,4 +143,9 @@ constexpr uint32_t kOrthoPushSequences[] = { // uses the (redirected) view width with it. constexpr uint32_t kGrannyOrthoPushSequences[] = {0x0040ebc9, 0x0040f5cf, 0x0040feff, 0x006f1ecb}; +// Screen-space labels (object names on Alt, floating texts) are packed without +// overlap into a screen-sized area (0x662300), constructed with push 768 / +// push 1024: the height push, the width push follows 5 bytes later. +constexpr uint32_t kLabelAreaPushes[] = {0x006272f8, 0x0060e940}; + } // namespace game::addr diff --git a/src/mods/widescreen.cpp b/src/mods/widescreen.cpp index 926d216..d1ce9b3 100644 --- a/src/mods/widescreen.cpp +++ b/src/mods/widescreen.cpp @@ -225,6 +225,17 @@ void PatchGrannyOrthoPushes(int width, int height) { static_cast(std::size(game::addr::kGrannyOrthoPushSequences)) * 4); } +// Labels are laid out within the screen; widen their area. +void PatchLabelArea(int width, int height) { + int patched = 0; + for (uint32_t site : game::addr::kLabelAreaPushes) { + patched += re::PatchPushImm32(site + 0, 0x300, static_cast(height)); + patched += re::PatchPushImm32(site + 5, 0x400, static_cast(width)); + } + re::Log("widescreen: %d/%d label area immediates patched", patched, + static_cast(std::size(game::addr::kLabelAreaPushes)) * 2); +} + } // namespace void ApplyRenderSize(game::DxDisplayMode& mode, HWND window) { @@ -275,6 +286,7 @@ void ApplyRenderSize(game::DxDisplayMode& mode, HWND window) { if (!g_pushesPatched) { PatchCenterImmediates(width, height); PatchGrannyOrthoPushes(width, height); + PatchLabelArea(width, height); } const double scaleX = width / kOriginalWidth; const double scaleY = height / kOriginalHeight;