mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-07-22 06:37:10 +02:00
Move solution and projects to src
This commit is contained in:
parent
cd124bda58
commit
cee7121058
3466 changed files with 55 additions and 55 deletions
27
src/Ryujinx.HLE/HOS/Tamper/Operations/Block.cs
Normal file
27
src/Ryujinx.HLE/HOS/Tamper/Operations/Block.cs
Normal file
|
@ -0,0 +1,27 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Tamper.Operations
|
||||
{
|
||||
class Block : IOperation
|
||||
{
|
||||
private IEnumerable<IOperation> _operations;
|
||||
|
||||
public Block(IEnumerable<IOperation> operations)
|
||||
{
|
||||
_operations = operations;
|
||||
}
|
||||
|
||||
public Block(params IOperation[] operations)
|
||||
{
|
||||
_operations = operations;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
foreach (IOperation op in _operations)
|
||||
{
|
||||
op.Execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
41
src/Ryujinx.HLE/HOS/Tamper/Operations/ForBlock.cs
Normal file
41
src/Ryujinx.HLE/HOS/Tamper/Operations/ForBlock.cs
Normal file
|
@ -0,0 +1,41 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Tamper.Operations
|
||||
{
|
||||
class ForBlock : IOperation
|
||||
{
|
||||
private ulong _count;
|
||||
private Register _register;
|
||||
private IEnumerable<IOperation> _operations;
|
||||
|
||||
public ForBlock(ulong count, Register register, IEnumerable<IOperation> operations)
|
||||
{
|
||||
_count = count;
|
||||
_register = register;
|
||||
_operations = operations;
|
||||
}
|
||||
|
||||
public ForBlock(ulong count, Register register, params IOperation[] operations)
|
||||
{
|
||||
_count = count;
|
||||
_register = register;
|
||||
_operations = operations;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
for (ulong i = 0; i < _count; i++)
|
||||
{
|
||||
// Set the register and execute the operations so that changing the
|
||||
// register during runtime does not break iteration.
|
||||
|
||||
_register.Set<ulong>(i);
|
||||
|
||||
foreach (IOperation op in _operations)
|
||||
{
|
||||
op.Execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
8
src/Ryujinx.HLE/HOS/Tamper/Operations/IOperand.cs
Normal file
8
src/Ryujinx.HLE/HOS/Tamper/Operations/IOperand.cs
Normal file
|
@ -0,0 +1,8 @@
|
|||
namespace Ryujinx.HLE.HOS.Tamper.Operations
|
||||
{
|
||||
interface IOperand
|
||||
{
|
||||
public T Get<T>() where T : unmanaged;
|
||||
public void Set<T>(T value) where T : unmanaged;
|
||||
}
|
||||
}
|
7
src/Ryujinx.HLE/HOS/Tamper/Operations/IOperation.cs
Normal file
7
src/Ryujinx.HLE/HOS/Tamper/Operations/IOperation.cs
Normal file
|
@ -0,0 +1,7 @@
|
|||
namespace Ryujinx.HLE.HOS.Tamper.Operations
|
||||
{
|
||||
interface IOperation
|
||||
{
|
||||
void Execute();
|
||||
}
|
||||
}
|
34
src/Ryujinx.HLE/HOS/Tamper/Operations/IfBlock.cs
Normal file
34
src/Ryujinx.HLE/HOS/Tamper/Operations/IfBlock.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
using Ryujinx.HLE.HOS.Tamper.Conditions;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Tamper.Operations
|
||||
{
|
||||
class IfBlock : IOperation
|
||||
{
|
||||
private ICondition _condition;
|
||||
private IEnumerable<IOperation> _operationsThen;
|
||||
private IEnumerable<IOperation> _operationsElse;
|
||||
|
||||
public IfBlock(ICondition condition, IEnumerable<IOperation> operationsThen, IEnumerable<IOperation> operationsElse)
|
||||
{
|
||||
_condition = condition;
|
||||
_operationsThen = operationsThen;
|
||||
_operationsElse = operationsElse;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
IEnumerable<IOperation> operations = _condition.Evaluate() ? _operationsThen : _operationsElse;
|
||||
|
||||
if (operations == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (IOperation op in operations)
|
||||
{
|
||||
op.Execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
21
src/Ryujinx.HLE/HOS/Tamper/Operations/OpAdd.cs
Normal file
21
src/Ryujinx.HLE/HOS/Tamper/Operations/OpAdd.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
namespace Ryujinx.HLE.HOS.Tamper.Operations
|
||||
{
|
||||
class OpAdd<T> : IOperation where T : unmanaged
|
||||
{
|
||||
IOperand _destination;
|
||||
IOperand _lhs;
|
||||
IOperand _rhs;
|
||||
|
||||
public OpAdd(IOperand destination, IOperand lhs, IOperand rhs)
|
||||
{
|
||||
_destination = destination;
|
||||
_lhs = lhs;
|
||||
_rhs = rhs;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
_destination.Set((T)((dynamic)_lhs.Get<T>() + (dynamic)_rhs.Get<T>()));
|
||||
}
|
||||
}
|
||||
}
|
21
src/Ryujinx.HLE/HOS/Tamper/Operations/OpAnd.cs
Normal file
21
src/Ryujinx.HLE/HOS/Tamper/Operations/OpAnd.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
namespace Ryujinx.HLE.HOS.Tamper.Operations
|
||||
{
|
||||
class OpAnd<T> : IOperation where T : unmanaged
|
||||
{
|
||||
IOperand _destination;
|
||||
IOperand _lhs;
|
||||
IOperand _rhs;
|
||||
|
||||
public OpAnd(IOperand destination, IOperand lhs, IOperand rhs)
|
||||
{
|
||||
_destination = destination;
|
||||
_lhs = lhs;
|
||||
_rhs = rhs;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
_destination.Set((T)((dynamic)_lhs.Get<T>() & (dynamic)_rhs.Get<T>()));
|
||||
}
|
||||
}
|
||||
}
|
21
src/Ryujinx.HLE/HOS/Tamper/Operations/OpLog.cs
Normal file
21
src/Ryujinx.HLE/HOS/Tamper/Operations/OpLog.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
using Ryujinx.Common.Logging;
|
||||
|
||||
namespace Ryujinx.HLE.HOS.Tamper.Operations
|
||||
{
|
||||
class OpLog<T> : IOperation where T : unmanaged
|
||||
{
|
||||
int _logId;
|
||||
IOperand _source;
|
||||
|
||||
public OpLog(int logId, IOperand source)
|
||||
{
|
||||
_logId = logId;
|
||||
_source = source;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
Logger.Debug?.Print(LogClass.TamperMachine, $"Tamper debug log id={_logId} value={(dynamic)_source.Get<T>():X}");
|
||||
}
|
||||
}
|
||||
}
|
21
src/Ryujinx.HLE/HOS/Tamper/Operations/OpLsh.cs
Normal file
21
src/Ryujinx.HLE/HOS/Tamper/Operations/OpLsh.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
namespace Ryujinx.HLE.HOS.Tamper.Operations
|
||||
{
|
||||
class OpLsh<T> : IOperation where T : unmanaged
|
||||
{
|
||||
IOperand _destination;
|
||||
IOperand _lhs;
|
||||
IOperand _rhs;
|
||||
|
||||
public OpLsh(IOperand destination, IOperand lhs, IOperand rhs)
|
||||
{
|
||||
_destination = destination;
|
||||
_lhs = lhs;
|
||||
_rhs = rhs;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
_destination.Set((T)((dynamic)_lhs.Get<T>() << (dynamic)_rhs.Get<T>()));
|
||||
}
|
||||
}
|
||||
}
|
19
src/Ryujinx.HLE/HOS/Tamper/Operations/OpMov.cs
Normal file
19
src/Ryujinx.HLE/HOS/Tamper/Operations/OpMov.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
namespace Ryujinx.HLE.HOS.Tamper.Operations
|
||||
{
|
||||
class OpMov<T> : IOperation where T : unmanaged
|
||||
{
|
||||
IOperand _destination;
|
||||
IOperand _source;
|
||||
|
||||
public OpMov(IOperand destination, IOperand source)
|
||||
{
|
||||
_destination = destination;
|
||||
_source = source;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
_destination.Set(_source.Get<T>());
|
||||
}
|
||||
}
|
||||
}
|
21
src/Ryujinx.HLE/HOS/Tamper/Operations/OpMul.cs
Normal file
21
src/Ryujinx.HLE/HOS/Tamper/Operations/OpMul.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
namespace Ryujinx.HLE.HOS.Tamper.Operations
|
||||
{
|
||||
class OpMul<T> : IOperation where T : unmanaged
|
||||
{
|
||||
IOperand _destination;
|
||||
IOperand _lhs;
|
||||
IOperand _rhs;
|
||||
|
||||
public OpMul(IOperand destination, IOperand lhs, IOperand rhs)
|
||||
{
|
||||
_destination = destination;
|
||||
_lhs = lhs;
|
||||
_rhs = rhs;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
_destination.Set((T)((dynamic)_lhs.Get<T>() * (dynamic)_rhs.Get<T>()));
|
||||
}
|
||||
}
|
||||
}
|
19
src/Ryujinx.HLE/HOS/Tamper/Operations/OpNot.cs
Normal file
19
src/Ryujinx.HLE/HOS/Tamper/Operations/OpNot.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
namespace Ryujinx.HLE.HOS.Tamper.Operations
|
||||
{
|
||||
class OpNot<T> : IOperation where T : unmanaged
|
||||
{
|
||||
IOperand _destination;
|
||||
IOperand _source;
|
||||
|
||||
public OpNot(IOperand destination, IOperand source)
|
||||
{
|
||||
_destination = destination;
|
||||
_source = source;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
_destination.Set((T)(~(dynamic)_source.Get<T>()));
|
||||
}
|
||||
}
|
||||
}
|
21
src/Ryujinx.HLE/HOS/Tamper/Operations/OpOr.cs
Normal file
21
src/Ryujinx.HLE/HOS/Tamper/Operations/OpOr.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
namespace Ryujinx.HLE.HOS.Tamper.Operations
|
||||
{
|
||||
class OpOr<T> : IOperation where T : unmanaged
|
||||
{
|
||||
IOperand _destination;
|
||||
IOperand _lhs;
|
||||
IOperand _rhs;
|
||||
|
||||
public OpOr(IOperand destination, IOperand lhs, IOperand rhs)
|
||||
{
|
||||
_destination = destination;
|
||||
_lhs = lhs;
|
||||
_rhs = rhs;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
_destination.Set((T)((dynamic)_lhs.Get<T>() | (dynamic)_rhs.Get<T>()));
|
||||
}
|
||||
}
|
||||
}
|
26
src/Ryujinx.HLE/HOS/Tamper/Operations/OpProcCtrl.cs
Normal file
26
src/Ryujinx.HLE/HOS/Tamper/Operations/OpProcCtrl.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
namespace Ryujinx.HLE.HOS.Tamper.Operations
|
||||
{
|
||||
class OpProcCtrl : IOperation
|
||||
{
|
||||
private ITamperedProcess _process;
|
||||
private bool _pause;
|
||||
|
||||
public OpProcCtrl(ITamperedProcess process, bool pause)
|
||||
{
|
||||
_process = process;
|
||||
_pause = pause;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
if (_pause)
|
||||
{
|
||||
_process.PauseProcess();
|
||||
}
|
||||
else
|
||||
{
|
||||
_process.ResumeProcess();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
21
src/Ryujinx.HLE/HOS/Tamper/Operations/OpRsh.cs
Normal file
21
src/Ryujinx.HLE/HOS/Tamper/Operations/OpRsh.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
namespace Ryujinx.HLE.HOS.Tamper.Operations
|
||||
{
|
||||
class OpRsh<T> : IOperation where T : unmanaged
|
||||
{
|
||||
IOperand _destination;
|
||||
IOperand _lhs;
|
||||
IOperand _rhs;
|
||||
|
||||
public OpRsh(IOperand destination, IOperand lhs, IOperand rhs)
|
||||
{
|
||||
_destination = destination;
|
||||
_lhs = lhs;
|
||||
_rhs = rhs;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
_destination.Set((T)((dynamic)_lhs.Get<T>() >> (dynamic)_rhs.Get<T>()));
|
||||
}
|
||||
}
|
||||
}
|
21
src/Ryujinx.HLE/HOS/Tamper/Operations/OpSub.cs
Normal file
21
src/Ryujinx.HLE/HOS/Tamper/Operations/OpSub.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
namespace Ryujinx.HLE.HOS.Tamper.Operations
|
||||
{
|
||||
class OpSub<T> : IOperation where T : unmanaged
|
||||
{
|
||||
IOperand _destination;
|
||||
IOperand _lhs;
|
||||
IOperand _rhs;
|
||||
|
||||
public OpSub(IOperand destination, IOperand lhs, IOperand rhs)
|
||||
{
|
||||
_destination = destination;
|
||||
_lhs = lhs;
|
||||
_rhs = rhs;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
_destination.Set((T)((dynamic)_lhs.Get<T>() - (dynamic)_rhs.Get<T>()));
|
||||
}
|
||||
}
|
||||
}
|
21
src/Ryujinx.HLE/HOS/Tamper/Operations/OpXor.cs
Normal file
21
src/Ryujinx.HLE/HOS/Tamper/Operations/OpXor.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
namespace Ryujinx.HLE.HOS.Tamper.Operations
|
||||
{
|
||||
class OpXor<T> : IOperation where T : unmanaged
|
||||
{
|
||||
IOperand _destination;
|
||||
IOperand _lhs;
|
||||
IOperand _rhs;
|
||||
|
||||
public OpXor(IOperand destination, IOperand lhs, IOperand rhs)
|
||||
{
|
||||
_destination = destination;
|
||||
_lhs = lhs;
|
||||
_rhs = rhs;
|
||||
}
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
_destination.Set((T)((dynamic)_lhs.Get<T>() ^ (dynamic)_rhs.Get<T>()));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue