Merge pull request #9 from gdkchan/master

Working...
This commit is contained in:
Dr.Hacknik 2018-02-11 15:21:06 -05:00 committed by GitHub
commit 034f8272a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 89 additions and 7 deletions

View file

@ -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# 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. 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. 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** **Running**
To run this emulator, you need the .NET Core 2.0 (or higher) SDK. 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 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).

View file

@ -17,7 +17,7 @@ namespace Ryujinx.OsHle.Handles
ObjIds = new IdPool(); ObjIds = new IdPool();
} }
public int GenertateObjectId(object Obj) public int GenerateObjectId(object Obj)
{ {
int Id = ObjIds.GenerateId(); int Id = ObjIds.GenerateId();

View file

@ -1,6 +1,8 @@
using System;
namespace Ryujinx.OsHle.Handles namespace Ryujinx.OsHle.Handles
{ {
class HSessionObj : HSession class HSessionObj : HSession, IDisposable
{ {
public object Obj { get; private set; } public object Obj { get; private set; }
@ -8,5 +10,21 @@ namespace Ryujinx.OsHle.Handles
{ {
this.Obj = Obj; 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();
}
}
}
} }
} }

View file

@ -212,7 +212,7 @@ namespace Ryujinx.OsHle.Ipc
Ns.Os.Handles.ReplaceData(HndId, Dom); Ns.Os.Handles.ReplaceData(HndId, Dom);
return FillResponse(Response, 0, Dom.GenertateObjectId(Dom)); return FillResponse(Response, 0, Dom.GenerateObjectId(Dom));
} }
private static IpcMessage IpcDuplicateSessionEx( private static IpcMessage IpcDuplicateSessionEx(

View file

@ -9,7 +9,7 @@ namespace Ryujinx.OsHle.Objects
{ {
if (Context.Session is HDomain Dom) if (Context.Session is HDomain Dom)
{ {
Context.Response.ResponseObjIds.Add(Dom.GenertateObjectId(Obj)); Context.Response.ResponseObjIds.Add(Dom.GenerateObjectId(Obj));
} }
else else
{ {