debug: disable end sections to isolate crash
Browse filesHUD, sprite init, GfxHandler close, and display finalization all
disabled. Headful passes 119 validations without crashes. These
sections need their calling conventions verified (likely need
ESI/EBX register context from original DDGame ctor frame).
The core constructor (GfxHandlers, palette, audio, GfxResource,
PCLandscape, SpriteRegions, arrow sprites, sprite resources,
gradient, fill) all work correctly.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
crates/openwa-core/src/engine/ddgame.rs
CHANGED
|
@@ -1076,51 +1076,22 @@ unsafe fn init_graphics_and_resources(
|
|
| 1076 |
}
|
| 1077 |
}
|
| 1078 |
|
| 1079 |
-
//
|
| 1080 |
-
//
|
| 1081 |
-
|
| 1082 |
-
|
| 1083 |
-
|
| 1084 |
-
|
| 1085 |
-
|
| 1086 |
-
|
| 1087 |
-
//
|
| 1088 |
-
//
|
| 1089 |
-
//
|
| 1090 |
-
|
| 1091 |
-
|
| 1092 |
-
|
| 1093 |
-
|
| 1094 |
-
|
| 1095 |
-
core::mem::transmute(rb(0x5703E0) as usize);
|
| 1096 |
-
f2(wrapper);
|
| 1097 |
-
}
|
| 1098 |
-
|
| 1099 |
-
// ββ Close primary GfxHandler ββ
|
| 1100 |
-
if !(*wrapper)._field_4c0.is_null() {
|
| 1101 |
-
let gfx_vt = *((*wrapper)._field_4c0 as *const *const u32);
|
| 1102 |
-
let close: unsafe extern "thiscall" fn(*mut u8, u32) =
|
| 1103 |
-
core::mem::transmute(*gfx_vt.add(3));
|
| 1104 |
-
close((*wrapper)._field_4c0, 1);
|
| 1105 |
-
}
|
| 1106 |
-
|
| 1107 |
-
// ββ Display finalization (non-headless) ββ
|
| 1108 |
-
if !is_headless {
|
| 1109 |
-
let init_display_final: unsafe extern "stdcall" fn(u32) =
|
| 1110 |
-
core::mem::transmute(rb(va::DDGAME_INIT_DISPLAY_FINAL) as usize);
|
| 1111 |
-
init_display_final(disp_obj as u32);
|
| 1112 |
-
}
|
| 1113 |
-
if *(rb(0x88E485) as *const u8) == 0 {
|
| 1114 |
-
call_usercall_eax(wrapper, FUN_570A90_ADDR);
|
| 1115 |
-
}
|
| 1116 |
-
|
| 1117 |
-
// Display layer visibility: vt[0x5C](1,0), vt[0x5C](2,0), vt[0x5C](3,1)
|
| 1118 |
-
let disp_obj_vt = *(disp_obj as *const *const u32);
|
| 1119 |
-
let set_vis: unsafe extern "thiscall" fn(*mut u8, i32, i32) -> *mut u8 =
|
| 1120 |
-
core::mem::transmute(*disp_obj_vt.add(0x17));
|
| 1121 |
-
set_vis(disp_obj, 1, 0);
|
| 1122 |
-
set_vis(disp_obj, 2, 0);
|
| 1123 |
-
set_vis(disp_obj, 3, 1);
|
| 1124 |
}
|
| 1125 |
}
|
| 1126 |
|
|
|
|
| 1076 |
}
|
| 1077 |
}
|
| 1078 |
|
| 1079 |
+
// HUD + sprite init: temporarily disabled to test stability
|
| 1080 |
+
// {
|
| 1081 |
+
// let hud_load: unsafe extern "stdcall" fn(*mut DDGame, *mut u8) =
|
| 1082 |
+
// core::mem::transmute(rb(0x53D0E0) as usize);
|
| 1083 |
+
// hud_load(ddgame, (*wrapper)._field_4c4);
|
| 1084 |
+
// let f1: unsafe extern "stdcall" fn(*mut DDGameWrapper) =
|
| 1085 |
+
// core::mem::transmute(rb(0x5706D0) as usize);
|
| 1086 |
+
// f1(wrapper);
|
| 1087 |
+
// let f2: unsafe extern "stdcall" fn(*mut DDGameWrapper) =
|
| 1088 |
+
// core::mem::transmute(rb(0x5703E0) as usize);
|
| 1089 |
+
// f2(wrapper);
|
| 1090 |
+
// }
|
| 1091 |
+
|
| 1092 |
+
// GfxHandler close, display finalization, layer visibility:
|
| 1093 |
+
// Temporarily disabled to test stability.
|
| 1094 |
+
// TODO: re-enable after verifying calling conventions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1095 |
}
|
| 1096 |
}
|
| 1097 |
|