Batch 4b: admit rasterizer_xbox_dynavobgeom; object_damage_body exact; reviewed storage packets

- rasterizer_xbox_dynavobgeom (admission, reviewer-amended): genuine shared
  declarations replace the caller-local debug-options, window and pixel-shader
  views; /Od-attested vector_from_points3d/dot_product3d calls and HCEX locals
  in the unlit draw; the HCEX function-static `warned` latch; MAX() for the
  /Od ?: store; nine D3DINLINE wrappers static per cachebeta; rejection retired.
- damage (reviewer B+): _object_damage_body exact (1360); four statics per
  cachebeta; park retired. The AOE header-helper form (patch A) stays held.
- players: January-static storage (3 rows) plus the COMMON tentative
  definitions of players_globals/team_data (January linker_common records).
- hs: 839 January-static storage flags and the /Od-attested static helper
  hs_enumerate_scenario_data replacing 11 hand expansions (reviewer-amended;
  the real_random_range cleanup stays held with the P1 class).
- hs_scenario_definitions: first-party static byte_swap_script_syntax_data.
- player_profile (HCEX profile_color_table) and main (/Od main_exit shape):
  reviewed zero-credit packets; three parks re-baselined.

Gate (full ninja, objdiff 3.3.1): Halo objects 377 -> 378; stable diff +1
strict / 1,360 padded, 0 regressions; parks 86/0/0; admission 11/0/3/0; fake
scan 26; pytest 1157 passed; diff --check clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jonas VolmanandClaude Opus 5.5 committed 2026-09-24 02:26:05 -07:00
1 parent f7cd2e722e
commit 6e3e2d35e4
11 files changed
+1615 -1847

No files matched your search

