aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/Exceptions
diff options
context:
space:
mode:
authorTSR Berry <20988865+TSRBerry@users.noreply.github.com>2023-04-08 01:22:00 +0200
committerMary <thog@protonmail.com>2023-04-27 23:51:14 +0200
commitcee712105850ac3385cd0091a923438167433f9f (patch)
tree4a5274b21d8b7f938c0d0ce18736d3f2993b11b1 /Ryujinx.HLE/Exceptions
parentcd124bda587ef09668a971fa1cac1c3f0cfc9f21 (diff)
Move solution and projects to src
Diffstat (limited to 'Ryujinx.HLE/Exceptions')
-rw-r--r--Ryujinx.HLE/Exceptions/GuestBrokeExecutionException.cs11
-rw-r--r--Ryujinx.HLE/Exceptions/InternalServiceException.cs9
-rw-r--r--Ryujinx.HLE/Exceptions/InvalidFirmwarePackageException.cs9
-rw-r--r--Ryujinx.HLE/Exceptions/InvalidNpdmException.cs9
-rw-r--r--Ryujinx.HLE/Exceptions/InvalidStructLayoutException.cs15
-rw-r--r--Ryujinx.HLE/Exceptions/InvalidSystemResourceException.cs9
-rw-r--r--Ryujinx.HLE/Exceptions/ServiceNotImplementedException.cs164
-rw-r--r--Ryujinx.HLE/Exceptions/TamperCompilationException.cs9
-rw-r--r--Ryujinx.HLE/Exceptions/TamperExecutionException.cs9
-rw-r--r--Ryujinx.HLE/Exceptions/UndefinedInstructionException.cs13
10 files changed, 0 insertions, 257 deletions
diff --git a/Ryujinx.HLE/Exceptions/GuestBrokeExecutionException.cs b/Ryujinx.HLE/Exceptions/GuestBrokeExecutionException.cs
deleted file mode 100644
index fe41b02a..00000000
--- a/Ryujinx.HLE/Exceptions/GuestBrokeExecutionException.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System;
-
-namespace Ryujinx.HLE.Exceptions
-{
- public class GuestBrokeExecutionException : Exception
- {
- private const string ExMsg = "The guest program broke execution!";
-
- public GuestBrokeExecutionException() : base(ExMsg) { }
- }
-} \ No newline at end of file
diff --git a/Ryujinx.HLE/Exceptions/InternalServiceException.cs b/Ryujinx.HLE/Exceptions/InternalServiceException.cs
deleted file mode 100644
index 85de63a6..00000000
--- a/Ryujinx.HLE/Exceptions/InternalServiceException.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System;
-
-namespace Ryujinx.HLE.Exceptions
-{
- class InternalServiceException: Exception
- {
- public InternalServiceException(string message) : base(message) { }
- }
-} \ No newline at end of file
diff --git a/Ryujinx.HLE/Exceptions/InvalidFirmwarePackageException.cs b/Ryujinx.HLE/Exceptions/InvalidFirmwarePackageException.cs
deleted file mode 100644
index d08de581..00000000
--- a/Ryujinx.HLE/Exceptions/InvalidFirmwarePackageException.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System;
-
-namespace Ryujinx.HLE.Exceptions
-{
- class InvalidFirmwarePackageException : Exception
- {
- public InvalidFirmwarePackageException(string message) : base(message) { }
- }
-} \ No newline at end of file
diff --git a/Ryujinx.HLE/Exceptions/InvalidNpdmException.cs b/Ryujinx.HLE/Exceptions/InvalidNpdmException.cs
deleted file mode 100644
index 98675e42..00000000
--- a/Ryujinx.HLE/Exceptions/InvalidNpdmException.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System;
-
-namespace Ryujinx.HLE.Exceptions
-{
- public class InvalidNpdmException : Exception
- {
- public InvalidNpdmException(string message) : base(message) { }
- }
-} \ No newline at end of file
diff --git a/Ryujinx.HLE/Exceptions/InvalidStructLayoutException.cs b/Ryujinx.HLE/Exceptions/InvalidStructLayoutException.cs
deleted file mode 100644
index 2f03d13a..00000000
--- a/Ryujinx.HLE/Exceptions/InvalidStructLayoutException.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-using System;
-using System.Runtime.CompilerServices;
-
-namespace Ryujinx.HLE.Exceptions
-{
- public class InvalidStructLayoutException<T> : Exception
- {
- static readonly Type _structType = typeof(T);
-
- public InvalidStructLayoutException(string message) : base(message) { }
-
- public InvalidStructLayoutException(int expectedSize)
- : base($"Type {_structType.Name} has the wrong size. Expected: {expectedSize} bytes, got: {Unsafe.SizeOf<T>()} bytes") { }
- }
-} \ No newline at end of file
diff --git a/Ryujinx.HLE/Exceptions/InvalidSystemResourceException.cs b/Ryujinx.HLE/Exceptions/InvalidSystemResourceException.cs
deleted file mode 100644
index 3c63e064..00000000
--- a/Ryujinx.HLE/Exceptions/InvalidSystemResourceException.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System;
-
-namespace Ryujinx.HLE.Exceptions
-{
- public class InvalidSystemResourceException : Exception
- {
- public InvalidSystemResourceException(string message) : base(message) { }
- }
-} \ No newline at end of file
diff --git a/Ryujinx.HLE/Exceptions/ServiceNotImplementedException.cs b/Ryujinx.HLE/Exceptions/ServiceNotImplementedException.cs
deleted file mode 100644
index 40b19cc8..00000000
--- a/Ryujinx.HLE/Exceptions/ServiceNotImplementedException.cs
+++ /dev/null
@@ -1,164 +0,0 @@
-using Ryujinx.Common;
-using Ryujinx.HLE.HOS;
-using Ryujinx.HLE.HOS.Ipc;
-using Ryujinx.HLE.HOS.Services;
-using System;
-using System.Diagnostics;
-using System.Linq;
-using System.Reflection;
-using System.Runtime.Serialization;
-using System.Text;
-
-namespace Ryujinx.HLE.Exceptions
-{
- [Serializable]
- internal class ServiceNotImplementedException : Exception
- {
- public IpcService Service { get; }
- public ServiceCtx Context { get; }
- public IpcMessage Request { get; }
-
- public ServiceNotImplementedException(IpcService service, ServiceCtx context)
- : this(service, context, "The service call is not implemented.") { }
-
- public ServiceNotImplementedException(IpcService service, ServiceCtx context, string message) : base(message)
- {
- Service = service;
- Context = context;
- Request = context.Request;
- }
-
- public ServiceNotImplementedException(IpcService service, ServiceCtx context, string message, Exception inner) : base(message, inner)
- {
- Service = service;
- Context = context;
- Request = context.Request;
- }
-
- protected ServiceNotImplementedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
-
- public override string Message
- {
- get
- {
- return base.Message + Environment.NewLine + Environment.NewLine + BuildMessage();
- }
- }
-
- private string BuildMessage()
- {
- StringBuilder sb = new StringBuilder();
-
- // Print the IPC command details (service name, command ID, and handler)
- (Type callingType, MethodBase callingMethod) = WalkStackTrace(new StackTrace(this));
-
- if (callingType != null && callingMethod != null)
- {
- // If the type is past 0xF, we are using TIPC
- var ipcCommands = Request.Type > IpcMessageType.TipcCloseSession ? Service.TipcCommands : Service.CmifCommands;
-
- // Find the handler for the method called
- var ipcHandler = ipcCommands.FirstOrDefault(x => x.Value == callingMethod);
- var ipcCommandId = ipcHandler.Key;
- var ipcMethod = ipcHandler.Value;
-
- if (ipcMethod != null)
- {
- sb.AppendLine($"Service Command: {Service.GetType().FullName}: {ipcCommandId} ({ipcMethod.Name})");
- sb.AppendLine();
- }
- }
-
- sb.AppendLine("Guest Stack Trace:");
- sb.AppendLine(Context.Thread.GetGuestStackTrace());
-
- // Print buffer information
- if (Request.PtrBuff.Count > 0 ||
- Request.SendBuff.Count > 0 ||
- Request.ReceiveBuff.Count > 0 ||
- Request.ExchangeBuff.Count > 0 ||
- Request.RecvListBuff.Count > 0)
- {
- sb.AppendLine("Buffer Information:");
-
- if (Request.PtrBuff.Count > 0)
- {
- sb.AppendLine("\tPtrBuff:");
-
- foreach (var buff in Request.PtrBuff)
- {
- sb.AppendLine($"\t[{buff.Index}] Position: 0x{buff.Position:x16} Size: 0x{buff.Size:x16}");
- }
- }
-
- if (Request.SendBuff.Count > 0)
- {
- sb.AppendLine("\tSendBuff:");
-
- foreach (var buff in Request.SendBuff)
- {
- sb.AppendLine($"\tPosition: 0x{buff.Position:x16} Size: 0x{buff.Size:x16} Flags: {buff.Flags}");
- }
- }
-
- if (Request.ReceiveBuff.Count > 0)
- {
- sb.AppendLine("\tReceiveBuff:");
-
- foreach (var buff in Request.ReceiveBuff)
- {
- sb.AppendLine($"\tPosition: 0x{buff.Position:x16} Size: 0x{buff.Size:x16} Flags: {buff.Flags}");
- }
- }
-
- if (Request.ExchangeBuff.Count > 0)
- {
- sb.AppendLine("\tExchangeBuff:");
-
- foreach (var buff in Request.ExchangeBuff)
- {
- sb.AppendLine($"\tPosition: 0x{buff.Position:x16} Size: 0x{buff.Size:x16} Flags: {buff.Flags}");
- }
- }
-
- if (Request.RecvListBuff.Count > 0)
- {
- sb.AppendLine("\tRecvListBuff:");
-
- foreach (var buff in Request.RecvListBuff)
- {
- sb.AppendLine($"\tPosition: 0x{buff.Position:x16} Size: 0x{buff.Size:x16}");
- }
- }
-
- sb.AppendLine();
- }
-
- sb.AppendLine("Raw Request Data:");
- sb.Append(HexUtils.HexTable(Request.RawData));
-
- return sb.ToString();
- }
-
- private static (Type, MethodBase) WalkStackTrace(StackTrace trace)
- {
- int i = 0;
-
- StackFrame frame;
-
- // Find the IIpcService method that threw this exception
- while ((frame = trace.GetFrame(i++)) != null)
- {
- var method = frame.GetMethod();
- var declType = method.DeclaringType;
-
- if (typeof(IpcService).IsAssignableFrom(declType))
- {
- return (declType, method);
- }
- }
-
- return (null, null);
- }
- }
-} \ No newline at end of file
diff --git a/Ryujinx.HLE/Exceptions/TamperCompilationException.cs b/Ryujinx.HLE/Exceptions/TamperCompilationException.cs
deleted file mode 100644
index 02d87163..00000000
--- a/Ryujinx.HLE/Exceptions/TamperCompilationException.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System;
-
-namespace Ryujinx.HLE.Exceptions
-{
- public class TamperCompilationException : Exception
- {
- public TamperCompilationException(string message) : base(message) { }
- }
-} \ No newline at end of file
diff --git a/Ryujinx.HLE/Exceptions/TamperExecutionException.cs b/Ryujinx.HLE/Exceptions/TamperExecutionException.cs
deleted file mode 100644
index d62effe3..00000000
--- a/Ryujinx.HLE/Exceptions/TamperExecutionException.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using System;
-
-namespace Ryujinx.HLE.Exceptions
-{
- public class TamperExecutionException : Exception
- {
- public TamperExecutionException(string message) : base(message) { }
- }
-} \ No newline at end of file
diff --git a/Ryujinx.HLE/Exceptions/UndefinedInstructionException.cs b/Ryujinx.HLE/Exceptions/UndefinedInstructionException.cs
deleted file mode 100644
index dfbd6c27..00000000
--- a/Ryujinx.HLE/Exceptions/UndefinedInstructionException.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using System;
-
-namespace Ryujinx.HLE.Exceptions
-{
- public class UndefinedInstructionException : Exception
- {
- private const string ExMsg = "The instruction at 0x{0:x16} (opcode 0x{1:x8}) is undefined!";
-
- public UndefinedInstructionException() : base() { }
-
- public UndefinedInstructionException(ulong address, int opCode) : base(string.Format(ExMsg, address, opCode)) { }
- }
-} \ No newline at end of file