MethodParams.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. namespace Ryujinx.Graphics
  2. {
  3. /// <summary>
  4. /// Method call parameters.
  5. /// </summary>
  6. struct MethodParams
  7. {
  8. /// <summary>
  9. /// Method offset.
  10. /// </summary>
  11. public int Method { get; }
  12. /// <summary>
  13. /// Method call argument.
  14. /// </summary>
  15. public int Argument { get; }
  16. /// <summary>
  17. /// Sub-channel where the call should be sent.
  18. /// </summary>
  19. public int SubChannel { get; }
  20. /// <summary>
  21. /// For multiple calls to the same method, this is the remaining calls count.
  22. /// </summary>
  23. public int MethodCount { get; }
  24. /// <summary>
  25. /// Indicates if the current call is the last one from a batch of calls to the same method.
  26. /// </summary>
  27. public bool IsLastCall => MethodCount <= 1;
  28. /// <summary>
  29. /// Constructs the method call parameters structure.
  30. /// </summary>
  31. /// <param name="method">Method offset</param>
  32. /// <param name="argument">Method call argument</param>
  33. /// <param name="subChannel">Optional sub-channel where the method should be sent (not required for macro calls)</param>
  34. /// <param name="methodCount">Optional remaining calls count (not required for macro calls)</param>
  35. public MethodParams(
  36. int method,
  37. int argument,
  38. int subChannel = 0,
  39. int methodCount = 0)
  40. {
  41. Method = method;
  42. Argument = argument;
  43. SubChannel = subChannel;
  44. MethodCount = methodCount;
  45. }
  46. }
  47. }