Skip to content
61 changes: 61 additions & 0 deletions lib/game/inc/1.3528.0.0/offset_halo1.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,64 @@ DefOffset(OFFSET_HALO1_PV_SCREEN_BOUNDS, 0x1B7D3DC) // int16 top, left, bottom,
DefOffset(OFFSET_HALO1_SCOPE_GRID_SET, 0xAC73DC) // in the scope effects' texture transforms: the view's grid place is set
DefOffset(OFFSET_HALO1_PF_FILL_RECT, 0xAC63F4) // void (short rect[4] {top, left, bottom, right}, unsigned argb)
DefOffset(OFFSET_HALO1_PV_ANNIVERSARY_SHOWN, 0x1B7AA84) // int, nonzero while Anniversary graphics are on screen (Back switches it; 0x745B0 is bool () "Classic")

// Anniversary graphics (Saber3D) with 3-4 players (module/entry/halo1/anniversary.cpp)
DefOffset(OFFSET_HALO1_PV_LOCAL_PLAYERS, 0x2EA2D90) // players globals*, int16 local player count at +0xB4
DefOffset(OFFSET_HALO1_PV_RENDER_WINDOWS, 0x2D9CADC) // the game's view windows, 0xAC each: int16 view, rect at +0x84
DefOffset(OFFSET_HALO1_PV_RENDER_CAMERAS, 0x2D9BDD4) // the players' cameras, 0x2A8 each: field of view at +0x38
DefOffset(OFFSET_HALO1_PV_WINDOW_FIELDS_OF_VIEW, 0x1B7D6E8) // float per view, from view -1
DefOffset(OFFSET_HALO1_PF_RENDER_WINDOW_CAMERA, 0xAC450C) // void (window*, camera*) - the window's camera
DefOffset(OFFSET_HALO1_PF_SABER_HAND_OVER_VIEWS, 0x89B70) // void () - each tick: views 0 and 1 to the renderer
DefOffset(OFFSET_HALO1_PF_SABER_HAND_OVER_VIEW, 0xB29268) // void (int view) - a view's camera to the renderer's
DefOffset(OFFSET_HALO1_PV_SABER_CAMERAS, 0x2B17B90) // camera*[], int count at +8
DefOffset(OFFSET_HALO1_PF_SABER_ADD_CAMERA, 0x4684C0) // int ()
DefOffset(OFFSET_HALO1_PF_SABER_DELETE_CAMERA, 0x2B1EA0) // void (camera*)
DefOffset(OFFSET_HALO1_PF_SABER_CAMERA_SET_FOV, 0x11B020) // void (camera*, float degrees)
DefOffset(OFFSET_HALO1_PV_SABER_SPLIT, 0x2E3B821) // bool, the game's: split screen
DefOffset(OFFSET_HALO1_PF_SABER_SET_SPLIT, 0x4150F0) // void (state*) - adds or drops the second camera as the above changes
DefOffset(OFFSET_HALO1_PF_SABER_SPLIT_LAYOUT, 0x415200) // void (state*, bool split) - the cameras' viewports
DefOffset(OFFSET_HALO1_PV_SABER_SPLIT_STATE, 0x2E3CCA8) // state*, split screen at +0x41
DefOffset(OFFSET_HALO1_PV_SABER_DEVICE, 0x2E3BDD8) // device*, settings* at +0x118: pixel aspect +0x1C, width +0x20, height +0x24
DefOffset(OFFSET_HALO1_PV_SABER_CONTEXT, 0x2E3BDE0) // context*, vt+0x190 copies a region
DefOffset(OFFSET_HALO1_PV_SABER_RENDERER, 0x1C33E30) // renderer*, cameras changed at +0x92
DefOffset(OFFSET_HALO1_PV_SABER_SCENE, 0x1BEA9E0) // scene*, the frame's camera list at +0xB0
DefOffset(OFFSET_HALO1_PF_SABER_PREPARE_FRAME, 0x455170) // void (scene renderer*)
DefOffset(OFFSET_HALO1_PF_SABER_BUILD_CAMERA_LIST, 0x4547E0) // (-, list*, bool split, -)
DefOffset(OFFSET_HALO1_PF_SABER_LIST_CAMERA, 0x2EA720) // int (list*, camera*, flags, split index, 12 more) - appends a copy
DefOffset(OFFSET_HALO1_PV_SABER_ZOOMED_FOV, 0x1944B70) // float, a view below this field of view is zoomed
DefOffset(OFFSET_HALO1_PF_SABER_RENDER_FRAME, 0x455A10)
DefOffset(OFFSET_HALO1_PF_SABER_COMPOSITE, 0x45E2B0) // void (int list index) - copies the view's image to its half
DefOffset(OFFSET_HALO1_PV_SABER_VIEW_IMAGES, 0x2D62890) // texture*[2], current index at 0x1B7B11C
DefOffset(OFFSET_HALO1_PV_SABER_VIEW_IMAGE_INDEX, 0x1B7B11C)
DefOffset(OFFSET_HALO1_PV_SABER_SCREEN_IMAGE, 0x2E3D0D0) // texture*, the frame's full-screen image
DefOffset(OFFSET_HALO1_PF_SABER_TEXTURE_CREATE_CHILD, 0x1F9D20) // texture* (parent*, name, width, height, -, flags)
// void (manager*, int index) - the texture manager deletes its texture `index` (texture*[] at +0x1B8): its split
// children (+0xA8, +0xB0) first, then the texture itself; a render target set's release (0x20B000) gets here
DefOffset(OFFSET_HALO1_PF_SABER_DELETE_TEXTURE, 0x1F6BF0)
DefOffset(OFFSET_HALO1_PF_SABER_CLASSIC_HUD, 0x740B0) // void () - the classic HUD over the image: views 0 and 1, then view -1
DefOffset(OFFSET_HALO1_PF_HUD_VIEW, 0xB29438) // void (int view) - the HUD's view (window, drawing player)
DefOffset(OFFSET_HALO1_PF_HUD_VIEW_DRAW, 0xBABD38) // void (int view, state*) - the view's HUD, state 0x29E07C0
DefOffset(OFFSET_HALO1_PV_HUD_VIEW_DRAW_STATE, 0x29E07C0)
DefOffset(OFFSET_HALO1_PF_HUD_VIEW_DRAW_2, 0xB31D88) // void () - then these two
DefOffset(OFFSET_HALO1_PF_HUD_VIEW_DRAW_3, 0xAC8844) // void () - skipped while 0x2EA0218 and 0x2E3B450 are set
DefOffset(OFFSET_HALO1_PV_HUD_VIEW_DRAW_3_SKIP_1, 0x2EA0218) // int
DefOffset(OFFSET_HALO1_PV_HUD_VIEW_DRAW_3_SKIP_2, 0x2E3B450) // bool
DefOffset(OFFSET_HALO1_PF_SABER_VIEW_OVERLAY, 0x4512D0) // void (-, camera*, int split index) - a view's screen effects
DefOffset(OFFSET_HALO1_SABER_VIEW_OVERLAY_RECT, 0x4513AC) // in it, its rect is set: left r11d, top r9d, right r10d, bottom eax
DefOffset(OFFSET_HALO1_PF_SABER_SYNC, 0x89F00) // void () - each frame: the game's state to the renderer
DefOffset(OFFSET_HALO1_PF_SABER_SYNC_OBJECT, 0x7D350) // void (record*) - an object's, record {int16 index, +8 body**, +0x10 second**}
DefOffset(OFFSET_HALO1_PV_RENDER_OBJECTS, 0x29E0900) // data array*, 0x7C each: object at +0x2C
DefOffset(OFFSET_HALO1_PV_DIRECTORS, 0x2D9B960) // 0xF8 each: +0xC, update at +0x10
DefOffset(OFFSET_HALO1_PF_FIRST_PERSON_DIRECTOR, 0xC5263C) // the first-person director's update
DefOffset(OFFSET_HALO1_PF_LOCAL_PLAYER_UNIT_FLAG, 0xAB16A4) // int (int local) - the local player's unit has flag 0x1D4 & 2
DefOffset(OFFSET_HALO1_PF_FIRST_PERSON_PREPARE, 0xB27510) // void () - for the HUD's view, then
DefOffset(OFFSET_HALO1_PF_FIRST_PERSON_UPDATE, 0xB275B8) // void () - its first-person weapon, for the renderer while
DefOffset(OFFSET_HALO1_PV_FIRST_PERSON_FOR_RENDERER, 0x2EA32F8) // int
DefOffset(OFFSET_HALO1_PV_FIRST_PERSON_WEAPONS, 0x1B7AA88) // int[4] per view: the object whose nodes are at 0x1C384A0, 0xD00 per view
DefOffset(OFFSET_HALO1_PV_FIRST_PERSON_ARMS, 0x1B7AA98) // int[4], nodes at 0x1C350A0
DefOffset(OFFSET_HALO1_PF_FIRST_PERSON_SYNC, 0x7AC60) // void (int object, int slot) - a view's first-person weapon or arms (the nodes of the view it's in above) to the renderer's model for (slot, object), made on first use
DefOffset(OFFSET_HALO1_FIRST_PERSON_SYNC_SLOT_LIMIT, 0x7AE64) // in it: cmp r15d, 1 / ja - a slot past 1 gets no nodes
DefOffset(OFFSET_HALO1_PV_FIRST_PERSON_MODELS, 0x2B050E8) // the renderer's first-person models: entry*, int count at +8; entry 0x20: int slot, int object, bytes +0x1C/+0x1E hidden in view 0/1 (wanted), +0x1D/+0x1F (applied)
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
47 changes: 45 additions & 2 deletions lib/game/inc/1.3528.0.0/offset_halo2.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ DefOffset(OFFSET_HALO2_PF_PLAYER_VALID, 0x6A6C80)//0x6A6C30
DefOffset(OFFSET_HALO2_PF_PLAYER_COUNT1, 0x8940CA)//0x893FDA
DefOffset(OFFSET_HALO2_PF_PLAYER_COUNT2, 0x894127)//0x894037

