paavohtl Claude Opus 4.6 (1M context) commited on
Commit
4563f4c
Β·
1 Parent(s): 9d4f40a

debug: remove param hooks, isolate arrow loop hang

Browse files

Removed PCLandscape, SpriteRegion, and HUD param hooks (served their
purpose, may interfere). Arrow loop hangs β€” gets past 'starting arrow
loop' but never reaches 'arrow loop done'. The GfxDir__FindEntry or
display vtable call inside the arrow loop is blocking/looping.

Likely cause: GfxHandler state corrupted by a prior section, or
display layer context invalid for the arrow loop iterations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

crates/openwa-core/src/engine/ddgame.rs CHANGED
@@ -866,6 +866,7 @@ unsafe fn init_graphics_and_resources(
866
  // GfxDir addresses are resolved via statics (GFX_FIND_ENTRY_ADDR, GFX_LOAD_IMAGE_ADDR)
867
  // and called through naked bridges (call_gfx_find_entry, call_gfx_load_image).
868
 
 
869
  // ── Arrow sprites + collision regions (32 iterations) ──
870
  {
871
  let gfx_handler = (*wrapper)._field_4c0;
@@ -935,6 +936,7 @@ unsafe fn init_graphics_and_resources(
935
  }
936
  }
937
 
 
938
  // ── DisplayGfx at DDGame+0x138 ──
939
  // Original: alloc 0x4C, memset 0x2C, PUSH 0x100, MOV ECX=8, MOV EDI=0x1E0,
940
  // CALL 0x4F6370, MOV [alloc]=0x664144
 
866
  // GfxDir addresses are resolved via statics (GFX_FIND_ENTRY_ADDR, GFX_LOAD_IMAGE_ADDR)
867
  // and called through naked bridges (call_gfx_find_entry, call_gfx_load_image).
868
 
869
+ let _ = crate::log::log_line("[DDGame] starting arrow loop");
870
  // ── Arrow sprites + collision regions (32 iterations) ──
871
  {
872
  let gfx_handler = (*wrapper)._field_4c0;
 
936
  }
937
  }
938
 
939
+ let _ = crate::log::log_line("[DDGame] arrow loop done");
940
  // ── DisplayGfx at DDGame+0x138 ──
941
  // Original: alloc 0x4C, memset 0x2C, PUSH 0x100, MOV ECX=8, MOV EDI=0x1E0,
942
  // CALL 0x4F6370, MOV [alloc]=0x664144
crates/openwa-wormkit/src/replacements/game_session.rs CHANGED
@@ -393,29 +393,10 @@ pub fn install() -> Result<(), String> {
393
  // DDGameWrapper__Constructor is fully converted β€” trap the original.
394
  hook::install_trap!("DDGameWrapper__Constructor", va::CONSTRUCT_DD_GAME_WRAPPER);
395
 
396
- // Hook PCLandscape__Constructor to log params
397
- let tramp = hook::install(
398
- "PCLandscape__Constructor",
399
- va::PC_LANDSCAPE_CONSTRUCTOR,
400
- hook_pc_landscape_ctor as *const (),
401
- )?;
402
- PC_LANDSCAPE_TRAMPOLINE = tramp as *const ();
403
-
404
- // Hook HUD_LoadWeaponSprites to log params
405
- let tramp_hud = hook::install(
406
- "HUD_LoadWeaponSprites",
407
- 0x53D0E0,
408
- hook_hud_load as *const (),
409
- )?;
410
- HUD_LOAD_TRAMPOLINE = tramp_hud as *const ();
411
-
412
- // Hook SpriteRegion__Constructor to log fastcall params
413
- let tramp2 = hook::install(
414
- "SpriteRegion__Constructor",
415
- va::SPRITE_REGION_CONSTRUCTOR,
416
- hook_sprite_region_ctor as *const (),
417
- )?;
418
- SPRITE_REGION_TRAMPOLINE = tramp2 as *const ();
419
  }
420
  Ok(())
421
  }
 
393
  // DDGameWrapper__Constructor is fully converted β€” trap the original.
394
  hook::install_trap!("DDGameWrapper__Constructor", va::CONSTRUCT_DD_GAME_WRAPPER);
395
 
396
+ // PCLandscape hook disabled β€” params verified, may interfere with Rust ctor
397
+
398
+ // Param hooks disabled β€” they served their purpose and may interfere
399
+ // with the Rust constructor's own calls to these functions.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
400
  }
401
  Ok(())
402
  }