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

Post Reply
ShotgunNinja
Posts: 34
Joined: Tue May 11, 2010 2:29 am

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

Post by ShotgunNinja » Thu Aug 26, 2010 5:23 pm

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.

WinterMute
Site Admin
Posts: 1853
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

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

Post by WinterMute » Thu Aug 26, 2010 8:17 pm

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:
Help keep devkitPro toolchains free, Donate today

Personal Blog

ShotgunNinja
Posts: 34
Joined: Tue May 11, 2010 2:29 am

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

Post by ShotgunNinja » Fri Aug 27, 2010 2:42 pm

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.

WinterMute
Site Admin
Posts: 1853
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

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

Post by WinterMute » Sat Aug 28, 2010 11:59 am

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.
Help keep devkitPro toolchains free, Donate today

Personal Blog

ShotgunNinja
Posts: 34
Joined: Tue May 11, 2010 2:29 am

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

Post by ShotgunNinja » Sun Aug 29, 2010 8:44 pm

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!

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests