Re: [AD] DOS port instability under Win 9X

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


It does not appear to show up in small programs - however, it appears in 
large programs (at least mine) when NO OTHER CODE beyond that simple block is 
executed - no code previous, no code after, no constructors/destructors. Why 
it occurs in these cases, I have no idea, but when __dpmi_yield() is not 
called there is no problem. Replacing the:
while ((readkey() & 0xFF) != 27);
with a
for (;;) if (keypressed()) if ((readkey() & 0xFF) == 0x27) break;
makes the problem vanish. Again, for some reason this does not appear in 
small programs, which made me give up on tracking it for some time. Someone 
recently mentioned to me that readkey() is often used in conjunction with 
keypressed(), whereas I was not using keypressed(), and forcing readkey() to 
wait. The only significant difference between those two methods (when the 
only thing to be done while waiting is to wait for a key) is the call to 
yield_timeslice()/__dpmi_yield(). I was not able to reproduce it using 
keypressed() to wait before calling readkey(). I WAS able to reproduce it 
using keypressed() and yield_timeslice() or __dpmi_yield() to wait before 
calling readkey().

Charles Bilyue'



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/