From 8a7bfc5395388d84bf536a653d3d1065dd717164 Mon Sep 17 00:00:00 2001 From: John P <7864917+kirklandsig@users.noreply.github.com> Date: Thu, 19 Nov 2026 14:07:24 -0500 Subject: [PATCH] fix: restore the Halo CE and Halo 2 HUD offsets lost merging #43 Merging master-chief into #43 (after #44) resolved the conflicts in the Halo CE and Halo 2 offset headers by keeping #44's side only, so the per-player HUD's offsets and byte patterns there were dropped while the code using them stayed: master-chief stopped compiling (C2065 'OFFSET_HALO2_PF_HUD_ASPECT_LOCK' in CModule.cpp, and the HUD files). Both blocks are kept now, as the two PRs had them: - offset_halo1.h / patterns_halo1.inc: hud_calculate_point, the HUD viewport bounds and the drawing player (3); - offset_halo2.h / patterns_halo2.inc: the "HUD anchor: Centered" je and global, the drawing player, the HUD view bounds and the offset unit scale (5). Only lines are added; the values and patterns are #43's. Co-Authored-By: Claude Opus 5.5 --- lib/game/inc/1.3528.0.0/offset_halo1.h | 4 ++++ lib/game/inc/1.3528.0.0/offset_halo2.h | 7 +++++++ lib/game/inc/1.3528.0.0/patterns_halo1.inc | 9 +++++++++ lib/game/inc/1.3528.0.0/patterns_halo2.inc | 14 ++++++++++++++ 4 files changed, 34 insertions(+) diff --git a/lib/game/inc/1.3528.0.0/offset_halo1.h b/lib/game/inc/1.3528.0.0/offset_halo1.h index 9edb083..0aa7e91 100644 --- a/lib/game/inc/1.3528.0.0/offset_halo1.h +++ b/lib/game/inc/1.3528.0.0/offset_halo1.h @@ -82,3 +82,7 @@ DefOffset(OFFSET_HALO1_PV_FIRST_PERSON_MODELS, 0x2B050E8) // the renderer's firs DefOffset(OFFSET_HALO1_PF_OBJECT_HIDDEN_VIEWS, 0xAB2890) // int (int object) - views (bits 0, 1) the object is hidden in DefOffset(OFFSET_HALO1_PF_DIRECTOR_CAMERA_MODE, 0xB14EA4) // short (int local) - 0 in first person DefOffset(OFFSET_HALO1_PV_HIDDEN_OBJECT_CAMERA, 0x1B87A20) // bool on, int16 mode at +2 (2 hides), int object at +0x34 +// Per-player HUD (mcc/hud, module/entry/halo1/hud.cpp) +DefOffset(OFFSET_HALO1_PF_HUD_CALCULATE_POINT, 0xB56A58) // (player, placement, header, -, bool, float, short2* out, int mcc element) +DefOffset(OFFSET_HALO1_PV_HUD_VIEWPORT_BOUNDS, 0x29AF2F0) // int16 top, left, bottom, right of the view being drawn +DefOffset(OFFSET_HALO1_PV_HUD_DRAWING_PLAYER, 0x29AF2B8) // int16 local player whose HUD is being drawn diff --git a/lib/game/inc/1.3528.0.0/offset_halo2.h b/lib/game/inc/1.3528.0.0/offset_halo2.h index ce8f599..8ed2b12 100644 --- a/lib/game/inc/1.3528.0.0/offset_halo2.h +++ b/lib/game/inc/1.3528.0.0/offset_halo2.h @@ -81,3 +81,10 @@ DefOffset(OFFSET_HALO2_PV_FIRST_PERSON_MODELS, 0x1AB11C0) // entries*, int count DefOffset(OFFSET_HALO2_PV_MODEL_LEVELS, 0x1DC36F0) // unsigned char* detail levels, int count at +8 - the current one is the last DefOffset(OFFSET_HALO2_PF_SABER_OBJECT_SHOW, 0x69C30) // void (object*) DefOffset(OFFSET_HALO2_PF_SABER_OBJECT_HIDE, 0x69CA0) // void (object*) +// Per-player HUD (mcc/hud). With "HUD anchor: Centered" on a screen wider than 16:9, 0x954DD0 insets the whole-screen +// HUD frame to a centred 16:9 box, which 0x7E0A40 splits among the players. +DefOffset(OFFSET_HALO2_PF_HUD_ASPECT_LOCK, 0x954DF2) // je (74 3C) that skips the centred 16:9 HUD frame when the profile's aspect lock is off +DefOffset(OFFSET_HALO2_PV_HUD_ASPECT_LOCK, 0x197EE40) // bool: the profiles' LockMaxAspectRatio ("HUD anchor: Centered"), the last loaded wins +DefOffset(OFFSET_HALO2_PV_HUD_DRAWING_PLAYER, 0x165C398) // int local player whose HUD is being drawn +DefOffset(OFFSET_HALO2_PV_HUD_VIEW_BOUNDS, 0x165C298) // int16 top, left, bottom, right of that player's HUD (window bounds) +DefOffset(OFFSET_HALO2_PV_HUD_UNIT_SCALE, 0xE14F28) // float: pixels per HUD offset unit (times the element's scale) diff --git a/lib/game/inc/1.3528.0.0/patterns_halo1.inc b/lib/game/inc/1.3528.0.0/patterns_halo1.inc index ba65819..f54f4d4 100644 --- a/lib/game/inc/1.3528.0.0/patterns_halo1.inc +++ b/lib/game/inc/1.3528.0.0/patterns_halo1.inc @@ -208,4 +208,13 @@ const OffsetPatterns kHalo1Patterns[] = { {&OFFSET_HALO1_PV_HIDDEN_OBJECT_CAMERA, 0x1b87a20, Data, { Rel("40 88 35 ?? ?? ?? ?? 48 81 C3 F8 00 00 00 C6 05 ?? ?? ?? ?? 01 66 83 FF 04", 0x3, 0x7, 0x0), Rel("80 3D ?? ?? ?? ?? 00 74 ?? B8 02 00 00 00 66 39 05 ?? ?? 0D 01 75 ?? 44 39 0D", 0x2, 0x7, 0x0)}}, + {&OFFSET_HALO1_PF_HUD_CALCULATE_POINT, 0xb56a58, Code, { + At("48 8B C4 48 89 58 18 48 89 70 20 55 57 41 55 41 56", 0x0), + Rel("E8 ?? ?? ?? ?? 0F B7 45 E2 66 89 45 D2 0F B7 C3 66 03 45 4A", 0x1, 0x5, 0x0)}}, + {&OFFSET_HALO1_PV_HUD_VIEWPORT_BOUNDS, 0x29af2f0, Data, { + Rel("0F BF 05 ?? ?? ?? ?? F3 0F 59 D7 0F 5B C0 66 0F 6E C8 0F 5B C9", 0x3, 0x7, 0x0), + Rel("44 0F B7 35 ?? ?? ?? ?? 41 0F B7 F4 8A 84 04 D8 00 00 00 FE C8", 0x4, 0x8, 0x0)}}, + {&OFFSET_HALO1_PV_HUD_DRAWING_PLAYER, 0x29af2b8, Data, { + Rel("0F B7 35 ?? ?? ?? ?? B8 03 00 00 00 66 B9 04 00 66 3B F8 75", 0x3, 0x7, 0x0), + Rel("0F BF 0D ?? ?? ?? ?? 89 4D 67 48 8B C8 48 C1 E9 10 48 89 45 6F", 0x3, 0x7, 0x0)}}, }; diff --git a/lib/game/inc/1.3528.0.0/patterns_halo2.inc b/lib/game/inc/1.3528.0.0/patterns_halo2.inc index 5e7b6a9..8444359 100644 --- a/lib/game/inc/1.3528.0.0/patterns_halo2.inc +++ b/lib/game/inc/1.3528.0.0/patterns_halo2.inc @@ -153,4 +153,18 @@ const OffsetPatterns kHalo2Patterns[] = { {&OFFSET_HALO2_PF_SABER_OBJECT_HIDE, 0x69ca0, Code, { At("4C 8B C1 48 85 C9 74 58 44 8B 49 0C 41 F6 C1 01 74", 0x0), Rel("E8 ?? ?? ?? ?? 45 84 E4 0F 84 ?? ?? ?? ?? 48 8B 43 08 48 85 C0 74 ?? 48 8B 00", 0x1, 0x5, 0x0)}}, + {&OFFSET_HALO2_PF_HUD_ASPECT_LOCK, 0x954df2, Code, { + At("74 3C F3 0F 10 15 ?? ?? ?? ?? 66 0F 6E CF 66 0F 6E C3 0F 5B C9", 0x0)}}, + {&OFFSET_HALO2_PV_HUD_ASPECT_LOCK, 0x197ee40, Data, { + Rel("88 05 ?? ?? ?? ?? 48 8B 01 FF 50 60 8B 54 24 54 8B 4C 24 50", 0x2, 0x6, 0x0), + Rel("38 15 ?? ?? ?? ?? 44 0F B7 C2 74 ?? F3 0F 10 15 ?? ?? ?? ?? 66 0F 6E CF 66 0F 6E C3", 0x2, 0x6, 0x0)}}, + {&OFFSET_HALO2_PV_HUD_DRAWING_PLAYER, 0x165c398, Data, { + Rel("8B 0D ?? ?? ?? ?? F3 0F 59 C6 F3 0F 11 44 24 50 F2 0F 10 00", 0x2, 0x6, 0x0), + Rel("48 63 35 ?? ?? ?? ?? 8B CE 48 89 7C 24 60 0F 29 74 24 50 E8", 0x3, 0x7, 0x0)}}, + {&OFFSET_HALO2_PV_HUD_VIEW_BOUNDS, 0x165c298, Data, { + Rel("66 41 F7 D8 48 8B 05 ?? ?? ?? ?? 66 F7 DA 48 89 44 24 50 E8", 0x7, 0xb, 0x0), + Rel("0F BF 15 ?? ?? ?? ?? 41 8B F0 45 8B E1 44 8B DA 41 8B FA 66 0F 6E C8", 0x3, 0x7, 0x0)}}, + {&OFFSET_HALO2_PV_HUD_UNIT_SCALE, 0xe14f28, Data, { + Rel("F3 0F 11 0D ?? ?? ?? ?? 4C 8D 9C 24 A0 04 00 00 49 8B 73 18", 0x4, 0x8, 0x0), + Rel("0F 5B C0 F3 0F 59 05 ?? ?? ?? ?? F3 0F 2C C0 48 83 C4 28 C3", 0x7, 0xb, 0x0)}}, };