style fixes, addressed comments

This commit is contained in:
emmaus 2018-10-05 12:19:38 +00:00
commit 39e48649e4
5 changed files with 43 additions and 29 deletions

View file

@ -150,20 +150,22 @@ namespace Ryujinx.HLE.HOS.Services.Am
return 0; return 0;
} }
// SetIdleTimeDetectionExtension(u32)
public long SetIdleTimeDetectionExtension(ServiceCtx Context) public long SetIdleTimeDetectionExtension(ServiceCtx Context)
{ {
IdleTimeDetectionExtension = Context.RequestData.ReadInt32(); IdleTimeDetectionExtension = Context.RequestData.ReadInt32();
Context.Device.Log.PrintStub(LogClass.ServiceAm, $"Stubbed. IdleTimeDetectionExtension = {IdleTimeDetectionExtension}"); Context.Device.Log.PrintStub(LogClass.ServiceAm, $"Stubbed. IdleTimeDetectionExtension: {IdleTimeDetectionExtension}");
return 0; return 0;
} }
// GetIdleTimeDetectionExtension() -> u32
public long GetIdleTimeDetectionExtension(ServiceCtx Context) public long GetIdleTimeDetectionExtension(ServiceCtx Context)
{ {
Context.ResponseData.Write(IdleTimeDetectionExtension); Context.ResponseData.Write(IdleTimeDetectionExtension);
Context.Device.Log.PrintStub(LogClass.ServiceAm, $"Stubbed. IdleTimeDetectionExtension = {IdleTimeDetectionExtension}"); Context.Device.Log.PrintStub(LogClass.ServiceAm, $"Stubbed. IdleTimeDetectionExtension: {IdleTimeDetectionExtension}");
return 0; return 0;
} }

View file

@ -38,7 +38,7 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer
private int Track; private int Track;
private bool IsStarted; private PlayState PlayState;
public IAudioRenderer( public IAudioRenderer(
Horizon System, Horizon System,
@ -48,14 +48,14 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer
{ {
m_Commands = new Dictionary<int, ServiceProcessRequest>() m_Commands = new Dictionary<int, ServiceProcessRequest>()
{ {
{ 0, GetAudioRendererSampleRate }, { 0, GetSampleRate },
{ 1, GetAudioRendererSampleCount }, { 1, GetSampleCount },
{ 2, GetAudioRendererMixBufferCount }, { 2, GetMixBufferCount },
{ 3, GetAudioRendererState }, { 3, GetState },
{ 4, RequestUpdateAudioRenderer }, { 4, RequestUpdateAudioRenderer },
{ 5, StartAudioRenderer }, { 5, StartAudioRenderer },
{ 6, StopAudioRenderer }, { 6, StopAudioRenderer },
{ 7, QuerySystemEvent } { 7, QuerySystemEvent }
}; };
UpdateEvent = new KEvent(System); UpdateEvent = new KEvent(System);
@ -75,35 +75,39 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer
InitializeAudioOut(); InitializeAudioOut();
IsStarted = false; PlayState = PlayState.Stopped;
} }
public long GetAudioRendererSampleRate(ServiceCtx Context) // GetSampleRate() -> u32
public long GetSampleRate(ServiceCtx Context)
{ {
Context.ResponseData.Write(Params.SampleRate); Context.ResponseData.Write(Params.SampleRate);
return 0; return 0;
} }
public long GetAudioRendererSampleCount(ServiceCtx Context) // GetSampleCount() -> u32
public long GetSampleCount(ServiceCtx Context)
{ {
Context.ResponseData.Write(Params.SampleCount); Context.ResponseData.Write(Params.SampleCount);
return 0; return 0;
} }
public long GetAudioRendererMixBufferCount(ServiceCtx Context) // GetMixBufferCount() -> u32
public long GetMixBufferCount(ServiceCtx Context)
{ {
Context.ResponseData.Write(Params.MixCount); Context.ResponseData.Write(Params.MixCount);
return 0; return 0;
} }
private long GetAudioRendererState(ServiceCtx Context) // GetState() -> u32
private long GetState(ServiceCtx Context)
{ {
Context.ResponseData.Write(!IsStarted); Context.ResponseData.Write((int)PlayState);
Context.Device.Log.PrintStub(LogClass.ServiceAudio, $"Stubbed. Renderer State = {(IsStarted? "Started":"Stopped")}"); Context.Device.Log.PrintStub(LogClass.ServiceAudio, $"Stubbed. Renderer State: {Enum.GetName(typeof(PlayState), PlayState)}");
return 0; return 0;
} }
@ -244,7 +248,7 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer
{ {
Context.Device.Log.PrintStub(LogClass.ServiceAudio, "Stubbed."); Context.Device.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
IsStarted = true; PlayState = PlayState.Playing;
return 0; return 0;
} }
@ -253,7 +257,7 @@ namespace Ryujinx.HLE.HOS.Services.Aud.AudioRenderer
{ {
Context.Device.Log.PrintStub(LogClass.ServiceAudio, "Stubbed."); Context.Device.Log.PrintStub(LogClass.ServiceAudio, "Stubbed.");
IsStarted = false; PlayState = PlayState.Stopped;
return 0; return 0;
} }

View file

@ -163,21 +163,26 @@ namespace Ryujinx.HLE.HOS.Services.Aud
return Result / 8; return Result / 8;
} }
// GetAudioDeviceService(nn::applet::AppletResourceUserId) -> object<nn::audio::detail::IAudioDevice>
public long GetAudioDeviceService(ServiceCtx Context) public long GetAudioDeviceService(ServiceCtx Context)
{ {
long UserId = Context.RequestData.ReadInt64(); long AppletResourceUserId = Context.RequestData.ReadInt64();
MakeObject(Context, new IAudioDevice(Context.Device.System)); MakeObject(Context, new IAudioDevice(Context.Device.System));
return 0; return 0;
} }
// GetAudioDeviceServiceWithRevisionInfo(nn::applet::AppletResourceUserId, u32) -> object<nn::audio::detail::IAudioDevice>
private long GetAudioDeviceServiceWithRevisionInfo(ServiceCtx Context) private long GetAudioDeviceServiceWithRevisionInfo(ServiceCtx Context)
{ {
Context.Device.Log.PrintStub(LogClass.ServiceAudio, "Stubbed."); long AppletResourceUserId = Context.RequestData.ReadInt64();
int RevisionInfo = Context.RequestData.ReadInt32();
Context.Device.Log.PrintStub(LogClass.ServiceAudio, $"Stubbed. AppletResourceUserId: {AppletResourceUserId} - " +
$"RevisionInfo: {RevisionInfo}");
return GetAudioDeviceService(Context); return GetAudioDeviceService(Context);
} }
} }
} }

