DDGameWrapper had an off-by-16 size assertion (0x6F00 vs actual allocation
0x6F10); the 0x20-byte tail is unzeroed unknown padding. Fixed struct field
and size assertion.
WABox never had a Drop implementation so it was purely a leak-by-design
wrapper with no safety value. Remove it entirely and replace all uses:
- WABox::alloc(...).leak() β wa_malloc_struct_zeroed::<T>()
- WABox::from_value(val).leak() β wa_malloc_struct::<T>() + ptr::write(p, val)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
refactor: use typed pointers throughout DisplayBase and sprite cacheβ
Move BitGrid from task::bit_grid to display::bitgrid as its canonical
home. Delete the old module. Rename fields to match known semantics:
_unused_04 β external_buffer, _unused_1c/20 β clip_left/clip_top,
width_dup/height_dup β clip_right/clip_bottom.
Convert bit_grid_init to BitGrid::init with *mut BitGrid parameter.
Replace magic vtable address with va::BIT_GRID_VTABLE constant.
Remove redundant double memset. Remove dead TaskStateMachine class.
Rename DDGame::display_gfx β display_bitgrid (it's a BitGrid, not
DisplayGfx). Rename Sprite::display_gfx β bitgrid_vtable. Clean up
tsm variable names and stale re-exports throughout.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: resolve all clippy warnings across core, wormkit, and test-runnerβ
Add wa_malloc_zeroed() utility that combines wa_malloc + write_bytes.
Replace 10 malloc+zero pairs in DDGame constructor with single calls.
Type landscape temp buffers as [u32] arrays instead of [u8], enabling
direct indexing for coordinate data. Update wa_pc_landscape_ctor
signature to match (*mut u32 for output params). Use &raw mut for
obtaining raw pointers to DDGame fields.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: remove extra loading progress ticks, cargo fmtβ
Reduce from 4 to 2 DDGameWrapper__LoadingProgressTick calls, matching
the original constructor. Tick counter +0x04D8 now matches exactly
(0x334). All DDGameWrapper fields match the original.
Remaining headless checksum mismatch is likely due to headless display
handling differences (our headless display is non-null vs original's
NULL display parameter).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rename DDDisplayBase -> DisplayBase across codebase. Define DisplayBase
struct with named fields from constructor analysis, DisplayBaseVtable
with 32 typed slots, SpriteCollection sub-object, and static
HEADLESS_VTABLE with all no-op stubs.
Patch WA.exe's primary DisplayBase vtable (0x6645F8) at init time:
replace 22 _purecall slots with safe Rust no-ops, benefiting both
headless (DisplayBase) and normal (DisplayGfx) modes.
Add wa_free() to wa_alloc module alongside wa_malloc().
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
refactor: add WABox::from_value and struct constructors for DDKeyboard/Paletteβ
Add WABox::from_value(val) to allocate on WA's heap and write a
fully-initialized value in one step. Add DDKeyboard::new() and
Palette::new() that return Self with all fields set, replacing
multi-line alloc+field-write sequences with one-liners.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: replace GameEngine__InitHardware with full Rust reimplementationβ