bone_sse: fix IsParticleBufferEmpty calling convention

Was __stdcall with stack param — would corrupt stack for every visible
particle emitter. Fixed to __fastcall(ECX=ptr) matching assembly at
0x717EB8: MOV ECX,[EBP-0x10]; CALL 0x7B5F60. Plain RET, no stack cleanup.

Bug #14 found during final verification pass.
This commit is contained in:
MarcelineVQ
2026-03-14 17:45:46 -07:00
parent c060f0d469
commit 2018ca45fa
+4 -2
View File
@@ -1908,8 +1908,10 @@ fn additionalParticleLoops(this: u32, model_hdr: u32) void {
buf_active = 1;
} else {
// Call IsParticleBufferEmpty (0x7B5F60)
const isEmptyFn: *const fn (u32) callconv(.{ .x86_stdcall = .{} }) u32 = @ptrFromInt(0x7B5F60);
if (isEmptyFn(@intFromPtr(&local_14)) != 0) {
// Assembly: MOV ECX,[EBP-0x10]; CALL 0x7B5F60
// __thiscall(ECX=ptr), plain RET, returns 0 or 1 in EAX
const isEmptyFn: *const fn (u32) callconv(.{ .x86_fastcall = .{} }) u32 = @ptrFromInt(0x7B5F60);
if (isEmptyFn(local_14) != 0) {
buf_active = 1;
}
}