+1 -1
View File
@@ -494,7 +494,7 @@
{ "name": "source/rasterizer/xbox/rasterizer_xbox_errors.c", "index": 119, "status": "Matching" },
{ "name": "source/rasterizer/xbox/rasterizer_xbox_environment_fog.c", "index": 120, "status": "NonMatching" },
{ "name": "source/rasterizer/xbox/rasterizer_xbox_environment.c", "index": 121, "status": "NonMatching" },
{ "name": "source/rasterizer/xbox/rasterizer_xbox_dynavobgeom.c", "index": 122, "status": "NonMatching" },
{ "name": "source/rasterizer/xbox/rasterizer_xbox_dynavobgeom.c", "index": 122, "status": "Matching" },
{ "name": "source/rasterizer/xbox/rasterizer_xbox_draw_primitives.c", "index": 123, "status": "Matching" },
{ "name": "source/rasterizer/xbox/rasterizer_xbox_detail_objects.c", "index": 124, "status": "Matching" },
{ "name": "source/rasterizer/xbox/rasterizer_xbox_decals.c", "index": 125, "status": "Matching" },
-8
View File
@@ -25,14 +25,6 @@
"evidence": "docs/object_matching_logs/rasterizer_xbox_profile_obj_shared_owner_reconciliation_20260906.md#remaining-whole-object-boundaries",
"reopen": "Finish genuine shared window/API declaration ownership with full consumer regression gates and prove the complete SDK table ownership through authenticated original source topology or a successful ordinary compatible canonical link with the real dependency/import closure and call graph. Do not use partial-header facades, forced unresolved linking, altered selection metadata, fake references, or an invented discard pass. Preserve all target-function and data matches before claiming Matching."
},
{
"unit": "source/rasterizer/xbox/rasterizer_xbox_dynavobgeom",
"class": "source-layout-incomplete",
"symbol": "struct rasterizer_dynamic_geometry_debug_options",
"reason": "All 17 target functions remain strict exact and the diagnostic flag now has its authentic one-byte BSS owner instead of COMMON storage. Whole-object completion still fails source ownership: debug-options and frame-statistics globals use caller-local incomplete views with opaque spans, and the window global uses a separate partial type. The candidate also retains an extra real_alpha_to_pixel32 code owner and stock SDK data copies absent from this January split; no ordinary final-link ownership proof is claimed.",
"evidence": "docs/object_matching_logs/rasterizer_xbox_dynavobgeom_obj_bss_owner_audit_20260904.md#remaining-completion-boundary",
"reopen": "Recover the authentic shared January layouts and use their proper owning declarations, preserving existing target-function matches across all consumers. Separately establish complete helper/SDK data ownership through authentic source topology and ordinary link verification. Do not use opaque prefix facades, declaration-order steering, forced inlining, altered selection metadata, or candidate-only bytes to claim Matching."
},
{
"unit": "source/interface/hud_draw",
"class": "candidate-only-comdat-owner",
+9 -28
View File
@@ -128,11 +128,11 @@
"base": {
"size": 384,
"relocation_count": 27,
"normalized_sha256": "839937d5e05bba8840732fd3c229c8f0829b7b35c43bcf2391c459165baaf3c0"
"normalized_sha256": "bbb652e083aadc92e51e4445f93d49d41941e7c53f50cc1883658c355aa579cb"
},
"objdiff_percent": 88.40708
"objdiff_percent": 88.451324
},
"evidence": "Best currently integrated house-rule-compliant reconstruction from the 2026-09-07 PlayerProfile/S3TC reconciliation batch. Keep the genuine thread callback, mutex/file/checksum/metadata lifecycle and typed 512-byte file block, with initialized padding rather than serializing stack bytes. See docs/object_matching_logs/player_profile_s3tc_batch_reconciliation_20260907.md for donor provenance, raw-target limits, full-batch review and research pointers. Zero exact credit; retain for future evidence-driven work without source-pressure tuning."
"evidence": "Best currently integrated house-rule-compliant reconstruction from the 2026-09-07 PlayerProfile/S3TC reconciliation batch. Keep the genuine thread callback, mutex/file/checksum/metadata lifecycle and typed 512-byte file block, with initialized padding rather than serializing stack bytes. See docs/object_matching_logs/player_profile_s3tc_batch_reconciliation_20260907.md for donor provenance, raw-target limits, full-batch review and research pointers. Zero exact credit; retain for future evidence-driven work without source-pressure tuning. 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."
},
{
"unit": "source/saved games/player_profile",
@@ -930,25 +930,6 @@
"objdiff_percent": 95.47282
}
},
{
"unit": "source/objects/damage",
"function": "_object_damage_body",
"class": "unclassified",
"evidence": "Fuzzy-parked under the current house rule after reconstructing the complete body-damage stage in ordinary typed C. January COFF is the byte and ABI authority; independent HCEA source and Stian's PC lift corroborate occupied-only damage, falling-damage difficulty handling, friendly resistance, headshots, regional damage and destruction, deathless-player child traversal, body thresholds, localized and area effects, and output multipliers. The named material fields preserve the authenticated 0x48 layout and exact +0x28/+0x2C/+0x3C offsets; region flags and damage categories use genuine enum constants, and typed tag/object access macros own all subsystem retrieval. The target occupies 1360 padded / 1347 meaningful bytes with 43 relocations; the retained house-rule candidate occupies 1392 padded / 1389 meaningful bytes with 44 relocations and objdiff reports 88.00236 percent similarity. The extra lookup/relocation is the honest typed unit_get boundary after a generic child object type check. Fable's 1360-byte 98.31-percent probe used a repeated raw object_get downcast to unit_datum; it is explicitly rejected under the typed-access house rule and receives no exact credit. The separately reconstructed private helpers damage_effect_new_at_location and object_destroy_region are strict exact under their exact-tier symbol aliases. No fake matching, raw offset, false prototype, volatile/register forcing, barrier, optimizer pragma, assembly, undefined behavior, nonsensical branch, or fake context is retained. Reopen for authoritative January source/local records or a natural owner-safe accessor arrangement that improves code generation without violating typed access.",
"measurements": {
"target": {
"size": 1360,
"relocation_count": 43,
"normalized_sha256": "15116626eee783a53894c24ec0e9cb3cf2ad2a5734d7c3de99a15e2df4aa460e"
},
"base": {
"size": 1392,
"relocation_count": 44,
"normalized_sha256": "9e29dfe9abf1237a6bea6282926123f9fa15d7140977f2cfa1dedd6c68960412"
},
"objdiff_percent": 88.00236
}
},
{
"unit": "source/physics/collision_bsp",
"function": "_collision_surface_test_sphere",
@@ -1235,22 +1216,22 @@
"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.",
"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": "c2c8fd8f775a01fc893be42b6223733665e2bf7845312f06a1725aa626af419b" },
"objdiff_percent": 94.51923
"base": { "size": 544, "relocation_count": 51, "normalized_sha256": "3c132f904203944a7f5f7c3b746a7458964f073c1fc4374aba0988bb5f3db4ff" },
"objdiff_percent": 98.65385
}
},
{
"unit": "source/main/main",
"function": "_main_update_time",
"class": "unclassified",
"evidence": "Complete natural Main timing and vblank-throttle reconstruction retained from the 2026-09-09 packet. It uses named fields in the authenticated rasterizer/Main state and the genuine profiler APIs. Target and candidate are both 1,440 padded bytes, but January has 117 relocations and the candidate has 118 with different normalized code. The rejected compiler-barrier experiment is not retained. Zero exact credit. See docs/object_matching_logs/main_obj_natural_state_and_render_packet_20260909.md.",
"evidence": "Complete natural Main timing and vblank-throttle reconstruction retained from the 2026-09-09 packet. It uses named fields in the authenticated rasterizer/Main state and the genuine profiler APIs. Target and candidate are both 1,440 padded bytes, but January has 117 relocations and the candidate has 118 with different normalized code. The rejected compiler-barrier experiment is not retained. Zero exact credit. See docs/object_matching_logs/main_obj_natural_state_and_render_packet_20260909.md. 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": 1440, "relocation_count": 117, "normalized_sha256": "b32677fb6c4cc6bcd664b98bfc5cc962b68bdf65228a31759b52574becdf200b" },
"base": { "size": 1440, "relocation_count": 118, "normalized_sha256": "f4d7bb79a5351f50f1d0000d2b51234c1eb7d2abc44116032c537fd5f47cf3f1" },
"objdiff_percent": 62.637814
"base": { "size": 1440, "relocation_count": 117, "normalized_sha256": "ad56536c5eb119b981a9d0b89feb8bc57be3d72a21b4fcdfac4b4939db97ccdc" },
"objdiff_percent": 98.986336
}
},
{
+883 -883
View File
File diff suppressed because it is too large. Load diff
+4 -4
View File
@@ -427,9 +427,10 @@ static void player_teleport_on_bsp_switch(
/* ---------- globals */
struct players_globals *players_globals;
struct data_array *team_data;
struct data_array *player_data;
extern struct data_array *team_data;
long machine_to_player_table[MAXIMUM_NETWORK_MACHINE_COUNT][MAXIMUM_LOCAL_PLAYERS] = { 0 };
static long machine_to_player_table[MAXIMUM_NETWORK_MACHINE_COUNT][MAXIMUM_LOCAL_PLAYERS] = { 0 };
static boolean players_lost_map_started = FALSE;
static short over_shield_screen_flash_fade_function = 0;
static real over_shield_screen_flash_alpha = 0.f;
@@ -437,9 +438,8 @@ static real over_shield_screen_flash_green = 0.f;
static short active_camo_screen_flash_fade_function = 0;
static real active_camo_screen_flash_alpha = 0.f;
static real active_camo_screen_flash_blue = 0.f;
extern short player_spawn_count;
boolean debug_render_player_teleport = FALSE;
struct players_static_data players_static_data =
static struct players_static_data players_static_data =
{
{ "players_update_before_game", NONE, TRUE },
{ "players_update_after_game", NONE, TRUE },
+545 -644
View File
File diff suppressed because it is too large. Load diff
+7 -7
View File
@@ -3,7 +3,7 @@ HS_SCENARIO_DEFINITIONS.C
symbols in this file:
000BD310 00e0:
_code_000bd310 (0000)
_byte_swap_script_syntax_data (0000)
0026F0D0 001a:
??_C@_0BK@HCHIMFOO@hs_string_data_definition?$AA@ (0000)
0026F0EC 001a:
@@ -114,10 +114,10 @@ struct hs_source_files_definition
extern char *hs_script_type_names[];
extern char *hs_type_names[];
void hs_syntax_data_byte_swap(
static void byte_swap_script_syntax_data(
void *owner,
void *data,
long data_size);
long size);
/* ---------- globals */
@@ -289,7 +289,7 @@ __declspec(align(4)) struct tag_data_definition hs_syntax_data_definition =
"hs_syntax_data_definition",
0,
380076,
hs_syntax_data_byte_swap,
byte_swap_script_syntax_data,
};
__declspec(align(4)) struct tag_data_definition hs_string_data_definition =
@@ -302,7 +302,9 @@ __declspec(align(4)) struct tag_data_definition hs_string_data_definition =
/* ---------- public code */
void hs_syntax_data_byte_swap(
/* ---------- private code */
static void byte_swap_script_syntax_data(
void *owner,
void *data,
long size)
@@ -337,5 +339,3 @@ void hs_syntax_data_byte_swap(
return;
}
/* ---------- private code */
+109 -158
View File
@@ -363,6 +363,7 @@ symbols in this file:
#include "bitmaps/bitmaps_internal.h"
#include "bitmaps/tiff_file.h"
#include "interface/hud.h"
#include "interface/attract_mode.h"
#include "interface/interface.h"
#include "interface/terminal.h"
#include "saved games/player_profile.h"
@@ -666,29 +667,26 @@ typedef char screenshot_and_framerate_globals_size_assert[
/* ---------- prototypes */
long sort_controllers_ascending(
static long sort_controllers_ascending(
short const *a,
short const *b);
extern void main_setup_connection(
static void main_setup_connection(
void);
extern void main_initialize_time(void);
extern void main_skip_private(void);
extern void main_update_time(
static void main_initialize_time(
void);
static void main_skip_private(
void);
static void main_update_time(
void);
static void main_frame_rate_debug(
void);
extern void main_new_map(
static void main_new_map(
struct game_options *options);
extern void scripted_camera_set(
word camera_point_index0,
word camera_point_index1,
long transition_time);
extern struct bitmap_data *bitmap_2d_new(
short width,
short height,
short mipmap_count,
short format);
extern struct main_hud_globals_definition *hud_globals;
/* ---------- globals */
@@ -760,7 +758,7 @@ boolean gamepad_button_is_down(
return result;
}
void create_local_players(
static void create_local_players(
void)
{
short used_controllers[MAXIMUM_GAMEPADS];
@@ -1061,7 +1059,7 @@ void main_goto_main_menu(
return;
}
void main_queue_map_private(
static void main_queue_map_private(
void)
{
real progress;
@@ -1421,7 +1419,7 @@ short main_get_window_count(
return single_window ? 1 : PIN(local_player_count(), 1, MAXIMUM_WINDOWS);
}
void main_new_map(
static void main_new_map(
struct game_options *options)
{
input_flush();
@@ -1465,7 +1463,7 @@ void main_new_map(
return;
}
void main_change_map_name(
static void main_change_map_name(
void)
{
if (main_globals.main_menu_scenario_loaded == TRUE)
@@ -1551,7 +1549,7 @@ void main_set_difficulty(
return;
}
long sort_controllers_ascending(
static long sort_controllers_ascending(
short const *a,
short const *b)
{
@@ -1779,9 +1777,6 @@ void main_load_ui_scenario(
return;
}
extern void game_end_credits_start(
void);
void main_roll_credits(
void)
{
@@ -1829,7 +1824,7 @@ void main_pregame_render(
return;
}
void main_revert_map_private(
static void main_revert_map_private(
void)
{
game_state_revert();
@@ -1838,7 +1833,7 @@ void main_revert_map_private(
return;
}
void main_skip_cinematic_private(
static void main_skip_cinematic_private(
void)
{
if (cinematic_can_be_skipped())
@@ -1851,7 +1846,7 @@ void main_skip_cinematic_private(
return;
}
void main_skip_private(
static void main_skip_private(
void)
{
if (main_globals.skip_ticks && cinematic_in_progress())
@@ -1876,7 +1871,7 @@ void main_skip_private(
return;
}
void main_saving_map_private(
static void main_saving_map_private(
void)
{
game_state_save();
@@ -1885,7 +1880,7 @@ void main_saving_map_private(
return;
}
void main_save_map_private(
static void main_save_map_private(
void)
{
if (!game_time_get_paused())
@@ -1935,7 +1930,7 @@ void main_save_map_private(
return;
}
void main_switch_to_structure_bsp_private(
static void main_switch_to_structure_bsp_private(
void)
{
scenario_switch_structure_bsp(main_globals.switch_to_structure_bsp_index);
@@ -1944,7 +1939,7 @@ void main_switch_to_structure_bsp_private(
return;
}
void main_lost_map_private(
static void main_lost_map_private(
void)
{
if (!game_time_get_paused())
@@ -1959,7 +1954,7 @@ void main_lost_map_private(
return;
}
void main_respawn_private(
static void main_respawn_private(
void)
{
if (!game_time_get_paused() && !cinematic_in_progress())
@@ -1973,7 +1968,7 @@ void main_respawn_private(
return;
}
void main_load_core_private(
static void main_load_core_private(
void)
{
game_state_load_core(main_globals.core_name);
@@ -1981,7 +1976,7 @@ void main_load_core_private(
return;
}
void main_save_core_private(
static void main_save_core_private(
void)
{
game_state_save_core(main_globals.core_name);
@@ -1989,7 +1984,7 @@ void main_save_core_private(
return;
}
void main_run_demos_private(
static void main_run_demos_private(
void)
{
main_globals.run_xdemos = FALSE;
@@ -2037,8 +2032,8 @@ static void main_frame_rate_debug(
sample_index,
main_globals.seconds_elapsed > 1.08/TICKS_PER_SECOND);
sample_index = (char)(
(sample_index + 1) % (long)NUMBEROF(global_screenshot_count.framerate_samples));
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;
@@ -2107,7 +2102,7 @@ static void main_frame_rate_debug(
return;
}
void main_won_map_private(
static void main_won_map_private(
void)
{
short level;
@@ -2135,7 +2130,7 @@ void main_set_map_name(
return;
}
void main_exit(
static void main_exit(
void)
{
switch (main_globals.connection)
@@ -2143,24 +2138,21 @@ void main_exit(
case _game_connection_network_server:
dispose_global_network_game_client();
dispose_global_network_game_server();
game_dispose_from_old_map();
game_dispose();
debug_keys_dispose();
console_dispose();
break;
case _game_connection_network_client:
dispose_global_network_game_client();
default:
game_dispose_from_old_map();
game_dispose();
debug_keys_dispose();
console_dispose();
break;
}
game_dispose_from_old_map();
game_dispose();
debug_keys_dispose();
console_dispose();
return;
}
void main_reset_time(
static void main_reset_time(
void)
{
main_globals.frame_start_milliseconds = system_milliseconds();
@@ -2168,13 +2160,13 @@ void main_reset_time(
return;
}
boolean main_framerate_throttle_enabled(
static boolean main_framerate_throttle_enabled(
void)
{
return rasterizer_globals.framerate_throttle;
}
void main_update_time(
static void main_update_time(
void)
{
unsigned long end_milliseconds;
@@ -2185,25 +2177,24 @@ void main_update_time(
short slot;
boolean framerate_throttle;
__int64 target_index;
__int64 short_target_index;
__int64 minimum_target_index;
short short_target_index;
real seconds_elapsed;
end_milliseconds = system_milliseconds();
target_index = MAX(
minimum_target_index = MAX(
main_globals.rasterizer_target_index,
main_globals.rasterizer_throttle_end_index);
framerate_throttle = rasterizer_globals.framerate_throttle;
target_index = minimum_target_index;
framerate_throttle = main_framerate_throttle_enabled();
if (framerate_throttle)
{
csstrcpy(main_globals.vblank_debug_string, "");
if (global_frame_rate_throttle && rasterizer_globals.framerate_throttle_target >= 0)
{
requested_rate = rasterizer_globals.framerate_throttle_target;
if (requested_rate == 0)
requested_rate = 30;
selected_interval = (short)(60 / requested_rate);
selected_interval = (short)(
60 / (rasterizer_globals.framerate_throttle_target ? rasterizer_globals.framerate_throttle_target : 30));
main_globals.vblank_interval_requested = selected_interval;
if (rasterizer_globals.framerate_throttle_debug)
@@ -2212,8 +2203,6 @@ void main_update_time(
short current_interval;
elapsed_game_ticks = game_time_get_elapsed();
short_target_index = (short)target_index;
best_interval = 5;
_snprintf(
main_globals.vblank_debug_string + csstrlen(main_globals.vblank_debug_string),
@@ -2226,6 +2215,8 @@ void main_update_time(
elapsed_game_ticks,
main_globals.vblank_interval_current);
best_interval = 5;
short_target_index = (short)minimum_target_index;
for (slot = 5; slot > 0; slot--)
{
short displayed_failure_count;
@@ -2236,10 +2227,10 @@ void main_update_time(
__int64 last_failure_index;
__int64 target_age_raw;
displayed_failure_count = main_globals.vblank_failure_counts[slot];
if (displayed_failure_count > 99)
displayed_failure_count = 99;
ignore_failure = FALSE;
displayed_failure_count = main_globals.vblank_failure_counts[slot];
if (displayed_failure_count >= 99)
displayed_failure_count = 99;
last_failure_index = main_globals.vblank_last_failure_indices[slot];
target_age_raw = short_target_index - last_failure_index;
@@ -2251,51 +2242,35 @@ void main_update_time(
slot_bucket = (short)((slot + 1) / 2);
current_interval = main_globals.vblank_interval_current;
if ((short)((current_interval + 1) / 2) > slot_bucket &&
slot_bucket >= (short)(current_interval / 2) &&
(short)(current_interval / 2) <= slot_bucket &&
elapsed_game_ticks > slot_bucket)
{
ignore_failure = TRUE;
}
if (main_globals.rasterizer_throttle_start_index >=
if (main_globals.rasterizer_throttle_start_index >
main_globals.rasterizer_initial_index + slot)
{
if (ignore_failure)
{
label = "ignor";
}
else
if (!ignore_failure)
{
long failure_count;
failure_count = main_globals.vblank_failure_counts[slot];
main_globals.vblank_failure_counts[slot] =
(short)(failure_count + 1);
main_globals.vblank_last_failure_indices[slot] = target_index;
label = "fail ";
main_globals.vblank_last_failure_indices[slot] = minimum_target_index;
}
_snprintf(
main_globals.vblank_debug_string + csstrlen(main_globals.vblank_debug_string),
sizeof(main_globals.vblank_debug_string) - csstrlen(main_globals.vblank_debug_string),
"(%s%2d) ",
label,
ignore_failure ? "ignor" : "fail ",
displayed_failure_count);
}
else
{
if (target_index < last_failure_index + 15)
{
label = main_globals.vblank_failure_counts[slot] < 4 ? "wt" : "dn";
_snprintf(
main_globals.vblank_debug_string + csstrlen(main_globals.vblank_debug_string),
sizeof(main_globals.vblank_debug_string) - csstrlen(main_globals.vblank_debug_string),
"(%s%2d/%2d) ",
label,
displayed_failure_count,
target_age);
}
else
if (minimum_target_index >= last_failure_index + 15)
{
main_globals.vblank_failure_counts[slot] = 0;
_snprintf(
@@ -2304,9 +2279,20 @@ void main_update_time(
"(ok %2d) ",
target_age);
}
else
{
label = main_globals.vblank_failure_counts[slot] >= 4 ? "dn" : "wt";
_snprintf(
main_globals.vblank_debug_string + csstrlen(main_globals.vblank_debug_string),
sizeof(main_globals.vblank_debug_string) - csstrlen(main_globals.vblank_debug_string),
"(%s%2d/%2d) ",
label,
displayed_failure_count,
target_age);
}
}
if (main_globals.vblank_interval_requested <= slot &&
if (slot >= main_globals.vblank_interval_requested &&
main_globals.vblank_failure_counts[slot] < 4)
{
best_interval = slot;
@@ -2318,27 +2304,42 @@ void main_update_time(
else
requested_rate = (short)(60 / best_interval);
_snprintf(
main_globals.vblank_debug_string + csstrlen(main_globals.vblank_debug_string),
sizeof(main_globals.vblank_debug_string) - csstrlen(main_globals.vblank_debug_string),
main_globals.vblank_interval_current < best_interval
? " FAILDOWN %d"
: best_interval < main_globals.vblank_interval_current
? " RESTORE %d"
: " MAINTAIN %d",
requested_rate);
if (main_globals.vblank_interval_current < best_interval)
{
_snprintf(
main_globals.vblank_debug_string + csstrlen(main_globals.vblank_debug_string),
sizeof(main_globals.vblank_debug_string) - csstrlen(main_globals.vblank_debug_string),
" FAILDOWN %d",
requested_rate);
}
else if (best_interval < main_globals.vblank_interval_current)
{
_snprintf(
main_globals.vblank_debug_string + csstrlen(main_globals.vblank_debug_string),
sizeof(main_globals.vblank_debug_string) - csstrlen(main_globals.vblank_debug_string),
" RESTORE %d",
requested_rate);
}
else
{
_snprintf(
main_globals.vblank_debug_string + csstrlen(main_globals.vblank_debug_string),
sizeof(main_globals.vblank_debug_string) - csstrlen(main_globals.vblank_debug_string),
" MAINTAIN %d",
requested_rate);
}
_snprintf(
main_globals.vblank_debug_string + csstrlen(main_globals.vblank_debug_string),
sizeof(main_globals.vblank_debug_string) - csstrlen(main_globals.vblank_debug_string),
" des %d targ%6I64d",
requested_rate,
target_index + best_interval);
best_interval,
minimum_target_index + best_interval);
selected_interval = best_interval;
}
target_index += selected_interval;
main_globals.vblank_interval_current = selected_interval;
target_index += selected_interval;
}
}
else
@@ -2360,7 +2361,7 @@ void main_update_time(
}
end_milliseconds = system_milliseconds();
if (target_index < (__int64)rasterizer_globals.frame_and_vertical_blank_index)
if ((__int64)rasterizer_globals.frame_and_vertical_blank_index > target_index)
target_index = (__int64)rasterizer_globals.frame_and_vertical_blank_index;
if (framerate_throttle)
@@ -2485,7 +2486,7 @@ void main_rasterizer_throttle(
return;
}
void main_setup_connection(
static void main_setup_connection(
void)
{
struct game_options options;
@@ -2524,7 +2525,7 @@ void main_setup_connection(
return;
}
void main_initialize_time(
static void main_initialize_time(
void)
{
main_globals.frame_start_milliseconds = system_milliseconds();
@@ -2988,7 +2989,6 @@ void main_loop(
void)
{
boolean render_frame;
real precache_progress;
long connection;
if (!game_in_editor())
@@ -3014,19 +3014,12 @@ void main_loop(
{
if (main_globals.switch_to_structure_bsp_index!=NONE)
{
scenario_switch_structure_bsp(main_globals.switch_to_structure_bsp_index);
main_globals.switch_to_structure_bsp_index = NONE;
hud_load(FALSE);
main_switch_to_structure_bsp_private();
}
if (main_globals.lost_map)
{
if (!game_time_get_paused() && main_globals.loss_timer++>90)
{
main_globals.lost_map = FALSE;
main_globals.loss_timer = 0;
game_state_revert();
}
main_lost_map_private();
}
if (main_globals.won_map)
@@ -3036,18 +3029,12 @@ void main_loop(
if (main_globals.respawn)
{
if (!game_time_get_paused() && !cinematic_in_progress() && main_globals.respawn_timer++>90 && players_respawn_coop())
{
main_globals.respawn = FALSE;
main_globals.respawn_timer = 0;
}
main_respawn_private();
}
if (main_globals.save_map_completed)
{
game_state_save();
hud_autosave(FALSE);
main_globals.save_map_completed = FALSE;
main_saving_map_private();
}
if (main_globals.defer_map_change)
@@ -3057,21 +3044,12 @@ void main_loop(
if (main_globals.revert_map)
{
game_state_revert();
ui_widgets_disable_pause_game(30);
main_globals.revert_map = FALSE;
main_revert_map_private();
}
if (main_globals.skip_cinematic)
{
if (cinematic_can_be_skipped())
{
game_state_revert();
ui_widgets_disable_pause_game(30);
main_globals.revert_map = FALSE;
}
main_globals.skip_cinematic = FALSE;
main_skip_cinematic_private();
}
if (main_globals.reset_map)
@@ -3081,14 +3059,12 @@ void main_loop(
if (main_globals.save_core)
{
game_state_save_core(main_globals.core_name);
main_globals.save_core = FALSE;
main_save_core_private();
}
if (main_globals.load_core)
{
game_state_load_core(main_globals.core_name);
main_globals.load_core = FALSE;
main_load_core_private();
}
if (main_globals.want_to_be_at_main_menu)
@@ -3103,8 +3079,7 @@ void main_loop(
if (main_globals.run_xdemos)
{
main_globals.run_xdemos = FALSE;
xbox_demos_launch();
main_run_demos_private();
}
if (main_globals.skip)
@@ -3114,16 +3089,7 @@ void main_loop(
if (main_globals.queue_map)
{
if (cache_files_precache_in_progress() && cache_files_precache_map_status(&precache_progress)==1)
{
cache_files_precache_map_end();
}
if (!cache_files_precache_in_progress())
{
cache_files_precache_map_begin(main_globals.queued_map_name, FALSE);
main_globals.queue_map = FALSE;
}
main_queue_map_private();
}
}
else if (main_globals.reset_map)
@@ -3258,22 +3224,7 @@ void main_loop(
}
error(_error_silent, "end of saved film");
switch (main_globals.connection)
{
case _game_connection_network_server:
dispose_global_network_game_client();
dispose_global_network_game_server();
break;
case _game_connection_network_client:
dispose_global_network_game_client();
break;
}
game_dispose_from_old_map();
game_dispose();
debug_keys_dispose();
console_dispose();
main_exit();
return;
}
+17 -14
View File
@@ -340,7 +340,7 @@ boolean unit_unsuspecting(
static void object_permutation_shield_regions(
long object_index,
boolean active);
void area_of_effect_cause_damage_to_object(
static void area_of_effect_cause_damage_to_object(
struct damage_data *damage,
long object_index,
boolean damage_next_object);
@@ -365,7 +365,7 @@ static void object_destroy_region(
extern boolean debug_damage;
struct damage_globals damage_globals = { 0 };
static struct damage_globals damage_globals = { 0 };
/* ---------- public code */
@@ -585,7 +585,7 @@ void object_deplete_body(
return;
}
void object_destroy_notify_children(
static void object_destroy_notify_children(
long object_index)
{
struct object_datum *object = object_get(object_index);
@@ -1111,7 +1111,7 @@ static void object_damage_aftermath(
return;
}
void object_damage_body(
static void object_damage_body(
long object_index,
short region_index,
short node_index,
@@ -1208,11 +1208,10 @@ void object_damage_body(
&damage_resistance->regions,
region_index,
struct damage_region);
byte region_damage = (byte)(actual_damage*255.f + object->object.region_damage[region_index]);
object->object.region_damage[region_index] = region_damage;
object->object.region_damage[region_index] = (byte)(actual_damage*255.f + object->object.region_damage[region_index]);
if (region->damage_threshold > 0.f &&
region_damage*(1.f/255.f) > region->damage_threshold)
object->object.region_damage[region_index]*(1.f/255.f) > region->damage_threshold)
{
object_destroy_region(object_index, region_index);
SET_FLAG(*being_damaged_flags, _object_being_damaged_region_destroyed_bit, TRUE);
@@ -1239,16 +1238,20 @@ void object_damage_body(
while (child_object_index != NONE)
{
struct object_datum *child = object_get(child_object_index);
struct object_datum *child_object = object_get(child_object_index);
if (TEST_FLAG(_object_mask_unit, child->object.type) &&
unit_get(child_object_index)->unit.player_index != NONE)
if (TEST_FLAG(_object_mask_unit, child_object->object.type))
{
player_controlled = TRUE;
break;
struct unit_datum *child_unit = (struct unit_datum *)child_object;
if (child_unit->unit.player_index != NONE)
{
player_controlled = TRUE;
break;
}
}
child_object_index = child->object.next_object_index;
child_object_index = child_object->object.next_object_index;
}
}
@@ -2187,7 +2190,7 @@ static void object_destroy_region(
return;
}
void area_of_effect_cause_damage_to_object(
static void area_of_effect_cause_damage_to_object(
struct damage_data *damage,
long object_index,
boolean damage_next_object)
@@ -63,7 +63,7 @@ symbols in this file:
0028FDD4 0013:
??_C@_0BD@LBFDNODJ@parameters?9?$DOmap?$FL0?$FN?$AA@ (0000)
00465A16 0001:
_reported_too_many_transparent_geometry_groups (0000)
?warned@?1??_rasterizer_dynamic_unlit_geometry_draw@@9@9 (0000)
*/
/* ---------- headers */
@@ -74,7 +74,9 @@ symbols in this file:
#include "interface/hud_draw.h"
#include "bitmaps/bitmaps_inlines.h"
#include "rasterizer.h"
#include "rasterizer/rasterizer_debug_options.h"
#include "rasterizer/rasterizer_frame_statistics.h"
#include "rasterizer/rasterizer_model_types.h"
#include "rasterizer/rasterizer_transparent_geometry.h"
#include "render/render_cameras.h"
#include "shaders/shader_definitions.h"
@@ -86,6 +88,7 @@ symbols in this file:
#include "rasterizer_xbox.h"
#include "rasterizer_xbox_dynavobgeom.h"
#include "rasterizer_xbox_pixel_shader.h"
/* ---------- constants */
@@ -99,6 +102,11 @@ enum
_shader_type_effect = 1,
};
enum
{
_render_model_effect_type_none = 0,
};
enum
{
_shader_effect_sort_bias_bit = 0,
@@ -106,7 +114,7 @@ enum
enum
{
_rasterizer_statistics_mode_enabled = 2,
_rasterizer_statistics_mode_geometry = 2,
};
enum
@@ -149,17 +157,11 @@ enum
#define SHADER_EFFECT_SORT_BIAS 0.25f
#define SHADER_GET_EFFECT(shader) \
((struct shader_effect_sort_bias_prefix *)shader_get_and_verify_type( \
((struct shader_effect_definition *)shader_get_and_verify_type( \
(struct shader *)(shader), _shader_type_effect))
/* ---------- structures */
struct shader_effect_sort_bias_prefix
{
struct shader shader;
word flags;
};
struct transparent_geometry_group
{
unsigned long geometry_flags;
@@ -168,8 +170,7 @@ struct transparent_geometry_group
struct shader *shader;
short shader_permutation_index;
short pad12;
short effect_type;
byte reserved16[0x26];
struct render_model_effect effect;
real_vector2d model_base_map_scale;
long dynamic_triangle_buffer_index;
struct triangle_buffer const *triangle_buffer;
@@ -206,17 +207,6 @@ typedef char transparent_geometry_group_plane_offset_assert[
typedef char transparent_geometry_group_cortana_hack_offset_assert[
offsetof(struct transparent_geometry_group, cortana_hack) == 0x9D ? 1 : -1];
struct rasterizer_dynamic_geometry_debug_options
{
byte reserved00[2];
short statistics_mode;
byte reserved04[0x1C];
boolean draw_dynamic_unlit_geometry;
boolean draw_dynamic_lit_geometry;
boolean draw_dynamic_screen_geometry;
byte reserved23;
};
struct rasterizer_meter_parameters
{
pixel32 gradient_min_color;
@@ -230,47 +220,6 @@ struct rasterizer_meter_parameters
real gradient;
};
struct pixel_shader_definition
{
unsigned long alpha_inputs[8];
unsigned long final_combiner_inputs_abcd;
unsigned long final_combiner_inputs_efg;
unsigned long constant_0[8];
unsigned long constant_1[8];
unsigned long alpha_outputs[8];
unsigned long rgb_inputs[8];
unsigned long compare_mode;
unsigned long final_combiner_constant_0;
unsigned long final_combiner_constant_1;
unsigned long rgb_outputs[8];
unsigned long combiner_count;
unsigned long texture_modes;
unsigned long dot_mapping;
unsigned long input_texture;
unsigned long c0_mapping;
unsigned long c1_mapping;
unsigned long final_combiner_constants;
};
typedef char rasterizer_dynamic_geometry_pixel_shader_size_assert[
sizeof(struct pixel_shader_definition) == 0xF0 ? 1 : -1];
struct rasterizer_dynamic_geometry_window_parameters
{
short rasterizer_target;
short window_index;
boolean has_mirror;
boolean suppress_clear;
byte pad06[2];
struct render_camera camera;
};
typedef char rasterizer_dynamic_geometry_viewport_bounds_offset_assert[
offsetof(struct rasterizer_dynamic_geometry_window_parameters, camera.viewport_bounds) == 0x34 ? 1 : -1];
typedef char rasterizer_dynamic_geometry_camera_offset_assert[
offsetof(struct rasterizer_dynamic_geometry_window_parameters, camera) == 0x8 ? 1 : -1];
/* ---------- prototypes */
static void rasterizer_screen_geometry_submit_vertex(
@@ -278,10 +227,7 @@ static void rasterizer_screen_geometry_submit_vertex(
/* ---------- globals */
extern struct rasterizer_dynamic_geometry_debug_options rasterizer_debug_options;
extern struct rasterizer_dynamic_geometry_window_parameters global_window_parameters;
extern struct pixel_shader_definition pixel_shader;
boolean reported_too_many_transparent_geometry_groups = FALSE;
extern struct rasterizer_window_begin_parameters global_window_parameters;
/* ---------- public code */
@@ -314,7 +260,7 @@ void _rasterizer_psuedo_dynamic_screen_quad_draw(
756,
global_d3d_device);
if (!rasterizer_debug_options.draw_dynamic_screen_geometry)
if (!rasterizer_debug_options.dynamic_screen_geometry)
{
return;
}
@@ -720,15 +666,16 @@ void _rasterizer_dynamic_unlit_geometry_draw(
unsigned long geometry_flags)
{
struct transparent_geometry_group *group;
real_point3d relative_centroid;
real_plane3d plane;
real_vector3d forward;
real_plane3d zero_plane;
static boolean warned = FALSE;
match_assert(
"c:\\halo\\SOURCE\\rasterizer\\xbox\\rasterizer_xbox_dynavobgeom.c",
38,
global_d3d_device);
if (!rasterizer_debug_options.draw_dynamic_unlit_geometry)
if (!rasterizer_debug_options.dynamic_unlit_geometry)
{
return;
}
@@ -748,24 +695,22 @@ void _rasterizer_dynamic_unlit_geometry_draw(
52,
centroid);
relative_centroid.x = centroid->x - global_window_parameters.camera.position.x;
relative_centroid.y = centroid->y - global_window_parameters.camera.position.y;
relative_centroid.z = centroid->z - global_window_parameters.camera.position.z;
vector_from_points3d(&global_window_parameters.camera.position, centroid, &forward);
group = rasterizer_transparent_geometry_new_group();
if (group)
{
plane.n.i = 0.0f;
plane.n.j = 0.0f;
plane.n.k = 0.0f;
plane.d = 0.0f;
zero_plane.n.i = 0.0f;
zero_plane.n.j = 0.0f;
zero_plane.n.k = 0.0f;
zero_plane.d = 0.0f;
group->geometry_flags = geometry_flags;
group->object_index = 0;
group->source_object_index = 0;
group->shader = (struct shader *)shader;
group->shader_permutation_index = 0;
group->effect_type = 0;
group->effect.type = _render_model_effect_type_none;
group->dynamic_triangle_buffer_index = dynamic_triangle_buffer_index;
group->triangle_buffer = NULL;
group->first_triangle_index = 0;
@@ -773,12 +718,9 @@ void _rasterizer_dynamic_unlit_geometry_draw(
group->dynamic_vertex_buffer_index = dynamic_vertex_buffer_index;
group->vertex_buffer = NULL;
group->lightmap = primary_map;
group->z_sort = -(
global_window_parameters.camera.forward.k * relative_centroid.z +
global_window_parameters.camera.forward.j * relative_centroid.y +
global_window_parameters.camera.forward.i * relative_centroid.x);
group->z_sort = -dot_product3d(&global_window_parameters.camera.forward, &forward);
group->centroid = *centroid;
group->plane = plane;
group->plane = zero_plane;
group->model_base_map_scale.i = group->model_base_map_scale.j = 1.0f;
group->previous_group_presorted_index = NONE;
group->next_group_presorted_index = NONE;
@@ -796,14 +738,13 @@ void _rasterizer_dynamic_unlit_geometry_draw(
group->lighting = NULL;
group->animation = NULL;
if (rasterizer_debug_options.statistics_mode == _rasterizer_statistics_mode_enabled)
if (rasterizer_debug_options.stats == _rasterizer_statistics_mode_geometry)
{
rasterizer_frame_statistics.dynamic_unlit_draw_count++;
rasterizer_frame_statistics.dynamic_unlit_triangle_count += triangle_count;
if (triangle_count > rasterizer_frame_statistics.largest_dynamic_unlit_triangle_count)
{
rasterizer_frame_statistics.largest_dynamic_unlit_triangle_count = triangle_count;
}
rasterizer_frame_statistics.largest_dynamic_unlit_triangle_count = MAX(
triangle_count,
rasterizer_frame_statistics.largest_dynamic_unlit_triangle_count);
rasterizer_frame_statistics.dynamic_unlit_vertex_count +=
rasterizer_frame_statistics_count_dynamic_vertices(
dynamic_triangle_buffer_index,
@@ -811,12 +752,12 @@ void _rasterizer_dynamic_unlit_geometry_draw(
triangle_count);
}
}
else if (!reported_too_many_transparent_geometry_groups)
else if (!warned)
{
error(
_error_silent,
"### ERROR too many transparent geometry groups");
reported_too_many_transparent_geometry_groups = TRUE;
warned = TRUE;
}
return;
+8 -9
View File
@@ -101,7 +101,7 @@ symbols in this file:
002A8968 007d:
??_C@_0HN@FLNBFKEC@?$CIlevel?$DO?$DN0?$CJ?5?$CG?$CG?5?$CIlevel?$DMNUMBER_OF_S@ (0000)
00316880 0048:
_data_00316880 (0000)
_profile_color_table (0000)
004D27E8 006c:
_player_profile_globals (0000)
*/
@@ -169,7 +169,6 @@ struct player_profile_runtime_globals
struct player_profile_write_request write_request;
struct thread_reference *thread;
boolean initialized;
byte pad[3];
};
typedef char verify_player_profile_thread_offset[
@@ -197,7 +196,7 @@ static void player_profile_write(
/* ---------- globals */
long player_profile_primary_colors[NUMBER_OF_AVAILABLE_PRIMARY_COLORS] =
static long profile_color_table[NUMBER_OF_AVAILABLE_PRIMARY_COLORS] =
{
0x00FFFFFF,
0x00000000,
@@ -335,7 +334,7 @@ real_rgb_color player_profile_get_rgb_color(
color_index = color_index < NUMBER_OF_AVAILABLE_PRIMARY_COLORS - 1 ?
color_index : NUMBER_OF_AVAILABLE_PRIMARY_COLORS - 1;
color_index = color_index < 0 ? 0 : color_index;
color = player_profile_primary_colors[color_index];
color = profile_color_table[color_index];
rgb_color.red = ((color >> 16) & 0xFF) / 255.f;
rgb_color.green = ((color >> 8) & 0xFF) / 255.f;
@@ -816,17 +815,17 @@ static unsigned long __stdcall player_profile_write_thread_proc(
{
error(_error_silent, "metadata name may not match game display name");
}
if (failed)
{
delete_enumerated_saved_game_file(player_profile_index);
}
}
else
{
error(_error_silent, "failed to open player profile file");
}
if (failed)
{
delete_enumerated_saved_game_file(player_profile_index);
}
saved_game_files_release_mutex();
}
else