This refers to getting the time for MapThis! from the PSP's XMB or what?
Here's how to get the time zone the PSP is set to in the XMB.
you shouldn't need it as a setting in the configuration file.
Art.sceRtcGetCurrentClockLocalTime(&rtime); // calculate timezone
hhr = rtime.hour;
lochr = hhr;
sceRtcGetCurrentClock(&rtime,0);
utchour = rtime.hour;
utchr = utchour;
intz = lochr - utchr;
if (intz == -12) {intz = 12;}
if (intz == -13) {intz = 11;}
if (intz == -14) {intz = 10;}
if (intz == -15) {intz = 9;}
if (intz == -16) {intz = 8;}
if (intz == -17) {intz = 7;}
if (intz == -18) {intz = 6;}
if (intz == -19) {intz = 5;}
if (intz == -20) {intz = 4;}
if (intz == -21) {intz = 3;}
if (intz == -22) {intz = 2;}
if (intz == -23) {intz = 1;}
if (intz == -24) {intz = 0;}
This refers to getting the time for MapThis! from the PSP's XMB or what?
If Deniska wanted to, or anyone since the source is available I suppose,
the routine can be insterted to get the timezone the same way as my clock program.
The PSP knows the time and the timezone, the date and many other things,
so there's no need to get the user to define it in a config file.
Not a complaint, it's a picky thing really, but an easy fix.
Instead of using all those if-statements, you could also use this:
intz = (intz+24)%24;
What does it do exactly?
It causes an error if I compile it because the % sign defines 24 as binary
which the numbers 2 and 4 are invalid input for.
I got it down to this:
Which is smaller space, but worse instruction time.tzc = 12;
tzd = 12;
sceRtcGetCurrentClockLocalTime(&rtime); // calculate timezone
hhr = rtime.hour;
lochr = hhr;
sceRtcGetCurrentClock(&rtime,0);
utchour = rtime.hour;
utchr = utchour;
intz = lochr - utchr;
for (tzc=12; tzc<24; tzc++) {
if (intz == -tzc) {intz = tzd;}
tzd--;
} // tzc
Art.
how would I go about time in India? ;-)
they have their own timezone with 30 min diffrence from everyone else...
Change config file to:
Are you in India? Y/N
A 30 minute time difference wouldn't matter because the user already changed their time to adjust for the 30 minute difference in the psp.
It could still be worked out, yes, but deniska was looking at
a bug in my routine that uses integers, so it would
only give a result to the nearest hour, and be incorrect for India.
Is fixable though.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks