Changes in cellRtc & sceNpTrophy

* Two header files added: cellRtc.h and sceNpTrophy.h
* Changes in sceNpTrophyCreateContext.
* Implemented sceNpTrophyGetTrophyInfo.
This commit is contained in:
Alexandro Sánchez Bach 2014-03-06 01:52:23 +01:00
parent 8204deaae6
commit 39d3814be7
4 changed files with 144 additions and 90 deletions

View file

@ -2,44 +2,11 @@
#include "Emu/SysCalls/SysCalls.h"
#include "Emu/SysCalls/SC_FUNC.h"
#include "cellRtc.h"
void cellRtc_init();
Module cellRtc(0x0009, cellRtc_init);
// Return Codes
enum
{
CELL_RTC_ERROR_NOT_INITIALIZED = 0x80010601,
CELL_RTC_ERROR_INVALID_POINTER = 0x80010602,
CELL_RTC_ERROR_INVALID_VALUE = 0x80010603,
CELL_RTC_ERROR_INVALID_ARG = 0x80010604,
CELL_RTC_ERROR_NOT_SUPPORTED = 0x80010605,
CELL_RTC_ERROR_NO_CLOCK = 0x80010606,
CELL_RTC_ERROR_BAD_PARSE = 0x80010607,
CELL_RTC_ERROR_INVALID_YEAR = 0x80010621,
CELL_RTC_ERROR_INVALID_MONTH = 0x80010622,
CELL_RTC_ERROR_INVALID_DAY = 0x80010623,
CELL_RTC_ERROR_INVALID_HOUR = 0x80010624,
CELL_RTC_ERROR_INVALID_MINUTE = 0x80010625,
CELL_RTC_ERROR_INVALID_SECOND = 0x80010626,
CELL_RTC_ERROR_INVALID_MICROSECOND = 0x80010627,
};
struct CellRtcTick
{
u64 tick;
};
struct CellRtcDateTime
{
u16 year;
u16 month;
u16 day;
u16 hour;
u16 minute;
u16 second;
u32 microsecond;
};
long convertToUNIXTime(u16 seconds, u16 minutes, u16 hours, u16 days, int years)
{
return (seconds + minutes*60 + hours*3600 + days*86400 + (years-70)*31536000 + ((years-69)/4)*86400 - ((years-1)/100)*86400 + ((years+299)/400)*86400);