#109856 - jefklak - Tue Nov 21, 2006 8:26 pm
Hello,
I'm trying to retrieve two simple variables from the libnds package, but the damn thing just won't work at all...
First of all, I'd like the profile name of the current DS - stored in the tPERSONAL_DATA struct (see http://devkitpro.sourceforge.net/devkitProWiki/libnds/a00026.html ). In system.h, there's a define
but PersonalData->name or so doesn't work. How do I retrieve the name field?
Secondly, I'd simply like to get the current time. Including <time.h> etc gives me a ridiculus value, and the RealTimeClock nds example simply does something like "IPC->rtc_hours". This is always 0 when I try to use it, but I did test Watch.nds and that works on my DS Lite. Do you need to initialize something or so before accessing IPC->rtc_x? I almost copied all code in the RTC example but all I get are a couple of zero values...
Edit: this does NOT work
http://forum.gbadev.org/viewtopic.php?t=5487&highlight=clock
All 0? what the hell?
Thanks a lot for any help!
Greets
I'm trying to retrieve two simple variables from the libnds package, but the damn thing just won't work at all...
First of all, I'd like the profile name of the current DS - stored in the tPERSONAL_DATA struct (see http://devkitpro.sourceforge.net/devkitProWiki/libnds/a00026.html ). In system.h, there's a define
Code: |
#define PersonalData ((PERSONAL_DATA*)0x27FFC80) |
but PersonalData->name or so doesn't work. How do I retrieve the name field?
Secondly, I'd simply like to get the current time. Including <time.h> etc gives me a ridiculus value, and the RealTimeClock nds example simply does something like "IPC->rtc_hours". This is always 0 when I try to use it, but I did test Watch.nds and that works on my DS Lite. Do you need to initialize something or so before accessing IPC->rtc_x? I almost copied all code in the RTC example but all I get are a couple of zero values...
Edit: this does NOT work
http://forum.gbadev.org/viewtopic.php?t=5487&highlight=clock
Code: |
iprintf("%s %i %i\n", IPC->rtc_month, IPC->rtc_day, IPC->rtc_year + 2000); iprintf("time %2d-%02d-20%02d %2d:%02d:%02d\n", IPC->curtime[3], IPC->curtime[2], IPC->curtime[1], IPC->curtime[5], IPC->curtime[0], IPC->curtime[4]); |
All 0? what the hell?
Thanks a lot for any help!
Greets