Remove dynamic usage from Ryujinx.HLE (will come back to make this not generic explode)

This commit is contained in:
Aaron Robinson
2025-11-19 00:33:17 -06:00
parent 4f5eea3417
commit 00021121ea
31 changed files with 198 additions and 106 deletions

View File

@@ -37,27 +37,27 @@ namespace Ryujinx.HLE.HOS.Tamper.CodeEmitters
ulong immediate = InstructionHelper.GetImmediate(instruction, ValueImmediateIndex, ValueImmediateSize);
Value<ulong> rightHandSideValue = new(immediate);
void Emit(Type operationType)
void EmitCore<TOp>() where TOp : IOperation
{
InstructionHelper.Emit(operationType, operationWidth, context, register, register, rightHandSideValue);
InstructionHelper.Emit<TOp>(operationWidth, context, register, register, rightHandSideValue);
}
switch (operation)
{
case Add:
Emit(typeof(OpAdd<>));
EmitCore<OpAdd<byte>>();
break;
case Sub:
Emit(typeof(OpSub<>));
EmitCore<OpAdd<byte>>();
break;
case Mul:
Emit(typeof(OpMul<>));
EmitCore<OpMul<byte>>();
break;
case Lsh:
Emit(typeof(OpLsh<>));
EmitCore<OpLsh<byte>>();
break;
case Rsh:
Emit(typeof(OpRsh<>));
EmitCore<OpRsh<byte>>();
break;
default:
throw new TamperCompilationException($"Invalid arithmetic operation {operation} in Atmosphere cheat");