Page 1 of 1

(libnds) Real-Time Clock broken, DeSmuMe 0.9.5 x86

Posted: Thu Aug 26, 2010 5:23 pm
by ShotgunNinja
Hello, I recently downloaded and built the Real-Time Clock example with libnds 1.4.5 and the newest devkitPro-ARM toolchain, and I discovered that the timing system doesn't quite work properly in DeSmuMe 0.9.5 x86, which is currently my only testing platform. While the clock's 3D graphics are all done properly, I've tracked down the cause of the bug to a non-changing return value from the unix time() function. The value returned is the exact time value of the start of the program. Now, I have yet to test the program on other emulators and on an actual DS, but my belief is that either DeSmuMe's time() function is broken, or the time() function in the new devkitARM EABI is broken.

Re: (libnds) Real-Time Clock broken, DeSmuMe 0.9.5 x86

Posted: Thu Aug 26, 2010 8:17 pm
by WinterMute
The only emulator I know of which implements the needed part of the RTC is no$gba 2.6a, there may be others. Pro tip: always test on hardware before making a big fool of yourself with assumptions :wink:

Re: (libnds) Real-Time Clock broken, DeSmuMe 0.9.5 x86

Posted: Fri Aug 27, 2010 2:42 pm
by ShotgunNinja
Well, to be fair, I did specify the emulator in the title. I was pretty sure that the problem lied in DeSmuME to begin with, I was just posting what I knew and seeing if the problem occurred on any other emulators/platforms.

Re: (libnds) Real-Time Clock broken, DeSmuMe 0.9.5 x86

Posted: Sat Aug 28, 2010 11:59 am
by WinterMute
Well, if you'd run your code on hardware then you'd have found out that the "bug" is DeSmuMe's and nothing to do with devkitARM or libnds and reported it in the appropriate place. Neither DeSmuMe nor the devkitARM EABI have a time() function, time() is provided by libc (newlib in devkitARM) and the actual problem here is that DeSmuMe doesn't currently emulate the particular DS hardware I make use of in order to provide epoch time from libnds.

Re: (libnds) Real-Time Clock broken, DeSmuMe 0.9.5 x86

Posted: Sun Aug 29, 2010 8:44 pm
by ShotgunNinja
All right, cool. Honestly, I would love to be able to run my code on hardware, but I don't have the money to buy a card right now... College is expensive!

As soon as I buy books and pay tuition, I'm gonna see how much an R4DS will cost, and see about ordering one. Hopefully the next time I do something like this, I'll be able to back up my claim by saying whether or not it runs correctly on hardware. Thanks!