Mail Archives: djgpp/1993/02/22/15:28:50
Is "ticks" declared to be "volatile?"
> for (;;) {
> if (ticks > 100)
> break;
> }
If not, it is probably being loaded into a register before the start
of the loop and you are testing the value of the register many many times.
> for (;;) {
> vsync(); /* wait for vertical blank */
>
> if (ticks > 100)
> break;
> }
Of course the compiler doesn't know if you whacked "ticks" as a side effect
of calling "vsync()" so it reloads it after each call.
Just a guess...
Bob P.
- Raw text -