diff options
| author | TSR Berry <20988865+TSRBerry@users.noreply.github.com> | 2023-04-08 01:22:00 +0200 |
|---|---|---|
| committer | Mary <thog@protonmail.com> | 2023-04-27 23:51:14 +0200 |
| commit | cee712105850ac3385cd0091a923438167433f9f (patch) | |
| tree | 4a5274b21d8b7f938c0d0ce18736d3f2993b11b1 /Ryujinx.HLE/HOS/Tamper/Operations | |
| parent | cd124bda587ef09668a971fa1cac1c3f0cfc9f21 (diff) | |
Move solution and projects to src
Diffstat (limited to 'Ryujinx.HLE/HOS/Tamper/Operations')
| -rw-r--r-- | Ryujinx.HLE/HOS/Tamper/Operations/Block.cs | 27 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Tamper/Operations/ForBlock.cs | 41 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Tamper/Operations/IOperand.cs | 8 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Tamper/Operations/IOperation.cs | 7 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Tamper/Operations/IfBlock.cs | 34 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Tamper/Operations/OpAdd.cs | 21 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Tamper/Operations/OpAnd.cs | 21 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Tamper/Operations/OpLog.cs | 21 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Tamper/Operations/OpLsh.cs | 21 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Tamper/Operations/OpMov.cs | 19 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Tamper/Operations/OpMul.cs | 21 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Tamper/Operations/OpNot.cs | 19 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Tamper/Operations/OpOr.cs | 21 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Tamper/Operations/OpProcCtrl.cs | 26 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Tamper/Operations/OpRsh.cs | 21 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Tamper/Operations/OpSub.cs | 21 | ||||
| -rw-r--r-- | Ryujinx.HLE/HOS/Tamper/Operations/OpXor.cs | 21 |
17 files changed, 0 insertions, 370 deletions
diff --git a/Ryujinx.HLE/HOS/Tamper/Operations/Block.cs b/Ryujinx.HLE/HOS/Tamper/Operations/Block.cs deleted file mode 100644 index d81daa90..00000000 --- a/Ryujinx.HLE/HOS/Tamper/Operations/Block.cs +++ /dev/null @@ -1,27 +0,0 @@ -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(); - } - } - } -} diff --git a/Ryujinx.HLE/HOS/Tamper/Operations/ForBlock.cs b/Ryujinx.HLE/HOS/Tamper/Operations/ForBlock.cs deleted file mode 100644 index ef95fa2b..00000000 --- a/Ryujinx.HLE/HOS/Tamper/Operations/ForBlock.cs +++ /dev/null @@ -1,41 +0,0 @@ -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(); - } - } - } - } -} diff --git a/Ryujinx.HLE/HOS/Tamper/Operations/IOperand.cs b/Ryujinx.HLE/HOS/Tamper/Operations/IOperand.cs deleted file mode 100644 index 1aadda0b..00000000 --- a/Ryujinx.HLE/HOS/Tamper/Operations/IOperand.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Ryujinx.HLE.HOS.Tamper.Operations -{ - interface IOperand - { - public T Get<T>() where T : unmanaged; - public void Set<T>(T value) where T : unmanaged; - } -} diff --git a/Ryujinx.HLE/HOS/Tamper/Operations/IOperation.cs b/Ryujinx.HLE/HOS/Tamper/Operations/IOperation.cs deleted file mode 100644 index a4474979..00000000 --- a/Ryujinx.HLE/HOS/Tamper/Operations/IOperation.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Ryujinx.HLE.HOS.Tamper.Operations -{ - interface IOperation - { - void Execute(); - } -} diff --git a/Ryujinx.HLE/HOS/Tamper/Operations/IfBlock.cs b/Ryujinx.HLE/HOS/Tamper/Operations/IfBlock.cs deleted file mode 100644 index b7c5684e..00000000 --- a/Ryujinx.HLE/HOS/Tamper/Operations/IfBlock.cs +++ /dev/null @@ -1,34 +0,0 @@ -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(); - } - } - } -} diff --git a/Ryujinx.HLE/HOS/Tamper/Operations/OpAdd.cs b/Ryujinx.HLE/HOS/Tamper/Operations/OpAdd.cs deleted file mode 100644 index 214518d7..00000000 --- a/Ryujinx.HLE/HOS/Tamper/Operations/OpAdd.cs +++ /dev/null @@ -1,21 +0,0 @@ -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>())); - } - } -} diff --git a/Ryujinx.HLE/HOS/Tamper/Operations/OpAnd.cs b/Ryujinx.HLE/HOS/Tamper/Operations/OpAnd.cs deleted file mode 100644 index 366a82b0..00000000 --- a/Ryujinx.HLE/HOS/Tamper/Operations/OpAnd.cs +++ /dev/null @@ -1,21 +0,0 @@ -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>())); - } - } -} diff --git a/Ryujinx.HLE/HOS/Tamper/Operations/OpLog.cs b/Ryujinx.HLE/HOS/Tamper/Operations/OpLog.cs deleted file mode 100644 index 49f8b41e..00000000 --- a/Ryujinx.HLE/HOS/Tamper/Operations/OpLog.cs +++ /dev/null @@ -1,21 +0,0 @@ -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}"); - } - } -} diff --git a/Ryujinx.HLE/HOS/Tamper/Operations/OpLsh.cs b/Ryujinx.HLE/HOS/Tamper/Operations/OpLsh.cs deleted file mode 100644 index 34e7c81a..00000000 --- a/Ryujinx.HLE/HOS/Tamper/Operations/OpLsh.cs +++ /dev/null @@ -1,21 +0,0 @@ -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>())); - } - } -} diff --git a/Ryujinx.HLE/HOS/Tamper/Operations/OpMov.cs b/Ryujinx.HLE/HOS/Tamper/Operations/OpMov.cs deleted file mode 100644 index 5fad38f9..00000000 --- a/Ryujinx.HLE/HOS/Tamper/Operations/OpMov.cs +++ /dev/null @@ -1,19 +0,0 @@ -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>()); - } - } -} diff --git a/Ryujinx.HLE/HOS/Tamper/Operations/OpMul.cs b/Ryujinx.HLE/HOS/Tamper/Operations/OpMul.cs deleted file mode 100644 index 5aa0e34e..00000000 --- a/Ryujinx.HLE/HOS/Tamper/Operations/OpMul.cs +++ /dev/null @@ -1,21 +0,0 @@ -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>())); - } - } -} diff --git a/Ryujinx.HLE/HOS/Tamper/Operations/OpNot.cs b/Ryujinx.HLE/HOS/Tamper/Operations/OpNot.cs deleted file mode 100644 index 8a97c3fe..00000000 --- a/Ryujinx.HLE/HOS/Tamper/Operations/OpNot.cs +++ /dev/null @@ -1,19 +0,0 @@ -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>())); - } - } -} diff --git a/Ryujinx.HLE/HOS/Tamper/Operations/OpOr.cs b/Ryujinx.HLE/HOS/Tamper/Operations/OpOr.cs deleted file mode 100644 index d074de1c..00000000 --- a/Ryujinx.HLE/HOS/Tamper/Operations/OpOr.cs +++ /dev/null @@ -1,21 +0,0 @@ -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>())); - } - } -} diff --git a/Ryujinx.HLE/HOS/Tamper/Operations/OpProcCtrl.cs b/Ryujinx.HLE/HOS/Tamper/Operations/OpProcCtrl.cs deleted file mode 100644 index 1b89f450..00000000 --- a/Ryujinx.HLE/HOS/Tamper/Operations/OpProcCtrl.cs +++ /dev/null @@ -1,26 +0,0 @@ -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(); - } - } - } -} diff --git a/Ryujinx.HLE/HOS/Tamper/Operations/OpRsh.cs b/Ryujinx.HLE/HOS/Tamper/Operations/OpRsh.cs deleted file mode 100644 index b08dd957..00000000 --- a/Ryujinx.HLE/HOS/Tamper/Operations/OpRsh.cs +++ /dev/null @@ -1,21 +0,0 @@ -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>())); - } - } -} diff --git a/Ryujinx.HLE/HOS/Tamper/Operations/OpSub.cs b/Ryujinx.HLE/HOS/Tamper/Operations/OpSub.cs deleted file mode 100644 index b9c67d04..00000000 --- a/Ryujinx.HLE/HOS/Tamper/Operations/OpSub.cs +++ /dev/null @@ -1,21 +0,0 @@ -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>())); - } - } -} diff --git a/Ryujinx.HLE/HOS/Tamper/Operations/OpXor.cs b/Ryujinx.HLE/HOS/Tamper/Operations/OpXor.cs deleted file mode 100644 index 3bbb76a1..00000000 --- a/Ryujinx.HLE/HOS/Tamper/Operations/OpXor.cs +++ /dev/null @@ -1,21 +0,0 @@ -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>())); - } - } -} |
