ryujinx_ryubing/src/Ryujinx.HLE/HOS/Tamper/Operations/OpMov.cs
2025-12-30 18:52:41 -06:00

28 lines
753 B
C#

using System.Numerics;
namespace Ryujinx.HLE.HOS.Tamper.Operations
{
sealed class OpMovFactory : IOperationFactory
{
private OpMovFactory() { }
public static IOperation CreateFor<T>(IOperand destination, IOperand lhs, IOperand rhs) where T : unmanaged, IBinaryInteger<T>
=> new OpMov<T>(destination, lhs);
}
class OpMov<T> : IOperation where T : unmanaged, INumber<T>
{
readonly IOperand _destination;
readonly IOperand _source;
public OpMov(IOperand destination, IOperand source)
{
_destination = destination;
_source = source;
}
public void Execute()
{
_destination.Set(_source.Get<T>());
}
}
}