diff --git a/crates/xenia-app/src/main.rs b/crates/xenia-app/src/main.rs index 9f8edc8..d3009e9 100644 --- a/crates/xenia-app/src/main.rs +++ b/crates/xenia-app/src/main.rs @@ -1540,8 +1540,19 @@ fn cmd_exec_inner( mem.write_u32(addr, block); } ("xboxkrnl.exe", 0x01BE) => { - // VdGlobalDevice — passed through to Vd* shims. Write 0. - mem.write_u32(addr, 0); + // VdGlobalDevice — a *pointer to* a global D3D-device cell. + // Mirror xenia-canary RegisterVideoExports (xboxkrnl_video.cc: + // 557-564): allocate a 4-byte cell, point the import slot at + // it, and zero the cell. The guest's graphics init then stores + // its device object INTO the cell (e.g. sub_824C6DC0 @ + // 0x824C6F18 `stw r31, 0([0x82000750])`), and the swap-complete + // callback sub_824CE2B8 reads it back via the two-level + // `[[VdGlobalDevice]+0]+15160` to bump the swap counter (clock + // B). Writing 0 directly here (the old behaviour) made that + // store land at address 0 and the swap counter never advance — + // freezing the title-loop's per-frame manager update. + let cell = alloc_zero(0x4, &mut mem, &mut kernel); + mem.write_u32(addr, cell); } ("xboxkrnl.exe", 0x01C0) => { // VdGpuClockInMHz diff --git a/crates/xenia-app/tests/golden/sylpheed_n50m.json b/crates/xenia-app/tests/golden/sylpheed_n50m.json index 7c165e7..70f7a6c 100644 --- a/crates/xenia-app/tests/golden/sylpheed_n50m.json +++ b/crates/xenia-app/tests/golden/sylpheed_n50m.json @@ -1,6 +1,6 @@ { - "instructions": 50000001, - "imports": 451500, + "instructions": 50000014, + "imports": 178937, "unimpl": 0, "draws": 78, "swaps": 4,