View file

@ -23,24 +23,22 @@ namespace Ryujinx.HLE.HOS.Services.Irs
}; };
} }
// ActivateIrsensor(nn::applet::AppletResourceUserId, pid)
public long ActivateIrsensor(ServiceCtx Context) public long ActivateIrsensor(ServiceCtx Context)
{ {
long AppletResourceUserId = Context.RequestData.ReadInt64(); long AppletResourceUserId = Context.RequestData.ReadInt64();
int IrsSensorHandle = Context.RequestData.ReadInt32();
Context.Device.Log.PrintStub(LogClass.ServiceIrs, $"Stubbed. AppletResourceUserId: {AppletResourceUserId} - " + Context.Device.Log.PrintStub(LogClass.ServiceIrs, $"Stubbed. AppletResourceUserId: {AppletResourceUserId}");
$"IrsSensorHandle: {IrsSensorHandle}");
return 0; return 0;
} }
// DeactivateIrsensor(nn::applet::AppletResourceUserId, pid)
public long DeactivateIrsensor(ServiceCtx Context) public long DeactivateIrsensor(ServiceCtx Context)
{ {
long AppletResourceUserId = Context.RequestData.ReadInt64(); long AppletResourceUserId = Context.RequestData.ReadInt64();
int IrsSensorHandle = Context.RequestData.ReadInt32();
Context.Device.Log.PrintStub(LogClass.ServiceIrs, $"Stubbed. AppletResourceUserId: {AppletResourceUserId} - " + Context.Device.Log.PrintStub(LogClass.ServiceIrs, $"Stubbed. AppletResourceUserId: {AppletResourceUserId}");
$"IrsSensorHandle: {IrsSensorHandle}");
return 0; return 0;
} }

View file

@ -22,8 +22,13 @@ namespace Ryujinx.HLE.HOS.Services.Mm
}; };
} }
// InitializeOld(u32, u32, u32)
public long InitializeOld(ServiceCtx Context) public long InitializeOld(ServiceCtx Context)
{ {
int Unknown0 = Context.RequestData.ReadInt32();
int Unknown1 = Context.RequestData.ReadInt32();
int Unknown2 = Context.RequestData.ReadInt32();
Context.Device.Log.PrintStub(LogClass.ServiceMm, "Stubbed."); Context.Device.Log.PrintStub(LogClass.ServiceMm, "Stubbed.");
return 0; return 0;