From 2f2b60db4cc687a86cc2cc5aa9bbe5fcf202dc9b Mon Sep 17 00:00:00 2001 From: Stary 2001 Date: Sat, 10 Feb 2018 18:31:40 +0000 Subject: [PATCH 1/2] Make HSessionObj implement IDisposable (#10) * Make HSessionObj implement IDisposable, so that objects that have handles created to them are disposed when the handles are closed. * Spelling fix: GenertateObjectId -> GenerateObjectId --- Ryujinx/OsHle/Handles/HDomain.cs | 2 +- Ryujinx/OsHle/Handles/HSessionObj.cs | 20 +++++++++++++++++++- Ryujinx/OsHle/Ipc/IpcHandler.cs | 2 +- Ryujinx/OsHle/Objects/ObjHelper.cs | 2 +- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Ryujinx/OsHle/Handles/HDomain.cs b/Ryujinx/OsHle/Handles/HDomain.cs index fd252f5d7..e781602a1 100644 --- a/Ryujinx/OsHle/Handles/HDomain.cs +++ b/Ryujinx/OsHle/Handles/HDomain.cs @@ -17,7 +17,7 @@ namespace Ryujinx.OsHle.Handles ObjIds = new IdPool(); } - public int GenertateObjectId(object Obj) + public int GenerateObjectId(object Obj) { int Id = ObjIds.GenerateId(); diff --git a/Ryujinx/OsHle/Handles/HSessionObj.cs b/Ryujinx/OsHle/Handles/HSessionObj.cs index c1e5e41a4..d2b2b0d78 100644 --- a/Ryujinx/OsHle/Handles/HSessionObj.cs +++ b/Ryujinx/OsHle/Handles/HSessionObj.cs @@ -1,6 +1,8 @@ +using System; + namespace Ryujinx.OsHle.Handles { - class HSessionObj : HSession + class HSessionObj : HSession, IDisposable { public object Obj { get; private set; } @@ -8,5 +10,21 @@ namespace Ryujinx.OsHle.Handles { this.Obj = Obj; } + + public void Dispose() + { + Dispose(true); + } + + protected virtual void Dispose(bool Disposing) + { + if(Disposing && Obj != null) + { + if(Obj is IDisposable DisposableObj) + { + DisposableObj.Dispose(); + } + } + } } } \ No newline at end of file diff --git a/Ryujinx/OsHle/Ipc/IpcHandler.cs b/Ryujinx/OsHle/Ipc/IpcHandler.cs index ff90d873b..c373d2cef 100644 --- a/Ryujinx/OsHle/Ipc/IpcHandler.cs +++ b/Ryujinx/OsHle/Ipc/IpcHandler.cs @@ -212,7 +212,7 @@ namespace Ryujinx.OsHle.Ipc Ns.Os.Handles.ReplaceData(HndId, Dom); - return FillResponse(Response, 0, Dom.GenertateObjectId(Dom)); + return FillResponse(Response, 0, Dom.GenerateObjectId(Dom)); } private static IpcMessage IpcDuplicateSessionEx( diff --git a/Ryujinx/OsHle/Objects/ObjHelper.cs b/Ryujinx/OsHle/Objects/ObjHelper.cs index e37f5320e..bab222032 100644 --- a/Ryujinx/OsHle/Objects/ObjHelper.cs +++ b/Ryujinx/OsHle/Objects/ObjHelper.cs @@ -9,7 +9,7 @@ namespace Ryujinx.OsHle.Objects { if (Context.Session is HDomain Dom) { - Context.Response.ResponseObjIds.Add(Dom.GenertateObjectId(Obj)); + Context.Response.ResponseObjIds.Add(Dom.GenerateObjectId(Obj)); } else { From 9e8d99f30deb4872fb5507c6d1d7fdaf6d1ea638 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sat, 10 Feb 2018 17:51:07 -0200 Subject: [PATCH 2/2] Update README.md --- README.md | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 857ba6804..873e4e703 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,77 @@ -# Ryujinx +# Ryujinx [![Build status](https://ci.appveyor.com/api/projects/status/ssg4jwu6ve3k594s?svg=true)](https://ci.appveyor.com/project/gdkchan/ryujinx) + Experimental Switch emulator written in C# Don't expect much from this. Some homebrew apps works, and Tetris shows the intro logos (sometimes) but that's about it for now. Contributions are always welcome. +**Building** + +To build this emulator, you need the .NET Core 2.0 (or higher) SDK. https://www.microsoft.com/net/download/ +In release builds, memory checks are disabled to improve performances. + +Or just drag'n'drop the *.NRO or the game folder on the executable if you have a pre-build version. + +**Features** + + - Audio is partially supported (glitched) on Windows but you need to install the OpenAL Core SDK. +https://openal.org/downloads/OpenAL11CoreSDK.zip + + - Keyboard Input is partially supported: + - Arrows. + - Enter > "Start" & Tab > "Select" + - Qwerty: + - A > "A" + - S > "B" + - Z > "X" + - X > "Y" + - Azerty: + - Q > "A" + - S > "B" + - W > "X" + - X > "Y" + + - Config File: `Ryujinx.conf` should be present on executable folder. + - Logging_Enable_Info (bool) + Enable the Informations Logging. + + - Logging_Enable_Trace (bool) + Enable the Trace Logging (Enabled in Debug recommanded). + + - Logging_Enable_Debug (bool) + Enable the Debug Logging (Enabled in Debug recommanded). + + - Logging_Enable_Warn (bool) + Enable the Warning Logging (Enabled in Debug recommanded). + + - Logging_Enable_Error (bool) + Enable the Error Logging (Enabled in Debug recommanded). + + - Logging_Enable_Fatal (bool) + Enable the Fatal Logging (Enabled in Debug recommanded). + + - Logging_Enable_LogFile (bool) + Enable writing the logging inside a Ryujinx.log file. + +**Help** + +If you have some homebrews that currently doesn't work on it, you can contact us through discord with the compiled NRO/NSO (and source code if possible) and will work to make them work. + +**Contact** + +For help, support, suggestion, or if you just want to get in touch with the team, join our Discord served! +https://discord.gg/VkQYXAZ + **Running** To run this emulator, you need the .NET Core 2.0 (or higher) SDK. -Run `dotnet run -c Release -- game.nro` inside the Ryujinx solution folder. +Run `dotnet run -c Release -- path\to\homebrew.nro` inside the Ryujinx solution folder to run homebrew apps. +Run `dotnet run -c Release -- path\to\game_exefs_and_romfs_folder` to run official games (they need to be decrypted and extracted first!). -Audio is partially supported (glitched) on Windows, you need to install the OpenAL Core SDK : +Audio is partially supported (glitched) on Windows, you need to install the OpenAL Core SDK: https://openal.org/downloads/OpenAL11CoreSDK.zip + +**Lastest build** + +Those builds are compiled automatically for each commit on the master branch. They may be unstable or not work at all. +To download the lastest automatic build for Windows (64-bits), [Click Here](https://ci.appveyor.com/api/projects/gdkchan/ryujinx/artifacts/ryujinx_lastest_unstable.zip).