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/demorec.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/demorec.c') diff --git a/src/demorec.c b/src/demorec.c index 6e3b2ec..8abba77 100644 --- a/src/demorec.c +++ b/src/demorec.c @@ -1,6 +1,6 @@ /* * Copyright © 2021 Willian Henrique - * Copyright © 2023 Michael Smith + * Copyright © 2024 Michael Smith * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -193,12 +193,12 @@ static inline bool find_recmembers(void *StopRecording) { // m_nDemoNumber = 0 -> mov dword ptr [ + off], 0 // XXX: might end up wanting constants for the MRM field masks? if (p[0] == X86_MOVMIW && (p[1] & 0xC0) == 0x80 && - mem_load32(p + 6) == 0) { - demonum = mem_offset(demorecorder, mem_load32(p + 2)); + mem_loads32(p + 6) == 0) { + demonum = mem_offset(demorecorder, mem_loads32(p + 2)); } // m_bRecording = false -> mov byte ptr [ + off], 0 else if (p[0] == X86_MOVMI8 && (p[1] & 0xC0) == 0x80 && p[6] == 0) { - recording = mem_offset(demorecorder, mem_load32(p + 2)); + recording = mem_offset(demorecorder, mem_loads32(p + 2)); } if (recording && demonum) return true; // blegh NEXT_INSN(p, "recording state variables"); @@ -217,7 +217,7 @@ static inline bool find_demoname(void *StartRecording) { // `this` - look for a LEA some time *before* the first call instruction if (p[0] == X86_CALL) return false; if (p[0] == X86_LEA && (p[1] & 0xC0) == 0x80) { - demorec_basename = mem_offset(demorecorder, mem_load32(p + 2)); + demorec_basename = mem_offset(demorecorder, mem_loads32(p + 2)); return true; } NEXT_INSN(p, "demo basename variable"); -- cgit v1.2.3