CSPspEmu.Hle.Modules.rtc.sceRtc.sceRtcGetDayOfWeek C# (CSharp) Метод

sceRtcGetDayOfWeek() приватный Метод

private sceRtcGetDayOfWeek ( int Year, int Month, int Day ) : PspDaysOfWeek
Year int
Month int
Day int
Результат PspDaysOfWeek
        public PspDaysOfWeek sceRtcGetDayOfWeek(int Year, int Month, int Day)
        {
            var MonthTranslate = new int[] { 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4 };
            if (Month == 0)
            {
                Month = 8;
            }
            //if(Month > 12) // After month 12, psp months does 31/31/30/31/30 and repeat
            //{
            //	int restMonth = Month-12;
            //	int grp5 = restMonth / 5;
            //	restMonth = restMonth % 5;
            //	Day += grp5 * (31*3+30*2);
            //	int[] t = { 31, 31*2, 31*2+30, 31*3+30, 31*3+30*2 };
            //	Day += t[restMonth-1];
            //	Month = 12;
            //}
            int MonthMod = (Month - 1) % 12;
            if (MonthMod < 0) MonthMod += 12;
            Year -= (Month < 3) ? 1 : 0;
            return (PspDaysOfWeek)((Year + Year / 4 - Year / 100 + Year / 400 + MonthTranslate[MonthMod] + Day) % 7);
        }