I've been rebuilding some games for WM6 and I've found the following problem:
I have the following messy code (it's my style, sorry kids):
which basically executes PHAL::GetClock() until it gets a difference bigger than 1000 ms between executions, and gives the following output:
RV1=41091388 RV2=41807216, iter=595
RV1=41091391
So, after 595 iterations, three consecutive calls to PHAL::GetClock gives me:
41091388
41807216
41091391
The number of iterations is random, and I have no other threads in my app running which could interfere. I removed the device's battery and still got the same results.
At first I thought it was a buffer overrun problem in my app, so I started looking for it, but it leaded me to that code.
Any ideas? (If you want me to test anything Thierry just tell me, it's my own phone, an SPV E200)
TIA!
Kak
p.s. I'm using the 1.0.5 RC_2 without logging posted in the 1.0.4, and before that I was using 1.0.4 which also had the problem. I'm almost sure the problem wasn't in 0.7.7 (the last version I used to compile the game), but it could have gone unnoticed... if so, poor customers, because you get randomly killed :)
I have the following messy code (it's my style, sorry kids):
- Code:
int rv1,rv2,iterations=0;
rv1=PHAL::GetClock ();
while (1)
{
rv2=PHAL::GetClock ();
if (rv2>(rv1+1000)) break;
rv1=rv2;
iterations++;
}
appLog ("RV1=%d RV2=%d, iter=%d",rv1,rv2,iterations);
rv1=PHAL::GetClock ();
appLog ("RV1=%d ",rv1);
exit(0);
which basically executes PHAL::GetClock() until it gets a difference bigger than 1000 ms between executions, and gives the following output:
RV1=41091388 RV2=41807216, iter=595
RV1=41091391
So, after 595 iterations, three consecutive calls to PHAL::GetClock gives me:
41091388
41807216
41091391
The number of iterations is random, and I have no other threads in my app running which could interfere. I removed the device's battery and still got the same results.
At first I thought it was a buffer overrun problem in my app, so I started looking for it, but it leaded me to that code.
Any ideas? (If you want me to test anything Thierry just tell me, it's my own phone, an SPV E200)
TIA!
Kak
p.s. I'm using the 1.0.5 RC_2 without logging posted in the 1.0.4, and before that I was using 1.0.4 which also had the problem. I'm almost sure the problem wasn't in 0.7.7 (the last version I used to compile the game), but it could have gone unnoticed... if so, poor customers, because you get randomly killed :)