aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Core/OsHle/Process.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2018-02-25 22:14:58 -0300
committergdkchan <gab.dark.100@gmail.com>2018-02-25 22:14:58 -0300
commit950011c90fe28fe9edd8ebe0d0a771f6adcff7a1 (patch)
tree407416f5ee2a157d06ce2fa267671b7e2d1e0946 /Ryujinx.Core/OsHle/Process.cs
parente174100474fcfe484cc8e93c4db447886096615d (diff)
Added initial support for function names from symbol table on the cpu with tracing, fix wrong ImageEnd on executables with MOD0, fix issue on the CPU on input elimination for instruction with more than one register store
Diffstat (limited to 'Ryujinx.Core/OsHle/Process.cs')
-rw-r--r--Ryujinx.Core/OsHle/Process.cs39
1 files changed, 35 insertions, 4 deletions
diff --git a/Ryujinx.Core/OsHle/Process.cs b/Ryujinx.Core/OsHle/Process.cs
index 3e265ed3..60e71ee9 100644
--- a/Ryujinx.Core/OsHle/Process.cs
+++ b/Ryujinx.Core/OsHle/Process.cs
@@ -1,6 +1,6 @@
using ChocolArm64;
+using ChocolArm64.Events;
using ChocolArm64.Memory;
-using ChocolArm64.State;
using Ryujinx.Core.Loaders;
using Ryujinx.Core.Loaders.Executables;
using Ryujinx.Core.OsHle.Exceptions;
@@ -24,6 +24,8 @@ namespace Ryujinx.Core.OsHle
private Switch Ns;
+ private ATranslator Translator;
+
public int ProcessId { get; private set; }
public AMemory Memory { get; private set; }
@@ -171,7 +173,7 @@ namespace Ryujinx.Core.OsHle
ThreadPrio = ThreadPriority.Lowest;
}
- AThread Thread = new AThread(Memory, ThreadPrio, EntryPoint);
+ AThread Thread = new AThread(GetTranslator(), Memory, ThreadPrio, EntryPoint);
HThread ThreadHnd = new HThread(Thread, ProcessorId, Priority);
@@ -201,16 +203,45 @@ namespace Ryujinx.Core.OsHle
return Handle;
}
- private void BreakHandler(object sender, AInstExceptEventArgs e)
+ private void BreakHandler(object sender, AInstExceptionEventArgs e)
{
throw new GuestBrokeExecutionException();
}
- private void UndefinedHandler(object sender, AInstUndEventArgs e)
+ private void UndefinedHandler(object sender, AInstUndefinedEventArgs e)
{
throw new UndefinedInstructionException(e.Position, e.RawOpCode);
}
+ private ATranslator GetTranslator()
+ {
+ if (Translator == null)
+ {
+ Dictionary<long, string> SymbolTable = new Dictionary<long, string>();
+
+ foreach (Executable Exe in Executables)
+ {
+ foreach (KeyValuePair<long, string> KV in Exe.SymbolTable)
+ {
+ SymbolTable.Add(Exe.ImageBase + KV.Key, KV.Value);
+ }
+ }
+
+ Translator = new ATranslator(SymbolTable);
+
+
+
+ Translator.CpuTrace += CpuTraceHandler;
+ }
+
+ return Translator;
+ }
+
+ private void CpuTraceHandler(object sender, ACpuTraceEventArgs e)
+ {
+ Logging.Info($"Executing at 0x{e.Position:x16} {e.SubName}");
+ }
+
private int GetFreeTlsSlot(AThread Thread)
{
for (int Index = 1; Index < TotalTlsSlots; Index++)