From 282ccd8c94e78007dc5e2c21ac7300e20123730f Mon Sep 17 00:00:00 2001 From: Sjoerd van der Berg Date: Sun, 20 Oct 2002 01:18:29 +0000 Subject: [PATCH] Added some logging for things that will hopefully never occur and changed the order of memory and table init to fix problems with list of lists. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@379 --- src/dos/dos.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dos/dos.cpp b/src/dos/dos.cpp index bd8138f5..af57714d 100644 --- a/src/dos/dos.cpp +++ b/src/dos/dos.cpp @@ -460,6 +460,7 @@ static Bitu DOS_21Handler(void) { case 0x3f: /* READ Read from file or device */ { Bit16u toread=reg_cx; + if (reg_cx+reg_dx>0xffff) LOG_DEBUG("DOS:READ:Buffer overflow"); if (DOS_ReadFile(reg_bx,dos_copybuf,&toread)) { MEM_BlockWrite(SegPhys(ds)+reg_dx,dos_copybuf,toread); reg_ax=toread; @@ -473,6 +474,7 @@ static Bitu DOS_21Handler(void) { case 0x40: /* WRITE Write to file or device */ { Bit16u towrite=reg_cx; + if (reg_cx+reg_dx>0xffff) LOG_DEBUG("DOS:WRITE:Buffer overflow"); MEM_BlockRead(SegPhys(ds)+reg_dx,dos_copybuf,towrite); if (DOS_WriteFile(reg_bx,dos_copybuf,&towrite)) { reg_ax=towrite; @@ -838,8 +840,8 @@ void DOS_Init(Section* sec) { DOS_SetupFiles(); /* Setup system File tables */ DOS_SetupDevices(); /* Setup dos devices */ - DOS_SetupMemory(); /* Setup first MCB */ DOS_SetupTables(); + DOS_SetupMemory(); /* Setup first MCB */ DOS_SetupPrograms(); DOS_SetupMisc(); /* Some additional dos interrupts */ DOS_SetDefaultDrive(25);