Fix DOS get time function.
PATCH 1/1 Fix DOS get time function.
Hi,
The current DOS INT 21 AH=2C get time function returns incorrect results, and is sometimes hours off. The attached patch fixes the problem.
It should patch against DOSBOX 0.72
the (X * 500 / 91) is the same as X * 100 / 18.2
Signed-off-by [email protected]
James
dos/dos.cpp renamed from dos/dos.cpp.org +3 -2
@@ -348,8 +348,9 @@ //TODO Get time through bios calls date is fixed { /* Calculate how many miliseconds have passed */ - Bitu ticks=5*mem_readd(BIOS_TIMER); - ticks = ((ticks / 59659u) << 16) + ((ticks % 59659u) << 16) / 59659u; + /* seconds = ticks / 18.2 */ + Bitu ticks=500 * mem_readd(BIOS_TIMER); + ticks = ticks / 91; Bitu seconds=(ticks/100); reg_ch=(Bit8u)(seconds/3600); reg_cl=(Bit8u)((seconds % 3600)/60);
Quoted 5 lines · James Courtier-Dutton
The current DOS INT 21 AH=2C get time function returns incorrect results, and is sometimes hours off.
The attached patch fixes the problem.
It should patch against DOSBOX 0.72
the (X * 500 / 91) is the same as X * 100 / 18.2
Hi James,
I'm afraid you were emailing the wrong list (dosemu): dosbox has its own forum and sourceforge trackers.
Bart