Exemplo n.º 1
0
 public int sceRtcGetCurrentClockLocalTime(ScePspDateTime *time)
 {
     throw (new NotImplementedException());
     /*
     ulong currentTick;
     sceRtcGetCurrentTick(&currentTick);
     sceRtcSetTick(time, &currentTick);
     return 0;
     */
 }
Exemplo n.º 2
0
        public int sceRtcGetCurrentClock(out ScePspDateTime DateTime, int TimeZone)
        {
            PspRtc.Update();
            var CurrentDateTime = PspRtc.CurrentDateTime;
            PspRtc.Update();

            DateTime = new ScePspDateTime()
            {
                Year = (ushort)CurrentDateTime.Year,
                Month = (ushort)CurrentDateTime.Month,
                Day = (ushort)CurrentDateTime.Day,
                Hour = (ushort)CurrentDateTime.Hour,
                Minute = (ushort)(CurrentDateTime.Minute + TimeZone),
                Second = (ushort)CurrentDateTime.Second,
                Microsecond = (uint)(CurrentDateTime.Millisecond * 1000),
            };

            return 0;
        }
Exemplo n.º 3
0
 public int sceRtcSetTick(ScePspDateTime* Date, ulong* Ticks)
 {
     try
     {
         *Date = ScePspDateTime.FromDateTime(new DateTime((long)(*Ticks * 10)));
         return 0;
     }
     catch (Exception Exception)
     {
         Console.Error.WriteLine(Exception);
         return -1;
     }
 }
Exemplo n.º 4
0
 public int sceRtcGetWin32FileTime(ScePspDateTime DateTime)
 {
     return 0;
 }
Exemplo n.º 5
0
 public int sceRtcGetTime_t(ref ScePspDateTime DateTime, out uint UnixTime)
 {
     UnixTime = (uint)DateTime.ToUnixTimestamp();
     return 0;
 }
Exemplo n.º 6
0
        public int sceRtcGetTime64_t(ref ScePspDateTime DatePointer, ref long UnixTimePointer)
        {
            UnixTimePointer = DatePointer.ToUnixTimestamp();

            return 0;
        }
Exemplo n.º 7
0
 public int sceRtcGetTick(ScePspDateTime* Date, ulong* Tick)
 {
     try
     {
         *Tick = (ulong)Date->ToDateTime().GetTotalNanoseconds();
         return 0;
     }
     catch (Exception Exception)
     {
         Console.Error.WriteLine("sceRtcGetTick.Date: " + *Date);
         Console.Error.WriteLine(Exception);
         return -1;
     }
 }
Exemplo n.º 8
0
        public int sceRtcGetCurrentClock(out ScePspDateTime DateTime, int TimeZone)
        {
            PspRtc.Update();
            var CurrentDateTime = PspRtc.CurrentDateTime;
            CurrentDateTime += TimeSpan.FromMinutes(TimeZone);
            PspRtc.Update();

            DateTime = new ScePspDateTime()
            {
                Year = (ushort)CurrentDateTime.Year,
                Month = (ushort)CurrentDateTime.Month,
                Day = (ushort)CurrentDateTime.Day,
                Hour = (ushort)CurrentDateTime.Hour,
                Minute = (ushort)(CurrentDateTime.Minute),
                Second = (ushort)CurrentDateTime.Second,
                Microsecond = (uint)(CurrentDateTime.GetTotalMicroseconds() % 1000000),
            };

            return 0;
        }
Exemplo n.º 9
0
 public int sceRtcSetTick(ScePspDateTime* date, ulong* tick)
 {
     throw (new NotImplementedException());
     /*
     date.parse(*tick);
     return 0;
     */
 }
Exemplo n.º 10
0
 public int sceRtcGetTick(ScePspDateTime* date, ulong* tick)
 {
     throw (new NotImplementedException());
     /*
     try
     {
         *tick = date.tick;
         return 0;
     } catch {
         *tick = 0;
         return -1;
     }
     */
 }
Exemplo n.º 11
0
 public int sceRtcGetWin32FileTime(ScePspDateTime* DateTime, ulong* Win32Time)
 {
     return 0;
 }
Exemplo n.º 12
0
 public int sceRtcGetTick(ScePspDateTime* Date, ulong* Tick)
 {
     try
     {
         *Tick = (ulong)Date->ToDateTime().GetTotalNanoseconds();
         return 0;
     }
     catch (Exception)
     {
         //Console.Error.WriteLine("sceRtcGetTick.Date: " + *Date);
         //Console.Error.WriteLine(Exception);
         throw (new SceKernelException(SceKernelErrors.ERROR_INVALID_VALUE));
     }
 }
Exemplo n.º 13
0
 public int sceRtcSetTime_t(out ScePspDateTime date, uint time)
 {
     date = ScePspDateTime.FromDateTime(DateTimeRange.ConvertFromUnixTimestamp(time));
     return 0;
 }