aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliamWsyHK <WilliamWsyHK@users.noreply.github.com>2024-04-11 06:03:37 +0800
committerGitHub <noreply@github.com>2024-04-11 00:03:37 +0200
commit22e3ff06b51db0fa72e9f2dc2aee395a5d1aa2df (patch)
tree915fae6ffc210a6491c58ab552861a042cc84ad5
parent9480e5c5ceeac3219dc0e0a90c0cb2a5487a7298 (diff)
Update StoreConstantToMemory to match StoreConstantToAddress on value read (#6642)1.1.1276
-rw-r--r--src/Ryujinx.HLE/HOS/Tamper/CodeEmitters/StoreConstantToMemory.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Ryujinx.HLE/HOS/Tamper/CodeEmitters/StoreConstantToMemory.cs b/src/Ryujinx.HLE/HOS/Tamper/CodeEmitters/StoreConstantToMemory.cs
index 27a99bb6..09795c9f 100644
--- a/src/Ryujinx.HLE/HOS/Tamper/CodeEmitters/StoreConstantToMemory.cs
+++ b/src/Ryujinx.HLE/HOS/Tamper/CodeEmitters/StoreConstantToMemory.cs
@@ -15,7 +15,8 @@ namespace Ryujinx.HLE.HOS.Tamper.CodeEmitters
private const int OffsetRegisterIndex = 6;
private const int ValueImmediateIndex = 8;
- private const int ValueImmediateSize = 16;
+ private const int ValueImmediateSize8 = 8;
+ private const int ValueImmediateSize16 = 16;
public static void Emit(byte[] instruction, CompilationContext context)
{
@@ -31,7 +32,8 @@ namespace Ryujinx.HLE.HOS.Tamper.CodeEmitters
Register sourceRegister = context.GetRegister(instruction[AddressRegisterIndex]);
byte incrementAddressRegister = instruction[IncrementAddressRegisterIndex];
byte useOffsetRegister = instruction[UseOffsetRegisterIndex];
- ulong immediate = InstructionHelper.GetImmediate(instruction, ValueImmediateIndex, ValueImmediateSize);
+ int valueImmediateSize = operationWidth <= 4 ? ValueImmediateSize8 : ValueImmediateSize16;
+ ulong immediate = InstructionHelper.GetImmediate(instruction, ValueImmediateIndex, valueImmediateSize);
Value<ulong> storeValue = new(immediate);
Pointer destinationMemory;