2018-11-17 04:01:31 +00:00
|
|
|
namespace Ryujinx.Graphics
|
|
|
|
{
|
2019-12-31 20:08:20 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Method call parameters.
|
|
|
|
/// </summary>
|
2019-10-13 06:02:07 +00:00
|
|
|
struct MethodParams
|
2018-11-17 04:01:31 +00:00
|
|
|
{
|
2019-12-31 20:08:20 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Method offset.
|
|
|
|
/// </summary>
|
|
|
|
public int Method { get; }
|
2018-11-17 04:01:31 +00:00
|
|
|
|
2019-12-31 20:08:20 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Method call argument.
|
|
|
|
/// </summary>
|
|
|
|
public int Argument { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Sub-channel where the call should be sent.
|
|
|
|
/// </summary>
|
|
|
|
public int SubChannel { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// For multiple calls to the same method, this is the remaining calls count.
|
|
|
|
/// </summary>
|
|
|
|
public int MethodCount { get; }
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Indicates if the current call is the last one from a batch of calls to the same method.
|
|
|
|
/// </summary>
|
2018-11-17 04:01:31 +00:00
|
|
|
public bool IsLastCall => MethodCount <= 1;
|
|
|
|
|
2019-12-31 20:08:20 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Constructs the method call parameters structure.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="method">Method offset</param>
|
|
|
|
/// <param name="argument">Method call argument</param>
|
|
|
|
/// <param name="subChannel">Optional sub-channel where the method should be sent (not required for macro calls)</param>
|
|
|
|
/// <param name="methodCount">Optional remaining calls count (not required for macro calls)</param>
|
2019-10-13 06:02:07 +00:00
|
|
|
public MethodParams(
|
2019-03-04 01:45:25 +00:00
|
|
|
int method,
|
|
|
|
int argument,
|
|
|
|
int subChannel = 0,
|
|
|
|
int methodCount = 0)
|
2018-11-17 04:01:31 +00:00
|
|
|
{
|
2019-03-04 01:45:25 +00:00
|
|
|
Method = method;
|
|
|
|
Argument = argument;
|
|
|
|
SubChannel = subChannel;
|
|
|
|
MethodCount = methodCount;
|
2018-11-17 04:01:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|