Header.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using Ryujinx.Common.Utilities;
  2. using Ryujinx.Horizon.Sdk.Sf.Cmif;
  3. namespace Ryujinx.Horizon.Sdk.Sf.Hipc
  4. {
  5. struct Header
  6. {
  7. private uint _word0;
  8. private uint _word1;
  9. public CommandType Type
  10. {
  11. get => (CommandType)_word0.Extract(0, 16);
  12. set => _word0 = _word0.Insert(0, 16, (uint)value);
  13. }
  14. public int SendStaticsCount
  15. {
  16. get => (int)_word0.Extract(16, 4);
  17. set => _word0 = _word0.Insert(16, 4, (uint)value);
  18. }
  19. public int SendBuffersCount
  20. {
  21. get => (int)_word0.Extract(20, 4);
  22. set => _word0 = _word0.Insert(20, 4, (uint)value);
  23. }
  24. public int ReceiveBuffersCount
  25. {
  26. get => (int)_word0.Extract(24, 4);
  27. set => _word0 = _word0.Insert(24, 4, (uint)value);
  28. }
  29. public int ExchangeBuffersCount
  30. {
  31. get => (int)_word0.Extract(28, 4);
  32. set => _word0 = _word0.Insert(28, 4, (uint)value);
  33. }
  34. public int DataWordsCount
  35. {
  36. get => (int)_word1.Extract(0, 10);
  37. set => _word1 = _word1.Insert(0, 10, (uint)value);
  38. }
  39. public int ReceiveStaticMode
  40. {
  41. get => (int)_word1.Extract(10, 4);
  42. set => _word1 = _word1.Insert(10, 4, (uint)value);
  43. }
  44. public int ReceiveListOffset
  45. {
  46. get => (int)_word1.Extract(20, 11);
  47. set => _word1 = _word1.Insert(20, 11, (uint)value);
  48. }
  49. public bool HasSpecialHeader
  50. {
  51. get => _word1.Extract(31);
  52. set => _word1 = _word1.Insert(31, value);
  53. }
  54. }
  55. }