HipcStaticDescriptor.cs 689 B

12345678910111213141516171819202122
  1. namespace Ryujinx.Horizon.Sdk.Sf.Hipc
  2. {
  3. struct HipcStaticDescriptor
  4. {
  5. private readonly ulong _data;
  6. public ulong Address => ((((_data >> 2) & 0x70) | ((_data >> 12) & 0xf)) << 32) | (_data >> 32);
  7. public ushort Size => (ushort)(_data >> 16);
  8. public int ReceiveIndex => (int)(_data & 0xf);
  9. public HipcStaticDescriptor(ulong address, ushort size, int receiveIndex)
  10. {
  11. ulong data = (uint)(receiveIndex & 0xf) | ((uint)size << 16);
  12. data |= address << 32;
  13. data |= (address >> 20) & 0xf000;
  14. data |= (address >> 30) & 0xffc0;
  15. _data = data;
  16. }
  17. }
  18. }