#109502 - SaruCoder - Sat Nov 18, 2006 9:13 pm
I've managed to compile the real time clock example that's included with the devKitPro, but then when I run (load and execute) it on the Dualis emulator it looks like it's paused, and the clock isn't "ticking".
I've run into this before where I'm trying to get a basic clock working but I wasn't able to get it to count.
The example I'm running is:
devkitPro\examples\nds\RealTimeClock\Watch
I'm starting to think it's a problem with the emulator. I haven't tried it with other ones because I haven't came across any that are good.
Does anybody have any ideas on what's going on?
#109520 - Lick - Sat Nov 18, 2006 11:48 pm
Try a different emulator.
_________________
http://licklick.wordpress.com
#109538 - SaruCoder - Sun Nov 19, 2006 2:44 am
Any suggestions for a different emulator another than Dualis?
#109546 - Normmatt - Sun Nov 19, 2006 6:29 am
i'm pretty sure the only nds emulator that supports the rtc is no$gba.
#109616 - SaruCoder - Sun Nov 19, 2006 7:16 pm
Thanks Normmatt, the clock example is working in no$gba.
#117771 - SaruCoder - Wed Feb 07, 2007 8:40 am
Ok, I just updated to devkitpro r20, and now the real time clock (example) doesn't work with no$gba (2.3c).
I was wondering if it's working for you guys?
I also noticed some changes to ipc.h, they took out IPC->rtc_heartbeat :( So what do you guys use for "measuring" time in terms of milliseconds? The time.h, clock_t, clock(), ..., route doesn't work for me either.
#117773 - SaruCoder - Wed Feb 07, 2007 8:50 am
Hmm, unless you guys are relaying on the 60Hz vertical refresh, swiWaitForVBlank(), for time < 1 second. But this assumes that there won't be a hiccup where it skips a vblank. Interesting ...
#117789 - tepples - Wed Feb 07, 2007 3:13 pm
SaruCoder wrote: |
Hmm, unless you guys are relaying on the 60Hz vertical refresh, swiWaitForVBlank(), for time < 1 second. But this assumes that there won't be a hiccup where it skips a vblank. Interesting ... |
Yes, the vast majority of commercial NES, Sega Genesis, Super NES, GBA, and DS games use vblank for game logic timing. If your vblank ISR keeps a count of vblanks since power on, then the main code can compensate for hiccups.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#117881 - SaruCoder - Thu Feb 08, 2007 7:47 am
tepples wrote: |
SaruCoder wrote: | Hmm, unless you guys are relaying on the 60Hz vertical refresh, swiWaitForVBlank(), for time < 1 second. But this assumes that there won't be a hiccup where it skips a vblank. Interesting ... |
Yes, the vast majority of commercial NES, Sega Genesis, Super NES, GBA, and DS games use vblank for game logic timing. If your vblank ISR keeps a count of vblanks since power on, then the main code can compensate for hiccups. |
Thanks for the reply tepples, I will probably use the vblank as my "clock". However, I'm still still having troubles setting up the RTC. I don't really need it, but it'll be reassuring to know what was going on. I'm I suppose to enable an IRQ or something?
#118022 - knight0fdragon - Fri Feb 09, 2007 3:49 am
RTC works on no$gba 2.3c
_________________
http://www.myspace.com/knight0fdragonds
MK DS FC: Dragon 330772 075464
AC WW FC: Anthony SamsClub 1933-3433-9458
MPFH: Dragon 0215 4231 1206
#118034 - wintermute - Fri Feb 09, 2007 7:59 am
knight0fdragon wrote: |
RTC works on no$gba 2.3c |
Not sure why it would.
The RTC update code was temporarily removed from the default ARM7 core. It was reading the RTC every frame or about 60 times faster than it could possibly be changing. This had some detrimental effects on both touchscreen reading and microphone output.
I'm intending to replace this with something more sensible in the very near future, probably a single read of the RTC on start up with updating handled via vblank thereafter.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog
#118035 - wintermute - Fri Feb 09, 2007 8:02 am
SaruCoder wrote: |
I also noticed some changes to ipc.h, they took out IPC->rtc_heartbeat :( So what do you guys use for "measuring" time in terms of milliseconds? The time.h, clock_t, clock(), ..., route doesn't work for me either. |
heartbeat was a debugging variable to check the arm7 code was running way back when libnds just started out.
I intend to make some of the time.h functions work in the very near future although it's unlikely that millisecond resolution will be implemented by default.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog
#118110 - HyperHacker - Sat Feb 10, 2007 5:53 am
Hm, so the touch screen accuracy problems are caused by reading the clock too often?
_________________
I'm a PSP hacker now, but I still <3 DS.
#118153 - knight0fdragon - Sat Feb 10, 2007 3:11 pm
wintermute wrote: |
knight0fdragon wrote: | RTC works on no$gba 2.3c |
Not sure why it would.
The RTC update code was temporarily removed from the default ARM7 core. It was reading the RTC every frame or about 60 times faster than it could possibly be changing. This had some detrimental effects on both touchscreen reading and microphone output.
I'm intending to replace this with something more sensible in the very near future, probably a single read of the RTC on start up with updating handled via vblank thereafter. |
I was not referring to the default arm7 core, I am talking about RTC works in general, I myself have built a custom arm7 that askes to read the arm7 only upon request from the arm9 via FIFO
_________________
http://www.myspace.com/knight0fdragonds
MK DS FC: Dragon 330772 075464
AC WW FC: Anthony SamsClub 1933-3433-9458
MPFH: Dragon 0215 4231 1206