Real Time Clock help
Posted: Sun Apr 11, 2010 9:47 pm
ok, i'm not sure where i should post things about general NDS programming, so, i chose here.
I looked at the examples, seems to use time() to get seconds passed since midnight january 1st 1970, which isn't too bad, since what i need is seconds passed since midnight january 1st 2000, which on the PC i calculated from the date and time.
Problem is, what i'm using it for needs to be more accurate than seconds, i need miliseconds (as used in a windows.h time function), or hundredths of a second (as used in dos.h in a borland turbo C++ time function). Anyone know where i can get a fractions of a second return on the nintendo DS?
if you assume seconds is the base unit of our conventional measurement of time, then the Reason why i need this accuracy is because i'm working with a fictional clock (actually more than one) that works with a base different to the length of a second (one is longer, another is shorter). and i don't want the time to tick in seconds, suddenly skipping values, or displaying the same one twice as long every now and then to compensate. EG, anyone ever though about accurately displaying a metric time clock side by side with a conventional time clock? There are 10 metric hours a day, 100 metric mins a metric hour, and 100 metric seconds a metric min. the length of a metric time second, aka quint/quinto/quintoday is different than the length of a second (its basicly the length of a day / 100000, so there's 100 thousand metric seconds in a day, or 24*60*60=86400 seconds a day, so the length of a second is a 86400th of a day, so metric second is a little shorter.). you get my point right?
also, on top of that, reading this tutorial http://www.dev-scene.com/NDS/Tutorials states that the DS can't handle Floating point values. ok, i can work around that (currently i've worked around that by replacing a lot of my decimal point multipliers with percentage values, deviding by 100 at the end of my long formuas, and doing all divides as late in the formula as possible, it gives accurate enough results for the purposes of my project, plus if i need the fraction i can mod 100 instead of devide by 100 to get the remainder), but the tutorial sugests i use fixed point maths, yet the part thats suposed to explain it hasn't been written. Anyone care to link me to any detailed explanation, or tutorials on how fixed point maths works?
I looked at the examples, seems to use time() to get seconds passed since midnight january 1st 1970, which isn't too bad, since what i need is seconds passed since midnight january 1st 2000, which on the PC i calculated from the date and time.
Problem is, what i'm using it for needs to be more accurate than seconds, i need miliseconds (as used in a windows.h time function), or hundredths of a second (as used in dos.h in a borland turbo C++ time function). Anyone know where i can get a fractions of a second return on the nintendo DS?
if you assume seconds is the base unit of our conventional measurement of time, then the Reason why i need this accuracy is because i'm working with a fictional clock (actually more than one) that works with a base different to the length of a second (one is longer, another is shorter). and i don't want the time to tick in seconds, suddenly skipping values, or displaying the same one twice as long every now and then to compensate. EG, anyone ever though about accurately displaying a metric time clock side by side with a conventional time clock? There are 10 metric hours a day, 100 metric mins a metric hour, and 100 metric seconds a metric min. the length of a metric time second, aka quint/quinto/quintoday is different than the length of a second (its basicly the length of a day / 100000, so there's 100 thousand metric seconds in a day, or 24*60*60=86400 seconds a day, so the length of a second is a 86400th of a day, so metric second is a little shorter.). you get my point right?
also, on top of that, reading this tutorial http://www.dev-scene.com/NDS/Tutorials states that the DS can't handle Floating point values. ok, i can work around that (currently i've worked around that by replacing a lot of my decimal point multipliers with percentage values, deviding by 100 at the end of my long formuas, and doing all divides as late in the formula as possible, it gives accurate enough results for the purposes of my project, plus if i need the fraction i can mod 100 instead of devide by 100 to get the remainder), but the tutorial sugests i use fixed point maths, yet the part thats suposed to explain it hasn't been written. Anyone care to link me to any detailed explanation, or tutorials on how fixed point maths works?