Move solution and projects to src

This commit is contained in:
TSR Berry
2023-04-08 01:22:00 +02:00
committed by Mary
parent cd124bda58
commit cee7121058
3466 changed files with 55 additions and 55 deletions

View File

@@ -0,0 +1,28 @@
using Ryujinx.HLE.HOS.Tamper.Operations;
namespace Ryujinx.HLE.HOS.Tamper.CodeEmitters
{
/// <summary>
/// Code type 4 allows setting a register to a constant value.
/// </summary>
class LoadRegisterWithConstant
{
const int RegisterIndex = 3;
const int ValueImmediateIndex = 8;
const int ValueImmediateSize = 16;
public static void Emit(byte[] instruction, CompilationContext context)
{
// 400R0000 VVVVVVVV VVVVVVVV
// R: Register to use.
// V: Value to load.
Register destinationRegister = context.GetRegister(instruction[RegisterIndex]);
ulong immediate = InstructionHelper.GetImmediate(instruction, ValueImmediateIndex, ValueImmediateSize);
Value<ulong> sourceValue = new Value<ulong>(immediate);
context.CurrentOperations.Add(new OpMov<ulong>(destinationRegister, sourceValue));
}
}
}