Reconcile main static storage: +1 exact function, zero losses

Approved coherent packet 41640b4d, independently clean-built after transport and plane-helper reconciliation. +538 meaningful / +544 padded bytes; main 95/95. Replace the invented packed aggregate with January's separate storage, add exactly eight private symbol rows and retire the frame-rate park. Names, six static scopes and exact main_game_render placement remain disclosed as inferred. Full stable sweep, parks, admission, fake scan and 1663 tools tests pass; no new warnings, data, objects or providers. Cumulative reconciliation +5 functions, +2121 meaningful / +2144 padded bytes, zero exact losses. Preserve dirty README and unrelated research. No PCH, scorer, verifier, status or held-source changes. Detailed independent receipts and limits recorded in docs/object_matching_logs/upstream_tmp_reconcile_20261002.md.
This commit is contained in:
Jonas Volman committed 2026-10-02 00:44:12 -07:00
1 parent 38fdd8cb24
commit 09255f0e78
5 files changed
+350 -178

No files matched your search

-11
View File
@@ -917,17 +917,6 @@
"objdiff_percent": 95.241234
}
},
{
"unit": "source/main/main",
"function": "_main_frame_rate_debug",
"class": "unclassified",
"evidence": "Complete natural frame-rate diagnostic state machine retained from the 2026-09-09 Main packet. It uses the authenticated Main state, project types, and ordinary file/time APIs. The candidate is 528 padded bytes with 51 relocations versus January's 544 bytes and 52 relocations; the remaining code-generation difference is explicitly fuzzy. No barrier, volatile carrier, fake dependency, raw address, or exact-only branch is retained. Zero exact credit. See docs/object_matching_logs/main_obj_natural_state_and_render_packet_20260909.md. 2026-09-22: two January-attested corrections landed. The sample-index wrap is a SIGNED modulo in January (movsx/and 0x80000007/jns fixup), so NUMBEROF (size_t) was wrong and the divisor is a signed 8; this closed the whole 16-byte size gap and the candidate is now 544 padded bytes, exactly January's size. The slow-frame threshold literal is 0.036000000000000004 (__real@3fa26e978d4fdf3c), one ULP above the decimal 0.036 we had, so January's source folds an expression rather than writing the decimal; spelled 1.08/TICKS_PER_SECOND, which reproduces the constant exactly. The remaining residual is one duplicated framerate_sample_index load that January's jump-threading emits on the debug-true edge (51 vs 52 relocations) plus the register assignment that follows from it. 2026-09-24 (fifty-objects lane batch 4b): re-baselined after the reviewed zero-credit packet; see docs/object_matching_logs/claude_fifty_objects_20260925.md.",
"measurements": {
"target": { "size": 544, "relocation_count": 52, "normalized_sha256": "17546b1f02410f30e6fc728300d275c40d65bf6cb6a35a096a8d735f96512d83" },
"base": { "size": 544, "relocation_count": 51, "normalized_sha256": "3c132f904203944a7f5f7c3b746a7458964f073c1fc4374aba0988bb5f3db4ff" },
"objdiff_percent": 98.65385
}
},
{
"unit": "source/interface/motion_sensor",
"function": "_motion_sensor_update",
+8
View File
@@ -23099,6 +23099,14 @@
{ "file_offset": 4546085, "flags": 0, "name": "_display_vblank_deltas" },
{ "file_offset": 4546086, "flags": 0, "name": "_display_precache_progress" },
{ "file_offset": 4546088, "flags": 0, "name": "_global_screenshot_count" },
{ "file_offset": 4546096, "flags": 0, "name": "?window@?1??main_game_render@@9@9", "static": true },
{ "file_offset": 4546956, "flags": 0, "name": "?last_spf@?1??main_frame_rate_debug@@9@9", "static": true },
{ "file_offset": 4546988, "flags": 0, "name": "?bad_frame_flags@?1??main_frame_rate_debug@@9@9", "static": true },
{ "file_offset": 4546990, "flags": 0, "name": "?current_spf_index@?1??main_frame_rate_debug@@9@9", "static": true },
{ "file_offset": 4546991, "flags": 0, "name": "?wait_for_good_framerate@?1??main_frame_rate_debug@@9@9", "static": true },
{ "file_offset": 4546992, "flags": 0, "name": "?good_framerate_count@?1??main_frame_rate_debug@@9@9", "static": true },
{ "file_offset": 4546993, "flags": 0, "name": "?need_to_initialize@?1??main_frame_rate_debug@@9@9", "static": true },
{ "file_offset": 4546994, "flags": 0, "name": "?recursion_lock@?1??halt_and_catch_fire@@9@9", "static": true },
{ "file_offset": 4546995, "flags": 0, "name": "_warned_about_duplicate_triangles", "static": true },
{ "file_offset": 4546996, "flags": 0, "name": "_error_geometry_file", "static": true },
{ "file_offset": 4547000, "flags": 0, "name": "_integer_origin2d", "static": true },
@@ -0,0 +1,87 @@
# main.obj static-storage packet, 2026-10-01
Lane `claude/remaining-frontier-20260926`. Independently reconciled on canonical on 2026-10-02;
see `upstream_tmp_reconcile_20261002.md` for the fresh clean-build gate and canonical measurements.
Owner rulings Q-UP4 (measure), Q-UP5 (land as measured) and Q-UP6 (names), 2026-10-01. Donor shape:
punpckhdq/halo pull request #84 (`a5ad6b2c`, CC0), rewritten with the lane's text and checked against January.
Research record: `research/remaining_frontier_20260926/lead/upstream_punpck/cards/UP-10_main_static_storage.md`.
| Function | Meaningful bytes | Padded bytes | Relocations |
| --- | ---: | ---: | ---: |
| `_main_frame_rate_debug` | 538 | 544 | 52 |
## What changed
- `source/main/main.c`
- The packed 0x38B-byte `struct _screenshot_and_framerate_globals` (with `byte reserved002[6]` and a `pack(1)`
pragma) and its size assert are removed. January has nine separately aligned objects there.
- `short global_screenshot_count = 0;` at file scope. Three other units already declare it `extern short`, and
January's script-global table types it `_hs_type_short_integer`.
- `main_game_render`: `static struct render_window window[MAXIMUM_LOCAL_PLAYERS + 1] = { 0 };`. The function
moves up, directly after `main_get_window_count`; `screenshot_render` gets a prototype because it is now
called before its definition. The pointer local is renamed `current_window`.
- `main_frame_rate_debug`: a local enum (`NUMBER_OF_FRAME_SAMPLES = 8`, `RUNS_BEFORE_RESET = 60`), six static
locals, and the natural body: `if (need_to_initialize && !debug_frame_rate) { clear }` then
`if (debug_frame_rate) { ... }`, with direct access to the statics. The hand-threaded `sample_index` local, the
two early returns and the `(char)(... % (long)NUMBEROF(...))` casts are gone.
- `halt_and_catch_fire`: `static boolean recursion_lock = FALSE;`.
- `config/symbols.json`: eight `"static": true` rows for the January addresses of the new statics (line surgery,
directly after `_global_screenshot_count`).
- `config/parked.json`: the `_main_frame_rate_debug` park is retired.
No padding member, filler declaration or pragma is added. No compiler flag, scorer or credit rule changes.
## Evidence
| Claim | Status | Basis |
| --- | --- | --- |
| The public symbol is a `short` | proven | word-width access at +0 in ten functions of three objects; the script-global table |
| The span is nine objects, not one aggregate | proven by a controlled ablation | the same body on the packed struct is residual at all 64 C1 shifts: VC7 keeps a scalar static in a register across the two `if` statements (January's `xor dl, dl`, `mov dl, [index]`, `movsx ecx, dl`) and reloads a struct member from memory |
| Sizes, widths, signedness and `.bss` offsets (+0x6D8, +0x6E0, +0xA3C, +0xA5C, +0xA5E..+0xA62; section 0xA63) | proven | January's references and access widths; the rebuilt object has every object at January's offset |
| The 6-byte hole at +0x6DA | explained | ordinary 8-byte alignment of the array; nothing references it anywhere on the board |
| Internal linkage of the eight statics | proven | January's PDB lists no public symbol in the span |
| Explicit zero initialisers and the declaration order | measured by perturbation | without the initialisers the statics move to the front of `.bss` in name-hash order (section 0xA65) |
| Two stores of zero to the reset flag | proven | January +0x25 (before the `csmemset` call) and +0x4E |
| The values 8 and 60 | proven | 0x20-byte array, `and eax, 0x80000007` with the signed fixup, `cmp al, 0x3c` |
| `window`: name, type, function scope, local players + 1 | attested by later first-party builds | PC demo PDB 2003 (`[2]`), HCEX PDBs 2011 (`[3]`); January has five |
| `recursion_lock`: name, type, function scope | attested by a later first-party build | HCEX_Release.pdb 2011 |
| Function scope of the six frame-rate statics | INFERRED | each is referenced by this one function; the two attested neighbours are function-local; file scope gives identical bytes |
| The six frame-rate names and the two constant names | INFERRED descriptive names, not recovered Bungie names | no later build keeps the function body; every spelling gives identical bytes |
| `main_game_render` before `main_frame_rate_debug` and before `screenshot_render` | measured | `.bss` declaration order; January emits the function one sweep after `screenshot_render` (VC7 emits callee first, in repeated textual sweeps) |
| The exact line of `main_game_render` | INFERRED | PR #84's relative position, directly after `main_get_window_count` |
| `current_window` | descriptive | the attested static takes the name `window`; no PDB records the pointer local |
| The threshold spelling `1.08/TICKS_PER_SECOND` | unchanged, a disclosed choice | it folds to January's constant |
## Not part of this packet
- `scenario_paths` (a function-local static in the 2011 PDB only): untouched.
- Precompiled-header settings: untouched. January's `main.obj` function order shows the precompiled-header
pattern; that is recorded as research evidence only.
- `main`'s object admission: untouched. `main` stays NonMatching; its `.data` keeps the 2026-09-27 semantic
exception (+52).
- The lane's function order elsewhere in `main.c`, and the later-PDB local names of `main_game_render`.
This is a narrow packet approval, not a general permission for function moves or guessed globals.
## Original lane gate
Measured first in a shadow of lane HEAD `78294dd3` (checkpoint `SH_VA` against `SH_P`), then gated fresh in the
lane: `R114i_M` against `R113i_P` (incremental build, objdiff 3.3.1). Zero exact losses.
- Stable diff: gained 1 (544 padded bytes), regressions 0.
- Functions 7,479 -> 7,480 of 7,573. Code 1,601,295 -> 1,601,833 of 1,770,166 (+538 meaningful bytes).
- Data 3,311,591 / 3,922,163 and objects 396 / 468 unchanged.
- Strict section owners 7,652 -> 7,653 of 8,252.
- Parks 62 -> 61, 0 stale, 0 invalid. Admission candidates 8 -> 9 (`source/main/main` becomes an audit candidate
only; no status flip), 0 contradicted, 0 rejected.
- Tools tests 1,700 passed, 5 skipped. Fake-match scan: the same 26 inherited leads. Whitespace checks pass.
- One object differs on the whole board, `main.obj` (1 of 621). By content, three code sections differ:
`_main_frame_rate_debug` (the gain) and `_halt_and_catch_fire`, `_main_game_render`, whose relocation targets
change from `_global_screenshot_count+N` to the statics' own symbols with the same destinations. Both stay
exact. Six sections change position with identical content: `_main_game_render`, `_create_local_players` and
the latter's four assert literals. The compiler emits the moved function later, so the two swap places.
- /W3 4,082 = 4,082, no unit differs. /W4 for `main.c` 90 = 90.
- Without the eight symbol rows `main` `.bss` would score 82.94% and the progress step would fail; they are part
of the packet.
- C1 shift sweep (diagnostic only): `_main_frame_rate_debug` is exact at all 64 shifts, so the result does not
depend on a declaration count.
@@ -0,0 +1,95 @@
# Transport, plane helper and main static-storage reconciliation — 2026-10-02
Independently reconciled against canonical `5e55d8f83ad7142962946b8a023d9638cd900b69` on
`jonas/exact-pilots`. Three owner-approved coherent packets were applied separately, with a fresh
clean build and full gate after each. No whole-lane merge or unpublished research was imported.
| Packet | Donor commit | Canonical commit | Exact functions | Meaningful / padded code gain |
| --- | --- | --- | ---: | ---: |
| T, transport | `e191c0f1436939f5a98c088b1dfb46e2c336cc0d` | `25f719236d4bec7621357e89b95e02b006824727` | 2 | 457 / 464 B |
| P, plane helper | `78294dd367ca3014ddd2eda28cd5744a2ef386aa` | `38fdd8cb2431d1cc4793d40f9a4e21e81c040136` | 2 | 1,126 / 1,136 B |
| M, main storage | `41640b4db320570d38173f9620cd0eab1a0f2d0d` | this commit | 1 | 538 / 544 B |
## Exact section receipts
All five fresh canonical sections are strictly identical to their January split counterparts,
including relocation identities. The SHA-256 values below are normalized by the unchanged strict
COFF comparator, not hashes of a linked executable.
| Function | Meaningful B | Padded B | Relocations | Normalized SHA-256 |
| --- | ---: | ---: | ---: | --- |
| `_transport_initialize` | 416 | 416 | 33 | `47bd2187b394eb1f7975b4bc618fc0d041f563687eb841257fcae4296bd71db0` |
| `_poll_ep_array_compare_proc` | 41 | 48 | 0 | `10d0cbdd04c0ad15a3cd14bffdde707c085ce85c4b9fed4c036fb4c103ca9c55` |
| `_compute_ground_plane` | 334 | 336 | 14 | `edeff771d101548840cb5f3b2949765f5455b6e452e22f5f4ba90d79ca918ad2` |
| `_bsp3d_test_sphere_recursive` | 792 | 800 | 22 | `35304d9cd3dbf061092fc383fa53e18c78003d1c12cb9cddce7cf9b6e69381ed` |
| `_main_frame_rate_debug` | 538 | 544 | 52 | `17546b1f02410f30e6fc728300d275c40d65bf6cb6a35a096a8d735f96512d83` |
| Total | 2,121 | 2,144 | | |
## Source-policy scope
- T changes the return type to `long` in both the owner header and definition, consistent with
January's full-EAX return. The repeated startup stores and natural single-exit/callback form are
reconstructed from the approved evidence. No shared declaration was moved merely to steer bytes.
- P removes only the outer parentheses of the approved plane helper, preserving the `/Od` argument
order. Its coupled `_item_accelerate` repair removes the unattested double local and passes the
float expression directly in the attested order. The entire items object remains identical.
- M replaces the invented packed aggregate and six padding bytes with January's nine objects.
`window` and `recursion_lock` are later-first-party-attested function-local statics. The six
frame-rate statics' function scope, their six names, two enum identifiers, `current_window`, and
the exact textual position of `main_game_render` remain disclosed as inferred/descriptive as
narrowly approved. Explicit zero initializers reproduce declaration-order storage. The eight
private symbol rows and the exact function's park retirement are in the same commit.
- No new assembly, cast device, padding, filler, pragma, compiler flag, PCH change, scorer change,
verifier change, semantic exception or object status flip was introduced. DD2, DD3, the ai_debug
casts, pill parentheses and other held forms remain held and unchanged. `scenario_paths` is
untouched. Main remains NonMatching; 95/95 exact functions are not a whole-object admission.
## Canonical park reconciliation
The five exact entries were retired with their source changes. Four residuals affected by P were
remeasured on canonical rather than copied from the lane. Their original rejection/reopen text and
previous measurements are retained in `config/parked.json`. These receive no exact credit.
| Residual | Previous objdiff % | Fresh canonical % | Size / relocations |
| --- | ---: | ---: | ---: |
| `_render_camera_build_frustum` | 88.8082 | 90.11173 | 3,408 / 112 |
| `_bsp3d_test_pill_recursive` | 97.21691 | 98.086395 | 1,504 / 31 |
| `_convex_polygon3d_clip_to_plane` | 80.76382 | 82.37186 | 1,120 / 26 |
| `_build_structure_lens_flares` | 99.29274 | 99.198944 | 4,336 / 156 |
The lens-flare percentage decreases; its source is untouched and it was non-exact before and after.
The lane's separate unpublished fidelity rebaselines were not imported.
## Fresh canonical gates
Each packet passed: clean compile, progress, the unchanged 8,252-row strict stable sweep, parks,
object-admission audit, fake-match scan, tools tests and whitespace checks.
- Exact sweep: +2 after T, +4 after T+P, +5 after T+P+M; zero regressions at every gate.
- Halo functions: 7,475 -> 7,480 of 7,573.
- Halo meaningful code: 1,599,712 -> 1,601,833 of 1,770,166 (+2,121).
- Halo data: unchanged at 3,311,591 / 3,922,163. Halo objects: unchanged at 396 / 468.
- Strict section-owner rows: 7,648 -> 7,653 of 8,252. Main is freshly strict exact 95/95.
- Parks: 66 -> 64 -> 62 -> 61, zero stale and zero invalid.
- Admission candidates: 8 -> 9 (main added as a review candidate only); no revocation or contradiction.
- Tests at every gate: 1,663 passed, 5 skipped, 159 subtests passed. The lane's 1,700 figure is not
claimed for this canonical tree; its additional unpublished tools changes were not imported.
- Fake-match scan: the same 26 inherited review leads.
- Fresh board-wide `/W3` compiles: 4,091 before and after, identical per unit and warning code over
all 612 CL targets. Fresh `/W4` checks across the nine affected units: 603 before and after, also
identical by unit/code (including main's 90). Existing warning locations may move with source.
- All 621 configured build objects plus the inherited extra libcmt/chkstk object were fingerprinted
at every checkpoint. T changes one object; P changes five objects/six text sections; M changes
only main.obj. No external/COMMON provider attribute changes or new helper copies occur.
- M's `.bss` is 0xA63, align 8, with the public short at +0x6D8 and eight class-3 objects at +0x6E0,
+0xA3C, +0xA5C and +0xA5E..+0xA62. The halt/render relocation target names change to these statics
without changing their destinations; both functions stay exact. Function/section order changes
are confined to the approved main packet.
- All tracked production files outside the seven approved source/config paths are hash-identical
to the baseline. The existing dirty README and unrelated untracked research were preserved.
- Q10 credit and all scorer/verifier pins are unchanged: 93 records, 661,012 bytes. This is bounded
object/section verification, not proof of a complete executable link or playability.
Private full receipts are in `scratch/astra_tmp_reconcile_20261002/` (before, T, P, M gates;
warning compilations; object fingerprints; final scope/storage assertions). They include local
build artifacts and are not published. The approved production changes and this audit log are.
+160 -167
View File
@@ -636,25 +636,6 @@ struct game_options
typedef char game_options_size_assert[
sizeof(struct game_options) == 0x10C ? 1 : -1];
#pragma pack(push, 1)
struct _screenshot_and_framerate_globals
{
short count;
byte reserved002[6];
struct render_window windows[MAXIMUM_WINDOWS + 1];
real framerate_samples[8];
word framerate_flags;
char framerate_sample_index;
boolean framerate_active;
char framerate_counter;
boolean framerate_reset;
boolean halt_recursion_lock;
};
#pragma pack(pop)
typedef char screenshot_and_framerate_globals_size_assert[
sizeof(struct _screenshot_and_framerate_globals) == 0x38B ? 1 : -1];
/* ---------- prototypes */
static long sort_desired_local_player_controllers(
@@ -675,6 +656,8 @@ static void main_new_map(
struct game_options *options);
static void main_game_render(
double time_delta_since_tick_sec);
static void screenshot_render(
struct render_window *windows);
/* ---------- globals */
@@ -705,7 +688,7 @@ boolean debug_frame_rate = FALSE;
boolean display_framerate = FALSE;
boolean display_vblank_deltas = FALSE;
boolean display_precache_progress = FALSE;
struct _screenshot_and_framerate_globals global_screenshot_count = { 0 };
short global_screenshot_count = 0;
boolean debug_render_freeze;
/* ---------- public code */
@@ -1180,7 +1163,7 @@ void main_present_frame(
char path[512];
render_frame_present(NULL, main_globals.movie);
if (global_screenshot_count.count <= 0 && main_globals.movie)
if (global_screenshot_count <= 0 && main_globals.movie)
{
_snprintf(
path,
@@ -1406,6 +1389,110 @@ short main_get_window_count(
return single_window ? 1 : PIN(local_player_count(), 1, MAXIMUM_WINDOWS);
}
static void main_game_render(
double time_delta_since_tick_sec)
{
/* Name, type and function scope from the 2003 PC demo PDB and the HCEX PDB (static local
struct render_window window[local players + 1] of main_game_render: two and three elements
there, five in January). January corroborates: .bss +0x6E0, 0x35C bytes, referenced only by
this function, declared after global_screenshot_count and before main_frame_rate_debug's
statics, with an explicit zero initialiser (an uninitialised static is placed first, by name
hash). That order, and January emitting this function a sweep after screenshot_render, put
the definition before both; its exact line is inferred. */
static struct render_window window[MAXIMUM_LOCAL_PLAYERS + 1] = { 0 };
boolean force_single_screen;
long window_index;
struct render_window *current_window; /* descriptive name; no PDB records this local */
struct observer_result const *observer;
long player_window_count;
long window_count;
short last_local_player_index;
lock_global_random_seed();
collision_log_continue_period(TRUE);
sound_render();
force_single_screen = game_engine_force_single_screen();
last_local_player_index = NONE;
window_count = PIN(local_player_count(), 1, MAXIMUM_LOCAL_PLAYERS);
player_window_count = window_count;
if (force_single_screen || cinematic_in_progress())
{
window_count = 1;
player_window_count = 1;
}
for (window_index = 0; window_index < player_window_count; window_index++)
{
current_window = &window[window_index];
observer = NULL;
compute_window_bounds(
window_index,
player_window_count,
&current_window->rasterizer_camera.viewport_bounds,
&current_window->rasterizer_camera.window_bounds);
if (force_single_screen)
{
current_window->local_player_index = NONE;
}
else if (window_index < window_count)
{
if (!rasterizer_debug_options.force_all_player_views_to_default_player ||
last_local_player_index == NONE)
{
if (game_connection() == _game_connection_film_playback)
{
last_local_player_index = 0;
}
else
{
last_local_player_index = local_player_get_next(last_local_player_index);
}
}
current_window->local_player_index = last_local_player_index;
observer = observer_get_camera(current_window->local_player_index);
}
else
{
current_window->local_player_index = NONE;
}
set_window_camera_values(current_window, observer);
current_window->console_window = FALSE;
}
current_window = &window[player_window_count];
compute_window_bounds(
0,
1,
&current_window->rasterizer_camera.viewport_bounds,
&current_window->rasterizer_camera.window_bounds);
current_window->local_player_index = NONE;
current_window->console_window = TRUE;
set_window_camera_values(current_window, NULL);
if (global_screenshot_count <= 0)
{
render_frame(
window,
player_window_count + 1,
NULL,
NULL,
main_globals.movie,
(real)time_delta_since_tick_sec);
}
else
{
screenshot_render(window);
}
collision_log_end_period();
unlock_global_random_seed();
return;
}
static void main_new_map(
struct game_options *options)
{
@@ -1615,7 +1702,7 @@ void main_queue_map_name(
boolean main_taking_screenshot(
void)
{
return global_screenshot_count.count > 0 || main_globals.movie != NULL;
return global_screenshot_count > 0 || main_globals.movie != NULL;
}
void main_movie_start(
@@ -1998,69 +2085,67 @@ static void main_run_demos_private(
static void main_frame_rate_debug(
void)
{
char sample_index;
/* NUMBER_OF_FRAME_SAMPLES, RUNS_BEFORE_RESET and the six static names below are inferred
descriptive names, not recovered Bungie names: no later build keeps this function's body.
The values 8 and 60 are January's (a 0x20-byte sample array, a signed modulo by 8, a
compare with 60). So are the six objects: .bss +0xA3C..+0xA61 in this order, these types,
referenced only by this function, each with an explicit zero initialiser. Their function
scope is inferred from that and from the two attested static locals beside them. */
enum
{
NUMBER_OF_FRAME_SAMPLES = 8,
RUNS_BEFORE_RESET = 60
};
if (global_screenshot_count.framerate_reset)
static real last_spf[NUMBER_OF_FRAME_SAMPLES] = { 0 };
static word bad_frame_flags = 0;
static char current_spf_index = 0;
static boolean wait_for_good_framerate = FALSE;
static char good_framerate_count = 0;
static boolean need_to_initialize = FALSE;
if (need_to_initialize && !debug_frame_rate)
{
if (debug_frame_rate)
{
sample_index = global_screenshot_count.framerate_sample_index;
}
else
{
global_screenshot_count.framerate_reset = FALSE;
csmemset(
global_screenshot_count.framerate_samples,
0,
sizeof(global_screenshot_count.framerate_samples));
sample_index = 0;
global_screenshot_count.framerate_flags = 0;
global_screenshot_count.framerate_sample_index = sample_index;
global_screenshot_count.framerate_active = FALSE;
global_screenshot_count.framerate_counter = 0;
global_screenshot_count.framerate_reset = FALSE;
}
}
else
{
sample_index = global_screenshot_count.framerate_sample_index;
need_to_initialize = FALSE;
csmemset(last_spf, 0, sizeof(last_spf));
bad_frame_flags = 0;
current_spf_index = 0;
wait_for_good_framerate = FALSE;
good_framerate_count = 0;
need_to_initialize = FALSE; /* January stores the flag a second time here */
}
if (debug_frame_rate)
{
global_screenshot_count.framerate_samples[sample_index] =
main_globals.seconds_elapsed;
last_spf[current_spf_index] = main_globals.seconds_elapsed;
SET_FLAG(
global_screenshot_count.framerate_flags,
sample_index,
bad_frame_flags,
current_spf_index,
main_globals.seconds_elapsed > 1.08/TICKS_PER_SECOND);
sample_index++;
sample_index = (char)(sample_index % (long)NUMBEROF(global_screenshot_count.framerate_samples));
global_screenshot_count.framerate_sample_index = sample_index;
global_screenshot_count.framerate_reset = TRUE;
current_spf_index++;
current_spf_index %= NUMBER_OF_FRAME_SAMPLES;
need_to_initialize = TRUE;
if (global_screenshot_count.framerate_active)
if (wait_for_good_framerate)
{
if (global_screenshot_count.framerate_sample_index == 0)
if (current_spf_index == 0)
{
if (global_screenshot_count.framerate_flags == 0)
if (bad_frame_flags == 0)
{
if (++global_screenshot_count.framerate_counter >= 60)
if (++good_framerate_count >= RUNS_BEFORE_RESET)
{
global_screenshot_count.framerate_counter = 0;
global_screenshot_count.framerate_active = FALSE;
return;
good_framerate_count = 0;
wait_for_good_framerate = FALSE;
}
}
else
{
global_screenshot_count.framerate_counter = 0;
return;
good_framerate_count = 0;
}
}
}
else if (global_screenshot_count.framerate_flags == 0xFF)
else if (bad_frame_flags == 0xFF)
{
SYSTEMTIME system_time;
char core_name[256];
@@ -2098,7 +2183,7 @@ static void main_frame_rate_debug(
fprintf(file, ";core_load_name_at_startup %s\n", core_name);
fflush(file);
fclose(file);
global_screenshot_count.framerate_active = TRUE;
wait_for_good_framerate = TRUE;
}
}
@@ -2593,11 +2678,11 @@ static void screenshot_render(
console_close();
for (screenshot_page_index.y = 0;
screenshot_page_index.y < global_screenshot_count.count;
screenshot_page_index.y < global_screenshot_count;
screenshot_page_index.y++)
{
for (screenshot_page_index.x = 0;
screenshot_page_index.x < global_screenshot_count.count;
screenshot_page_index.x < global_screenshot_count;
screenshot_page_index.x++)
{
for (screenshot_index.y = 0;
@@ -2608,7 +2693,7 @@ static void screenshot_render(
screenshot_index.x < global_screenshot_size;
screenshot_index.x++)
{
if (global_screenshot_count.count > 1 ||
if (global_screenshot_count > 1 ||
global_screenshot_size > 1)
{
render_frame(
@@ -2643,7 +2728,7 @@ static void screenshot_render(
bitmap_delete(bitmap);
}
global_screenshot_count.count = 0;
global_screenshot_count = 0;
return;
}
@@ -2764,16 +2849,20 @@ void main_framerate_render(
void halt_and_catch_fire(
void)
{
/* Name, type and function scope from the HCEX PDB (static local unsigned char recursion_lock
of halt_and_catch_fire). January corroborates: .bss +0xA62, the last byte of the section,
referenced only by this function, explicitly zero-initialised. */
static boolean recursion_lock = FALSE;
short gamepad_index;
long font_tag_index;
struct scenario *scenario;
struct rasterizer_frame_begin_parameters frame_parameters;
struct rasterizer_window_begin_parameters window_parameters;
if (!global_screenshot_count.halt_recursion_lock)
if (!recursion_lock)
{
scenario = global_scenario_try_and_get();
global_screenshot_count.halt_recursion_lock = TRUE;
recursion_lock = TRUE;
for (gamepad_index = 0; gamepad_index < MAXIMUM_GAMEPADS; gamepad_index++)
{
if (input_has_gamepad(gamepad_index))
@@ -2895,102 +2984,6 @@ void main_loop_of_death(
return;
}
static void main_game_render(
double time_delta_since_tick_sec)
{
boolean force_single_screen;
long window_index;
struct render_window *window;
struct observer_result const *observer;
long player_window_count;
long window_count;
short last_local_player_index;
lock_global_random_seed();
collision_log_continue_period(TRUE);
sound_render();
force_single_screen = game_engine_force_single_screen();
last_local_player_index = NONE;
window_count = PIN(local_player_count(), 1, MAXIMUM_LOCAL_PLAYERS);
player_window_count = window_count;
if (force_single_screen || cinematic_in_progress())
{
window_count = 1;
player_window_count = 1;
}
for (window_index = 0; window_index < player_window_count; window_index++)
{
window = &global_screenshot_count.windows[window_index];
observer = NULL;
compute_window_bounds(
window_index,
player_window_count,
&window->rasterizer_camera.viewport_bounds,
&window->rasterizer_camera.window_bounds);
if (force_single_screen)
{
window->local_player_index = NONE;
}
else if (window_index < window_count)
{
if (!rasterizer_debug_options.force_all_player_views_to_default_player ||
last_local_player_index == NONE)
{
if (game_connection() == _game_connection_film_playback)
{
last_local_player_index = 0;
}
else
{
last_local_player_index = local_player_get_next(last_local_player_index);
}
}
window->local_player_index = last_local_player_index;
observer = observer_get_camera(window->local_player_index);
}
else
{
window->local_player_index = NONE;
}
set_window_camera_values(window, observer);
window->console_window = FALSE;
}
window = &global_screenshot_count.windows[player_window_count];
compute_window_bounds(
0,
1,
&window->rasterizer_camera.viewport_bounds,
&window->rasterizer_camera.window_bounds);
window->local_player_index = NONE;
window->console_window = TRUE;
set_window_camera_values(window, NULL);
if (global_screenshot_count.count <= 0)
{
render_frame(
global_screenshot_count.windows,
player_window_count + 1,
NULL,
NULL,
main_globals.movie,
(real)time_delta_since_tick_sec);
}
else
{
screenshot_render(global_screenshot_count.windows);
}
collision_log_end_period();
unlock_global_random_seed();
return;
}
void main_loop(
void)
{