addressed comments

This commit is contained in:
emmaus 2018-06-29 21:04:49 +00:00
parent 8ee7370c8f
commit 7404d09c2c
13 changed files with 48 additions and 59 deletions

View file

@ -22,7 +22,7 @@ namespace ChocolArm64
public bool EnableCpuTrace { get; set; }
public static ManualResetEvent PauseResetEvent = new ManualResetEvent(true);
private ManualResetEvent PauseResetEvent = new ManualResetEvent(true);
public ATranslator(IReadOnlyDictionary<long, string> SymbolTable = null)
{
@ -64,7 +64,7 @@ namespace ChocolArm64
OpCode.Interpreter(State, Memory, OpCode);
PauseResetEvent.WaitOne(1000);
PauseResetEvent.WaitOne();
}
while (State.R15 != 0 && State.Running);
}
@ -209,5 +209,15 @@ namespace ChocolArm64
}
}
}
public void Pause()
{
PauseResetEvent.Reset();
}
public void Resume()
{
PauseResetEvent.Set();
}
}
}

View file

@ -2,7 +2,7 @@ using System;
namespace Ryujinx.Graphics.Gal
{
public unsafe interface IGalRenderer : IDisposable
public interface IGalRenderer : IDisposable
{
void QueueAction(Action ActionMthd);

View file

@ -23,7 +23,7 @@ namespace Ryujinx.Graphics.Gal.OpenGL
}
}
public class FrameBuffer
private class FrameBuffer
{
public int Width { get; set; }
public int Height { get; set; }

View file

@ -1,7 +1,4 @@
using System;
using System.Drawing;
using System.IO;
using System.Text;
namespace Ryujinx.HLE.Loaders.Executables
{
@ -43,12 +40,12 @@ namespace Ryujinx.HLE.Loaders.Executables
int DataSize = Reader.ReadInt32();
int BssSize = Reader.ReadInt32();
this.Mod0Offset = Mod0Offset;
this.TextOffset = TextOffset;
this.ROOffset = ROOffset;
this.DataOffset = DataOffset;
this.BssSize = BssSize;
this.FileSize = FileSize;
this.Mod0Offset = Mod0Offset;
this.TextOffset = TextOffset;
this.ROOffset = ROOffset;
this.DataOffset = DataOffset;
this.BssSize = BssSize;
this.FileSize = FileSize;
byte[] Read(long Position, int Size)
{

View file

@ -195,15 +195,7 @@ namespace Ryujinx.HLE.OsHle
if (Processes.TryRemove(ProcessId, out Process))
{
try
{
Process.StopAllThreadsAsync();
Process.Dispose();
}
catch (ObjectDisposedException Ex)
{
}
Process.StopAllThreadsAsync();
if (Processes.Count == 0)
{

View file

@ -176,7 +176,7 @@ namespace Ryujinx.HLE.OsHle
throw new ObjectDisposedException(nameof(Process));
}
ATranslator.PauseResetEvent.Reset();
Translator.Pause();
}
public void Resume()
@ -186,7 +186,7 @@ namespace Ryujinx.HLE.OsHle
throw new ObjectDisposedException(nameof(Process));
}
ATranslator.PauseResetEvent.Set();
Translator.Resume();
}
private void MapRWMemRegion(long Position, long Size, MemoryType Type)
@ -198,7 +198,7 @@ namespace Ryujinx.HLE.OsHle
{
if (Disposed)
{
throw new ObjectDisposedException(nameof(Process));
return;
}
if (MainThread != null)
@ -423,7 +423,7 @@ namespace Ryujinx.HLE.OsHle
{
if (Disposing && !Disposed)
{
ATranslator.PauseResetEvent.Set();
Translator.Resume();
//If there is still some thread running, disposing the objects is not
//safe as the thread may try to access those resources. Instead, we set

View file

@ -19,22 +19,21 @@ namespace Ryujinx.UI
public void Resume()
{
lock (Ns)
Ns.Os.ResumeAllProcesses();
Ns.Os.ResumeAllProcesses();
}
public void Pause()
{
lock (Ns)
Ns.Os.PauseAllProcesses();
Ns.Os.PauseAllProcesses();
}
public void ShutDown()
{
lock (Ns)
Ns.Dispose();
Ns = null;
Ns.Dispose();
Ns = null;
IsLoaded = false;
IsShutDown.Invoke(null,null);
}

View file

@ -45,10 +45,9 @@ namespace Ryujinx.UI
}
}
public struct LanguageEntry
{
public string AplicationName;
public string DeveloperName;
}
}
}

View file

@ -15,7 +15,6 @@ namespace Ryujinx.UI
public ControlArchive ControlArchive { get; set; }
public Nro(Stream Input, string Name) : base(Input, Name)
{
BinaryReader Reader = new BinaryReader(Input);

View file

@ -5,10 +5,8 @@ using System.Numerics;
namespace ImGuiNET
{
/// <summary>
/// Adapted from Mellinoe's file picker for imgui
/// https://github.com/mellinoe/synthapp/blob/master/src/synthapp/Widgets/FilePicker.cs
/// </summary>
// Adapted from Mellinoe's file picker for imgui
// https://github.com/mellinoe/synthapp/blob/master/src/synthapp/Widgets/FilePicker.cs
public class FilePicker
{
private const string FilePickerID = "###FilePicker";

View file

@ -61,7 +61,7 @@ namespace Ryujinx.UI.Widgets
}
}
public unsafe static Tuple<bool,string> DrawList()
public unsafe static (bool,string) DrawList()
{
uint id = 100;
@ -131,7 +131,7 @@ namespace Ryujinx.UI.Widgets
if (ImGui.IsMouseDoubleClicked(0) && ImGui.IsItemHovered(HoveredFlags.AllowWhenOverlapped) && GameItem == SelectedGame)
{
return new Tuple<bool, string>(true, GameItem.Path);
return (true, GameItem.Path);
}
else if (ImGui.IsMouseClicked(0) && ImGui.IsItemHovered(HoveredFlags.AllowWhenOverlapped | HoveredFlags.RootAndChildWindows))
{
@ -145,7 +145,7 @@ namespace Ryujinx.UI.Widgets
ImGui.EndChildFrame();
}
return new Tuple<bool, string>(false,string.Empty);
return (false, string.Empty);
}
}
@ -174,15 +174,11 @@ namespace Ryujinx.UI.Widgets
}
else
AppletType = AppletType.Cartridge;
}
}
public byte[] GetIconData()
{
if (IsNro)
{
return Nro.IconData;
}
else return null;
return IsNro ? Nro.IconData : null;
}
}

View file

@ -1,5 +1,6 @@
using ImGuiNET;
using System;
using System.Numerics;
namespace Ryujinx.UI
{
@ -7,30 +8,30 @@ namespace Ryujinx.UI
{
void RenderMainUI()
{
ImGui.SetNextWindowPos(System.Numerics.Vector2.Zero, Condition.Always,
System.Numerics.Vector2.Zero);
ImGui.SetNextWindowSize(new System.Numerics.Vector2(Width, Height), Condition.Always);
ImGui.SetNextWindowPos(Vector2.Zero, Condition.Always,
Vector2.Zero);
ImGui.SetNextWindowSize(new Vector2(Width, Height), Condition.Always);
if (ImGui.BeginWindow("MainWindow", ref showMainUI, WindowFlags.NoTitleBar
| WindowFlags.NoMove | WindowFlags.AlwaysAutoResize))
{
if (ImGui.BeginChildFrame(0, new System.Numerics.Vector2(-1, -1),
if (ImGui.BeginChildFrame(0, new Vector2(-1, -1),
WindowFlags.AlwaysAutoResize))
{
ImGuiNative.igBeginGroup();
if (ImGui.Button("Load Package", new System.Numerics.Vector2(Values.ButtonWidth,
if (ImGui.Button("Load Package", new Vector2(Values.ButtonWidth,
Values.ButtonHeight)))
{
CurrentPage = Page.PackageLoader;
}
if (ImGui.Button("Game List", new System.Numerics.Vector2(Values.ButtonWidth,
if (ImGui.Button("Game List", new Vector2(Values.ButtonWidth,
Values.ButtonHeight)))
{
CurrentPage = Page.GameList;
}
if (ImGui.Button("Settings", new System.Numerics.Vector2(Values.ButtonWidth,
if (ImGui.Button("Settings", new Vector2(Values.ButtonWidth,
Values.ButtonHeight)))
{
CurrentPage = Page.Configuration;
@ -78,7 +79,7 @@ namespace Ryujinx.UI
void DrawQuitButton()
{
if (ImGui.Button("Quit Ryujinx", new System.Numerics.Vector2(Values.ButtonWidth,
if (ImGui.Button("Quit Ryujinx", new Vector2(Values.ButtonWidth,
Values.ButtonHeight)))
{
ImGui.OpenPopup("Quit");

View file

@ -179,8 +179,6 @@ namespace Ryujinx.UI
GL.ClearColor(ClearColor.X, ClearColor.Y, ClearColor.Z, ClearColor.W);
GL.Clear(ClearBufferMask.ColorBufferBit);
// We are using the OpenGL fixed pipeline to make the example code simpler to read!
// Setup render state: alpha-blending enabled, no face culling, no depth testing, scissor enabled, vertex/texcoord/color pointers.
GL.GetInteger(GetPName.TextureBinding2D, out int last_texture);
GL.PushAttrib(AttribMask.EnableBit | AttribMask.ColorBufferBit | AttribMask.TransformBit);
GL.Enable(EnableCap.Blend);