Open wesleywerner opened 4 years ago
it happens while checking for keypress part of sleep... if you use sleep 250,1 it will work, but yes nasty bug that been there for a while now
Something different to try in fbc 1.10.0. It is kind of like using sleep 250,1
, but key presses are still checked.
extern "c"
extern as unsigned long __fb_dos_no_dpmi_yield
end extern
'' tell SLEEP to call usleep_private() which does not yeild to dpmi
'' this prevents djgpp c runtime from calling __dmpi_yeild() during a
'' call in SLEEP. Disabling this yeild behaviour appears to prevent
'' the program from crashing in some DOS extenders.
__fb_dos_no_dpmi_yield = 1
print "before sleep"
sleep 250
print "after sleep"
No doubt there are still bugs, but this allowed me to debug some fb DOS programs that would otherwise just crash.
VERSION: 1.07.1 DOS (32-bit) ENVIRONMENT: DOSBox 0.74 (default DOS configuration)
Test program:
This issue is dependant on the CPU speed configured in DOSBox. When running at the default 3000 cycles the exception is thrown. When dropping the cycles to 300 the problem disappears. I cannot speculate why this happens, reporting it regardless for visibility's sake.
running at 3000 cycles
running at 300 cycles