Implement IIrSensorServer GetIrsensorSharedMemoryHandle (#664)

* Implement IIrSensorServer GetIrsensorSharedMemoryHandle

Resolves #620

* Set _irsSharedMem
This commit is contained in:
jduncanator 2019-04-20 12:23:13 +10:00 committed by GitHub
parent bea73895f5
commit 9e923b1473
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 5 deletions

View file

@ -30,6 +30,7 @@ namespace Ryujinx.HLE.HOS
internal const int HidSize = 0x40000;
internal const int FontSize = 0x1100000;
internal const int IirsSize = 0x8000;
private const int MemoryBlockAllocatorSize = 0x2710;
@ -81,6 +82,7 @@ namespace Ryujinx.HLE.HOS
internal KSharedMemory HidSharedMem { get; private set; }
internal KSharedMemory FontSharedMem { get; private set; }
internal KSharedMemory IirsSharedMem { get; private set; }
internal SharedFontManager Font { get; private set; }
@ -151,17 +153,21 @@ namespace Ryujinx.HLE.HOS
ulong hidPa = region.Address;
ulong fontPa = region.Address + HidSize;
ulong iirsPa = region.Address + HidSize + FontSize;
HidBaseAddress = (long)(hidPa - DramMemoryMap.DramBase);
KPageList hidPageList = new KPageList();
KPageList fontPageList = new KPageList();
KPageList iirsPageList = new KPageList();
hidPageList .AddRange(hidPa, HidSize / KMemoryManager.PageSize);
fontPageList.AddRange(fontPa, FontSize / KMemoryManager.PageSize);
iirsPageList.AddRange(iirsPa, IirsSize / KMemoryManager.PageSize);
HidSharedMem = new KSharedMemory(this, hidPageList, 0, 0, MemoryPermission.Read);
FontSharedMem = new KSharedMemory(this, fontPageList, 0, 0, MemoryPermission.Read);
IirsSharedMem = new KSharedMemory(this, iirsPageList, 0, 0, MemoryPermission.Read);
AppletState = new AppletStateMgr(this);