From 632f57936135b379f014ed8ec6490e77c43fe38a Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Fri, 21 Apr 2006 08:23:40 +0000 Subject: [PATCH] Add a trick for Ishar 3 of the Ishar 3 Triology. File reads and writes take actually cycles now.(4 times the amount of transfered data) Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2608 --- src/dos/dos.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/dos/dos.cpp b/src/dos/dos.cpp index fa32a395..fc4c243e 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.93 2006-03-08 15:57:23 qbix79 Exp $ */ +/* $Id: dos.cpp,v 1.94 2006-04-21 08:23:40 qbix79 Exp $ */ #include #include @@ -41,6 +41,18 @@ void DOS_SetError(Bit16u code) { dos.errorcode=code; } +#define DATA_TRANSFERS_TAKE_CYCLES 1 +#ifdef DATA_TRANSFERS_TAKE_CYCLES +#include "cpu.h" +static inline void modify_cycles(Bitu value) { + if((4*value+5) < CPU_Cycles) CPU_Cycles -= 4*value; else CPU_Cycles = 5; +} +#else +static inline void modify_cycles(Bitu /* value */) { + return; +} +#endif + #define DOSNAMEBUF 256 static Bitu DOS_21Handler(void) { if (((reg_ah != 0x50) && (reg_ah != 0x51) && (reg_ah != 0x62) && (reg_ah != 0x64)) && (reg_ah<0x6c)) { @@ -499,6 +511,7 @@ static Bitu DOS_21Handler(void) { reg_ax=dos.errorcode; CALLBACK_SCF(true); } + modify_cycles(reg_ax); dos.echo=false; break; } @@ -513,6 +526,7 @@ static Bitu DOS_21Handler(void) { reg_ax=dos.errorcode; CALLBACK_SCF(true); } + modify_cycles(reg_ax); break; }; case 0x41: /* UNLINK Delete file */