Mail Archives: djgpp/1999/04/19/08:39:51
Eli Zaretskii writes:
> To solve your problem, either reprogram timer 2 (instead of the
> system timer 0, like `uclock' does) and use it in the same way
> as `uclock'; or program the CMOS clock to generate interrupt 70h
> every 976.6 microseconds and install a handler that counts these
> interrupts.
Be aware, though, that timer 2 isn't emulated very well under win95,
so this may not work reliably there. The CMOS should in theory be
a totally reliable solution, but when I once tried to implement this
in Allegro, a lot of people had problems with it. I never figured out
exactly why this was, and it could of course just have been an error
in my code, but my best guess is that it was due to the motherboard
and BIOS combination. So be warned: neither of these methods are
likely to work on all machines and operating systems.
If you are already using timer 0 in your program, is there any way
you can get time delay information from the same code that is
generating the interrupts? That won't give really fine precision,
but should be fine up to 1/200 or so of a second. Another option
would be to use the Pentium clock register, but that wouldn't
work on 486 and below...
Shawn Hargreaves.
- Raw text -