Another thing: how would i show the real time? I already get the static real time, but the problem is adding the new ticks to the static time without wasting time equating it.
I've tried thinking of ideas, but they all proved inefficient so far. The real prob is this: I have a struct called real_time that holds the time and date. real_time.secs + getsecs() <<-- that adds the static seconds to the uptime seconds to make a current time, but say the static is 52seconds... and the uptime is now 16seconds. I add those 2 together and it makes 68seconds, which is over 60. Look at this code:
Code:
dword getticks()
{
return ticks;
}
dword getsecs()
{
return ticks/100%60;
}
dword getmins()
{
return ticks/100/60%60;
}
dword gethours()
{
return ticks/100/60/60%24;
}
void showtime(time_st time)
{
char buffer[10];
int tmp;
print("day of week",0,18,0x02);//day of week
print(days[time.weekday+(getdays()%7)],15,17,0x05);
itoa(time.monthday+getdays(),16,buffer);//day of month
print("day of month",0,19,0x02);
print(buffer,15,18,0x03);
print("month's name",0,20,0x02);//month's name
print(months[time.month],15,19,0x03);
itoa(time.month+getmonths(),16,buffer);//month
print("month",0,20,0x02);
print(buffer,15,20,0x03);
itoa(time.year+getyears(),16,buffer);//year
print("year",0,21,0x02);
print(buffer,15,21,0x03);
//nevermind that code ^ Look at bottom code only
itoa(time.hour+gethours(),16,buffer);//hour
print("hour",0,22,0x02);
print(buffer,15,22,0x01);
itoa(time.min+getmins(),16,buffer);//mins
print("min",0,23,0x02);
print(buffer,15,23,0x01);
itoa(time.sec+getsecs(),16,buffer);//secs
print("sec",0,24,0x02);
print(buffer,15,24,0x01);
}
'ticks' starts out as 0 and then incs 100 times a second. Would I need to check if the secs is over 60? What about mins and all that? Do you see what i mean? I hope so, because i'm stuck.
Regards,
mr. xsism