Migrate inline asm call sites to hook.call()

Replace hand-written inline asm blocks with hook.call() typed function
pointer dispatch across 10 files. Also migrates 4 D3D9 COM vtable
NULL-dispatch blocks using ?*anyopaque optional pointers.

Net removal: ~350 lines of inline asm replaced by single-line calls.
This commit is contained in:
MarcelineVQ
2026-03-09 10:28:55 -07:00
parent b688a3dee9
commit 9c96a94dc1
10 changed files with 85 additions and 437 deletions
+2 -11
View File
@@ -15,6 +15,7 @@ const mod_mutex = @import("../mutex.zig");
const WINAPI = std.builtin.CallingConvention.winapi;
const sc: std.builtin.CallingConvention = .{ .x86_stdcall = .{} };
const fc: std.builtin.CallingConvention = .{ .x86_fastcall = .{} };
const tc: std.builtin.CallingConvention = .{ .x86_thiscall = .{} };
pub const module_name: [*:0]const u8 = "bigcursor";
@@ -556,17 +557,7 @@ fn hkShowCursor(device: *anyopaque, bShow: i32) callconv(sc) i32 {
// =============================================================================
fn luaPushNumber(L_ptr: usize, n: f64) void {
const raw: [2]u32 = @bitCast(n);
asm volatile (
\\push %[hi]
\\push %[lo]
\\call *%[func]
:
: [_] "{ecx}" (L_ptr),
[lo] "r" (raw[0]),
[hi] "r" (raw[1]),
[func] "r" (@as(u32, 0x6F3810)),
: .{ .eax = true, .ecx = true, .edx = true, .memory = true, .cc = true });
hook.call(fn (usize, f64) callconv(tc) void, 0x6F3810, .{ L_ptr, n });
}
pub fn luaSetCursorScale(L: *anyopaque) callconv(.c) u32 {