rcx21000
Well-Known Member
That timing thingy could be made to work. Someone just needs to make a special routine to be called every x ticks. It subtracts x ticks from a file on SMC. Since higher clock speeds do more ticks/second, it should work, right? There could even be a program that will measure how many ticks per pair of battries your GP32 does. The sub could be something like this:
Only problem is I'm not sure if 133MhZ has exactly half the battrey life as 66MhZ. If it doesn't, then you could just measure "survival ticks" for every speed, add an arg to BattreyCheck for current clock speed, than have it mulitply TicksSinceLastCall by the amount it needs to change it to whatever speed (66MhZ * 1, 133MhZ might be * 1.5, etc.)
Another problem is that every program (including F/W) would have to have this code inside it, and some of the older program's programmers might not be around to do that :blink:
Code:
void BattreyCheck(int TicksSinceLastCall, char CalledBefore) {
switch(CalledBefore) {
case 0: /* Program started */
/* Open file & set TicksLeft (global var) to value */
break;
case 1: /* Called before */
TicksLeft -= TicksSinceLastCall;
break;
case 2: /* Exiting (Have to use quit command), also this could be used instead of 1 (if user is too lazy to use quit command), but the program would be slow */
TicksLeft -= TicksSinceLastCall;
/* Save TicksLeft to file */
}
if(TicksLeft <= 200000) {
/* Show warning message, and ask if wants to proceed. 200,000 ticks @ 66MhZ is 200 seconds */
}
}
Only problem is I'm not sure if 133MhZ has exactly half the battrey life as 66MhZ. If it doesn't, then you could just measure "survival ticks" for every speed, add an arg to BattreyCheck for current clock speed, than have it mulitply TicksSinceLastCall by the amount it needs to change it to whatever speed (66MhZ * 1, 133MhZ might be * 1.5, etc.)
Another problem is that every program (including F/W) would have to have this code inside it, and some of the older program's programmers might not be around to do that :blink: