Add internal Logging support (#3)

* Add internal Logging support

Add class Logging.
Replace all Console.WriteLine() to looks better.
Add informations inside Windows Titles.

* Revert "Add internal Logging support"

This reverts commit 275d363aaf30011f238010572cfdb320bd7b627f.

* Add internal Logging support

Add Logging Class.
Replace all Console.WriteLine() to looks better.
Add debug informations of IpcMessage.
Add informations inside Windows Titles.

* Add internal Logging support2

Add Logging Class.
Replace all Console.WriteLine() to looks better.
Add debug informations of IpcMessage.
Add informations inside Windows Titles.
This commit is contained in:
Ac_K 2018-02-09 01:43:22 +01:00 committed by gdkchan
parent ae91da5b60
commit 9e8f02b66d
7 changed files with 150 additions and 17 deletions

View file

@ -22,7 +22,7 @@ namespace Ryujinx.OsHle.Objects
//IAudioOut
private static AudioOutState State = AudioOutState.Stopped;
private static List<long> KeysQueue = new List<long>();
private static Queue<long> KeysQueue = new Queue<long>();
//OpenAL
private static bool OpenALInstalled = true;
@ -48,9 +48,9 @@ namespace Ryujinx.OsHle.Objects
{
AudioCtx = new AudioContext(); //Create the audio context
}
catch (Exception ex)
catch (Exception)
{
Console.WriteLine("OpenAL Error! PS: Install OpenAL Core SDK!");
Logging.Warning("OpenAL Error! PS: Install OpenAL Core SDK!");
OpenALInstalled = false;
}
@ -82,7 +82,7 @@ namespace Ryujinx.OsHle.Objects
{
long BufferId = Context.RequestData.ReadInt64();
KeysQueue.Insert(0, BufferId);
KeysQueue.Enqueue(BufferId);
byte[] AudioOutBuffer = AMemoryHelper.ReadBytes(Context.Memory, Context.Request.SendBuff[0].Position, 0x28);
using (MemoryStream MS = new MemoryStream(AudioOutBuffer))
@ -125,13 +125,9 @@ namespace Ryujinx.OsHle.Objects
{
long TempKey = 0;
if (KeysQueue.Count > 0)
{
TempKey = KeysQueue[KeysQueue.Count - 1];
KeysQueue.Remove(KeysQueue[KeysQueue.Count - 1]);
}
if (KeysQueue.Count > 0) TempKey = KeysQueue.Dequeue();
AMemoryHelper.WriteBytes(Context.Memory, Context.Request.ReceiveBuff[0].Position, System.BitConverter.GetBytes(TempKey));
AMemoryHelper.WriteBytes(Context.Memory, Context.Request.ReceiveBuff[0].Position, BitConverter.GetBytes(TempKey));
Context.ResponseData.Write((int)TempKey);