summaryrefslogtreecommitdiffhomepage
path: root/src/demorec.c
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2024-01-21 21:59:23 +0000
committerMichael Smith <mikesmiffy128@gmail.com>2024-01-21 22:02:14 +0000
commit670488716dde7ba7813dd281f24403a0b24d8690 (patch)
tree9b138c009e4131e32ed7bf4645e3eba7f8a5b18d /src/demorec.c
parent506f095bcb528468f25a637977efcc408590ae67 (diff)
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.
Diffstat (limited to 'src/demorec.c')
-rw-r--r--src/demorec.c10
1 files changed, 5 insertions, 5 deletions
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 <wsimanbrazil@yahoo.com.br>
- * Copyright © 2023 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2024 Michael Smith <mikesmiffy128@gmail.com>
*
* 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 [<reg> + 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 [<reg> + 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");