From 53b9323bd7c8afc75c73f5fb8bc191354eef7883 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Thu, 11 Dec 2008 09:16:31 +0000 Subject: [PATCH] Slightly improve stability with some lot's of fileloading game, while being picky on the sound irq timing. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3243 --- src/dos/dos.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/dos/dos.cpp b/src/dos/dos.cpp index d5260132..01c7d90c 100644 --- a/src/dos/dos.cpp +++ b/src/dos/dos.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos.cpp,v 1.113 2008-09-07 10:55:14 c2woody Exp $ */ +/* $Id: dos.cpp,v 1.114 2008-12-11 09:16:31 qbix79 Exp $ */ #include #include @@ -46,7 +46,13 @@ void DOS_SetError(Bit16u code) { #ifdef DATA_TRANSFERS_TAKE_CYCLES #include "cpu.h" static inline void modify_cycles(Bits value) { - if((4*value+5) < CPU_Cycles) CPU_Cycles -= 4*value; else CPU_Cycles = 5; + if((4*value+5) < CPU_Cycles) { + CPU_Cycles -= 4*value; + CPU_IODelayRemoved += 4*value; + } else { + CPU_IODelayRemoved += CPU_Cycles/*-5*/; //don't want to mess with negative + CPU_Cycles = 5; + } } #else static inline void modify_cycles(Bits /* value */) {