Refactoring HOS folder structure (#771)

* Refactoring HOS folder structure

Refactoring HOS folder structure:

- Added some subfolders when needed (Following structure decided in private).
- Added some `Types` folders when needed.
- Little cleanup here and there.
- Add services placeholders for every HOS services (close #766 and #753).

* Remove Types namespaces
This commit is contained in:
Ac_K 2019-09-19 02:45:11 +02:00 committed by jduncanator
parent 4af3101b22
commit a0720b5681
393 changed files with 2540 additions and 1299 deletions

View file

@ -1,10 +1,11 @@
using System;
using Ryujinx.Common;
using Ryujinx.HLE.Utilities;
using System;
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
using Ryujinx.Common;
using Ryujinx.HLE.Utilities;
using static Ryujinx.HLE.HOS.Services.Time.TimeZoneRule;
using static Ryujinx.HLE.HOS.Services.Time.TimeZone.TimeZoneRule;
namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
{
@ -238,9 +239,8 @@ namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
{
seconds = 0;
int num;
bool isValid = GetNum(name, ref namePosition, out num, 0, HoursPerDays * DaysPerWekk - 1);
bool isValid = GetNum(name, ref namePosition, out int num, 0, HoursPerDays * DaysPerWekk - 1);
if (!isValid)
{
return false;

View file

@ -1,15 +1,15 @@
using LibHac.Fs.NcaUtils;
using LibHac.Fs;
using LibHac.Fs.NcaUtils;
using Ryujinx.Common.Logging;
using Ryujinx.HLE.FileSystem;
using System;
using System.Collections.ObjectModel;
using LibHac.Fs;
using System.IO;
using System.Collections.Generic;
using TimeZoneConverter.Posix;
using System.Collections.ObjectModel;
using System.IO;
using TimeZoneConverter;
using TimeZoneConverter.Posix;
using static Ryujinx.HLE.HOS.Services.Time.TimeZoneRule;
using static Ryujinx.HLE.HOS.Services.Time.TimeZone.TimeZoneRule;
namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
{

View file

@ -0,0 +1,22 @@
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
{
[StructLayout(LayoutKind.Sequential, Pack = 0x4, Size = 0x18, CharSet = CharSet.Ansi)]
struct CalendarAdditionalInfo
{
public uint DayOfWeek;
public uint DayOfYear;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public char[] TimezoneName;
[MarshalAs(UnmanagedType.I1)]
public bool IsDaySavingTime;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public char[] Padding;
public int GmtOffset;
}
}

View file

@ -0,0 +1,11 @@
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
{
[StructLayout(LayoutKind.Sequential, Pack = 0x4, Size = 0x20, CharSet = CharSet.Ansi)]
struct CalendarInfo
{
public CalendarTime Time;
public CalendarAdditionalInfo AdditionalInfo;
}
}

View file

@ -0,0 +1,15 @@
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
{
[StructLayout(LayoutKind.Sequential, Pack = 0x4, Size = 0x8)]
struct CalendarTime
{
public short Year;
public sbyte Month;
public sbyte Day;
public sbyte Hour;
public sbyte Minute;
public sbyte Second;
}
}

View file

@ -0,0 +1,27 @@
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
{
[StructLayout(LayoutKind.Sequential, Size = 0x10, Pack = 4)]
struct TimeTypeInfo
{
public int GmtOffset;
[MarshalAs(UnmanagedType.I1)]
public bool IsDaySavingTime;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public char[] Padding1;
public int AbbreviationListIndex;
[MarshalAs(UnmanagedType.I1)]
public bool IsStandardTimeDaylight;
[MarshalAs(UnmanagedType.I1)]
public bool IsGMT;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public char[] Padding2;
}
}

View file

@ -0,0 +1,39 @@
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
{
[StructLayout(LayoutKind.Sequential, Pack = 4, Size = 0x4000, CharSet = CharSet.Ansi)]
struct TimeZoneRule
{
public const int TzMaxTypes = 128;
public const int TzMaxChars = 50;
public const int TzMaxLeaps = 50;
public const int TzMaxTimes = 1000;
public const int TzNameMax = 255;
public const int TzCharsArraySize = 2 * (TzNameMax + 1);
public int TimeCount;
public int TypeCount;
public int CharCount;
[MarshalAs(UnmanagedType.I1)]
public bool GoBack;
[MarshalAs(UnmanagedType.I1)]
public bool GoAhead;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = TzMaxTimes)]
public long[] Ats;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = TzMaxTimes)]
public byte[] Types;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = TzMaxTypes)]
public TimeTypeInfo[] Ttis;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = TzCharsArraySize)]
public char[] Chars;
public int DefaultType;
}
}

View file

@ -0,0 +1,34 @@
using System.Runtime.InteropServices;
namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
{
[StructLayout(LayoutKind.Sequential, Pack = 0x4, Size = 0x2C)]
struct TzifHeader
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public char[] Magic;
public char Version;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 15)]
public byte[] Reserved;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public byte[] TtisGMTCount;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public byte[] TtisSTDCount;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public byte[] LeapCount;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public byte[] TimeCount;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public byte[] TypeCount;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public byte[] CharCount;
}
}