예제 #1
0
파일: misc.c 프로젝트: JoseEduardo/ps2sdk
int getPs2Time(ps2time *tm)
{
    cd_clock_t	cdtime;
    s32		tmp;
    ps2time timeBuf= {
        0, 0x0D, 0x0E, 0x0A, 0x0D, 1, 2003// used if can not get time...
    };

    if(CdReadClock(&cdtime)!=0 && cdtime.stat==0)
    {
        tmp=cdtime.second>>4;
        timeBuf.sec=(u32)(((tmp<<2)+tmp)<<1)+(cdtime.second&0x0F);
        tmp=cdtime.minute>>4;
        timeBuf.min=(((tmp<<2)+tmp)<<1)+(cdtime.minute&0x0F);
        tmp=cdtime.hour>>4;
        timeBuf.hour=(((tmp<<2)+tmp)<<1)+(cdtime.hour&0x0F);
//		timeBuf.hour = (timeBuf.hour + 4) % 24; // TEMP FIX (need to deal with timezones?) ... aparently not
        tmp=cdtime.day>>4;
        timeBuf.day=(((tmp<<2)+tmp)<<1)+(cdtime.day&0x0F);
        tmp=(cdtime.month&0x7F)>>4;
        timeBuf.month=(((tmp<<2)+tmp)<<1)+(cdtime.month&0x0F);
        tmp=cdtime.year>>4;
        timeBuf.year=(((tmp<<2)+tmp)<<1)+(cdtime.year&0xF)+2000;
    }
예제 #2
0
파일: rpcfs.c 프로젝트: 0xf1sh/scummvm
void *rpcReadClock(void *data) {
	CdReadClock((cd_clock_t *)data);
	return data;
}