From 670488716dde7ba7813dd281f24403a0b24d8690 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Sun, 21 Jan 2024 21:59:23 +0000 Subject: Rethink mem_loadoffset, and consequently, kill it Suggested by bill. Having something semantically pointer-sized that's only ever used for stuff that's always 32-bit doesn't really make sense. Note that I intentionally did not add a copyright line for myself in hud.c because, I mean, come on. I'll just say I waive any claim to that tiny trivial change. --- src/ac.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ac.c') diff --git a/src/ac.c b/src/ac.c index 537ccfc..9bd51e0 100644 --- a/src/ac.c +++ b/src/ac.c @@ -1,5 +1,5 @@ /* - * Copyright © 2023 Michael Smith + * Copyright © 2024 Michael Smith * Copyright © 2023 Willian Henrique * * Permission to use, copy, modify, and/or distribute this software for any @@ -327,7 +327,7 @@ static bool find_Key_Event(void) { ok: insns = (const uchar *)VFUNC(cgame, DispatchAllStoredGameMessages); for (const uchar *p = insns; p - insns < 128;) { if (p[0] == X86_CALL) { - orig_Key_Event = (Key_Event_func)(p + 5 + mem_loadoffset(p + 1)); + orig_Key_Event = (Key_Event_func)(p + 5 + mem_loads32(p + 1)); goto ok2; } NEXT_INSN(p, "DispatchInputEvent/Key_Event function"); @@ -342,7 +342,7 @@ ok2: // DispatchInputEvent and this CALL points to Key_Event. for (const uchar *p = insns; p - insns < 32;) { if (p[0] == X86_CALL) { - orig_Key_Event = (Key_Event_func)(p + 5 + mem_loadoffset(p + 1)); + orig_Key_Event = (Key_Event_func)(p + 5 + mem_loads32(p + 1)); break; } NEXT_INSN(p, "Key_Event function"); -- cgit v1.2.3