// The views' hand-over splits the screen only for exactly two local players (cmp eax, 2 / jne);
// splitscreen_patch4 makes it any count but one (cmp eax, 1 / je)
// The views' hand-over splits the screen only for exactly two local players (cmp eax, 2 / jne, where the call to the
// local player count returns); splitscreen_patch4 makes it any count but one (cmp eax, 1 / je)
DefOffset(OFFSET_HALO2_TWO_PLAYERS_TEST_HAND_OVER, 0x5153E)

// In the main loop's quit handling (0x679CD0): call 0x6A6320 (did this game come from a Halo 2 lobby?), then
Expand All @@ -38,3 +38,46 @@ DefOffset(OFFSET_HALO2_PV_SPLIT_MODE, 0x165C168) // int - the frame's grid mode,
DefOffset(OFFSET_HALO2_PV_SPLIT_VIEWS, 0x165C16C) // int - the frame's views
DefOffset(OFFSET_HALO2_PV_ANNIVERSARY, 0xE21280) // int, nonzero while the Anniversary renderer is up
DefOffset(OFFSET_HALO2_PV_CLASSIC_SHOWN, 0x1E8CE73) // bool, the player switched to Classic graphics

// Anniversary graphics (Saber3D) with 3-4 players (module/entry/halo2/anniversary.cpp)
DefOffset(OFFSET_HALO2_PF_CINEMATIC, 0x6F4A20) // bool () - one view (cinematics)
DefOffset(OFFSET_HALO2_PF_LOCAL_PLAYER_COUNT, 0x6A4380) // int () - a 12-byte leaf
// returns from its other "== 2" (split screen) tests (the views' hand-over's is OFFSET_HALO2_TWO_PLAYERS_TEST_HAND_OVER,
// above): the object sync, a screen effect, and three first-person effect callbacks
DefOffset(OFFSET_HALO2_TWO_PLAYERS_TEST_OBJECT_SYNC, 0x6A00C)
DefOffset(OFFSET_HALO2_TWO_PLAYERS_TEST_SCREEN_EFFECT, 0x6F40C)
DefOffset(OFFSET_HALO2_TWO_PLAYERS_TEST_FIRST_PERSON_1, 0x64004)
DefOffset(OFFSET_HALO2_TWO_PLAYERS_TEST_FIRST_PERSON_2, 0x64F4E)
DefOffset(OFFSET_HALO2_TWO_PLAYERS_TEST_FIRST_PERSON_3, 0x65559)
DefOffset(OFFSET_HALO2_PF_SABER_HAND_OVER_VIEW, 0x5F510) // void (int view, bool split) - observer camera(view) -> cams[view]
DefOffset(OFFSET_HALO2_PV_SABER_CAMERAS, 0x1E91210) // container*: camera*[] at +0x100, int count +0x108
DefOffset(OFFSET_HALO2_PF_SABER_CAMERA_SET_FOV, 0xBC560) // void (camera*, float vertical degrees) - also the projection
DefOffset(OFFSET_HALO2_PV_SABER_DEVICE, 0x1E8D418) // device*, settings* at +0x118: out w +0x10, h +0x14, pixel aspect +0x1C
DefOffset(OFFSET_HALO2_PV_SABER_CONTEXT, 0x1E8D420) // context*, ID3D11DeviceContext* at +0xD58
DefOffset(OFFSET_HALO2_PV_SABER_SCENE, 0x1A250F8) // scene*, the renderer's camera list at +0x140
DefOffset(OFFSET_HALO2_PF_SABER_BUILD_CAMERA_LIST, 0x2DDCB0) // (renderer*, list*, bool split, -)
DefOffset(OFFSET_HALO2_PF_SABER_LIST_CAMERA, 0x1C7740) // int (list*, camera*, flags, split index, 6 more) - appends a copy
DefOffset(OFFSET_HALO2_PF_SABER_RENDER_FRAME, 0x2DEC00) // void ()
DefOffset(OFFSET_HALO2_PF_SABER_COMPOSITE, 0x1D2A00) // void (texture*, bool split, int index) - a view's image to its half
DefOffset(OFFSET_HALO2_SABER_COMPOSITE_DRAW, 0x1D2C33) // in it, the quad's vertices are at rsp+0xC0 (x, y, z, -, u, v; 0x18 each)
DefOffset(OFFSET_HALO2_PF_SABER_AFTER_CAMERAS, 0x2E3F70) // void () - after the views, before the UI and HUD
DefOffset(OFFSET_HALO2_PF_SABER_HDR_PASS, 0x210BF0) // void (-, -, -, -, -, float, int hdr view, bool, ...) - a view's exposure adaptation, bloom and tonemapping
DefOffset(OFFSET_HALO2_PV_SABER_HDR_VIEWS, 0x1AB8600) // 0x4C per HDR view (4): settings, +0x3C measured luminance, +0x40 exposure, +0x44 adapted luminance, int +0x48 frames
DefOffset(OFFSET_HALO2_PV_SABER_HDR_READ_BACKS, 0x1AB8758) // texture*[4][2] - per HDR view, the luminance read back on alternate frames
// texture* (set*, name, ...9 in all) - adds a render target to a set: count at +0xC, entries at +0x10 (0x30 each:
// texture* +0, flags +8). A split target also gets "_split0" (flags 0x20000000, full width, half height - both views
// are drawn into it in turn) and, for per-view history, "_split1" (0x40000000). A texture's vtable +0xA0 is
// bool (texture*, width, height, mips, format, depth, samples, data) - no-op if unchanged, else remade; fields
// width +0x20, height +0x22, depth +0x24, format +0x26, samples +0x28 (int16), mips +0x2A (byte).
DefOffset(OFFSET_HALO2_PF_SABER_ADD_RENDER_TARGET, 0xF7750)
// void (manager*, int index) - the texture manager deletes its texture `index` (texture*[] at +0x220), children
// first, whatever the texture's reference count (+0x78); a render-target set's teardown (0xF8750) gets here
DefOffset(OFFSET_HALO2_PF_SABER_DELETE_TEXTURE, 0x1A5990)
DefOffset(OFFSET_HALO2_PF_PLAYER_VISIBLE_OBJECTS, 0x608A0) // void (int local) - the window's visible objects, as view 0's (local 0) or view 1's
DefOffset(OFFSET_HALO2_PF_OWN_UNIT_IN_FIRST_PERSON, 0x5FE80) // bool (int object, int local) - the local player's unit, in first person
DefOffset(OFFSET_HALO2_PF_FIRST_PERSON_SYNC, 0x6D0D0) // void () - players 1-2's first-person models, each hidden in the other's view
DefOffset(OFFSET_HALO2_PF_FIRST_PERSON_BUILD, 0x81BFB0) // void (int local)
DefOffset(OFFSET_HALO2_PV_FIRST_PERSON_MODELS, 0x1AB11C0) // entries*, int count at +8; 0x28 each: +8 object**, +0x1C owner, +0x20 active
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*)
Loading
Loading