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/fastfwd.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/fastfwd.c') diff --git a/src/fastfwd.c b/src/fastfwd.c index b5b7e6a..fb16e13 100644 --- a/src/fastfwd.c +++ b/src/fastfwd.c @@ -1,6 +1,6 @@ /* * Copyright © 2023 Matthew Wozniak - * Copyright © 2023 Michael Smith + * Copyright © 2024 Michael Smith * Copyright © 2023 Willian Henrique * * Permission to use, copy, modify, and/or distribute this software for any @@ -101,7 +101,7 @@ static inline void *find_HostState_Frame(void *Frame) { NEXT_INSN(p, "HostState_Frame"); while (p - insns < 640) { if (p[0] == X86_CALL) { - return (uchar *)p + 5 + mem_loadoffset(p + 1); + return (uchar *)p + 5 + mem_loads32(p + 1); } NEXT_INSN(p, "HostState_Frame"); } @@ -120,7 +120,7 @@ static inline void *find_FrameUpdate(void *HostState_Frame) { // HostState_Frame() calls another non-virtual member function (FrameUpdate) const uchar *insns = (const uchar *)HostState_Frame; for (const uchar *p = insns; p - insns < 384;) { - if (p[0] == X86_CALL) return (uchar *)p + 5 + mem_loadoffset(p + 1); + if (p[0] == X86_CALL) return (uchar *)p + 5 + mem_loads32(p + 1); NEXT_INSN(p, "CHostState::FrameUpdate"); } #else @@ -138,7 +138,7 @@ static inline bool find_Host_AccumulateTime(void *_Host_RunFrame) { while (p - insns < 384) { if (p[0] == X86_CALL) { orig_Host_AccumulateTime = (Host_AccumulateTime_func)( - p + 5 + mem_loadoffset(p + 1)); + p + 5 + mem_loads32(p + 1)); return true; } NEXT_INSN(p, "Host_AccumulateTime"); @@ -173,7 +173,7 @@ static void *find_floatcall(void *func, int fldcnt, const char *name) { NEXT_INSN(p, name); while (p - insns < 384) { if (p[0] == X86_CALL) { - if (!--fldcnt) return (uchar *)p + 5 + mem_loadoffset(p + 1); + if (!--fldcnt) return (uchar *)p + 5 + mem_loads32(p + 1); goto next; } NEXT_INSN(p, name); -- cgit v1.2.3