Initial fixes for last release of libnx

For now, the framebuffer aren't okay but it will not crash/
This commit is contained in:
Thog 2019-01-03 02:25:55 +01:00
commit e016da0402
No known key found for this signature in database
GPG key ID: 0CD291558FAFDBC6
3 changed files with 22 additions and 13 deletions

View file

@ -52,7 +52,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi
public long GetSystemDisplayService(ServiceCtx context) public long GetSystemDisplayService(ServiceCtx context)
{ {
MakeObject(context, new ISystemDisplayService()); MakeObject(context, new ISystemDisplayService(this));
return 0; return 0;
} }

View file

@ -10,13 +10,14 @@ namespace Ryujinx.HLE.HOS.Services.Vi
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => _commands; public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => _commands;
public ISystemDisplayService() public ISystemDisplayService(IApplicationDisplayService applicationDisplayService)
{ {
_commands = new Dictionary<int, ServiceProcessRequest> _commands = new Dictionary<int, ServiceProcessRequest>
{ {
{ 2205, SetLayerZ }, { 2205, SetLayerZ },
{ 2207, SetLayerVisibility }, { 2207, SetLayerVisibility },
{ 3200, GetDisplayMode } { 2312, applicationDisplayService.CreateStrayLayer },
{ 3200, GetDisplayMode }
}; };
} }

View file

@ -169,20 +169,23 @@ namespace Ryujinx.HLE.HOS.Services.Android
//TODO: Errors. //TODO: Errors.
int slot = parcelReader.ReadInt32(); int slot = parcelReader.ReadInt32();
int unknown4 = parcelReader.ReadInt32();
int unknown8 = parcelReader.ReadInt32(); int flatternedObjSize = parcelReader.ReadInt32();
int unknownC = parcelReader.ReadInt32(); int fdCount = parcelReader.ReadInt32();
int timestamp = parcelReader.ReadInt32();
int isAutoTimestamp = parcelReader.ReadInt32(); long timestamp = parcelReader.ReadInt64();
int isAutoTimestamp = parcelReader.ReadInt32();
int cropTop = parcelReader.ReadInt32(); int cropTop = parcelReader.ReadInt32();
int cropLeft = parcelReader.ReadInt32(); int cropLeft = parcelReader.ReadInt32();
int cropRight = parcelReader.ReadInt32(); int cropRight = parcelReader.ReadInt32();
int cropBottom = parcelReader.ReadInt32(); int cropBottom = parcelReader.ReadInt32();
int scalingMode = parcelReader.ReadInt32(); int scalingMode = parcelReader.ReadInt32();
int transform = parcelReader.ReadInt32(); int transform = parcelReader.ReadInt32();
int stickyTransform = parcelReader.ReadInt32(); int stickyTransform = parcelReader.ReadInt32();
int unknown34 = parcelReader.ReadInt32(); int unknown34 = parcelReader.ReadInt32();
int unknown38 = parcelReader.ReadInt32(); int swapInterval = parcelReader.ReadInt32();
int isFenceValid = parcelReader.ReadInt32(); int isFenceValid = parcelReader.ReadInt32();
int fence0Id = parcelReader.ReadInt32(); int fence0Id = parcelReader.ReadInt32();
int fence0Value = parcelReader.ReadInt32(); int fence0Value = parcelReader.ReadInt32();
@ -244,9 +247,9 @@ namespace Ryujinx.HLE.HOS.Services.Android
{ {
int slot = parcelReader.ReadInt32(); int slot = parcelReader.ReadInt32();
int bufferCount = parcelReader.ReadInt32(); bool hasInput = parcelReader.ReadInt32() == 1;
if (bufferCount > 0) if (hasInput)
{ {
long bufferSize = parcelReader.ReadInt64(); long bufferSize = parcelReader.ReadInt64();
@ -290,6 +293,11 @@ namespace Ryujinx.HLE.HOS.Services.Android
int fbHeight = _bufferQueue[slot].Data.Height; int fbHeight = _bufferQueue[slot].Data.Height;
int nvMapHandle = BitConverter.ToInt32(_bufferQueue[slot].Data.RawData, 0x4c); int nvMapHandle = BitConverter.ToInt32(_bufferQueue[slot].Data.RawData, 0x4c);
if (nvMapHandle == 0)
{
nvMapHandle = BitConverter.ToInt32(_bufferQueue[slot].Data.RawData, 0x4);
}
int bufferOffset = BitConverter.ToInt32(_bufferQueue[slot].Data.RawData, 0x50); int bufferOffset = BitConverter.ToInt32(_bufferQueue[slot].Data.RawData, 0x50);
NvMapHandle map = NvMapIoctl.GetNvMap(context, nvMapHandle); NvMapHandle map = NvMapIoctl.GetNvMap(context, nvMapHandle);