From 0620995611d74612f77e7c3a5893181c3d51f4f2 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Fri, 20 Jul 2007 18:53:52 +0000 Subject: [PATCH] A very fake DPB for some editor. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2928 --- include/dos_inc.h | 3 ++- src/dos/dos.cpp | 41 +++++++++++++++++++++-------------------- src/dos/dos_tables.cpp | 6 +++++- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/include/dos_inc.h b/include/dos_inc.h index d748a016..9f38dbe3 100644 --- a/include/dos_inc.h +++ b/include/dos_inc.h @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_inc.h,v 1.69 2007-06-14 08:23:46 qbix79 Exp $ */ +/* $Id: dos_inc.h,v 1.70 2007-07-20 18:53:52 qbix79 Exp $ */ #ifndef DOSBOX_DOS_INC_H #define DOSBOX_DOS_INC_H @@ -623,6 +623,7 @@ struct DOS_Block { RealPt filenamechar; RealPt collatingseq; Bit8u* country;//Will be copied to dos memory. resides in real mem + Bit16u dpb; //Fake Disk parameter system using only the first entry so the drive letter matches } tables; Bit16u loaded_codepage; }; diff --git a/src/dos/dos.cpp b/src/dos/dos.cpp index 168efe4a..db1a1731 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.102 2007-06-13 07:25:14 qbix79 Exp $ */ +/* $Id: dos.cpp,v 1.103 2007-07-20 18:53:52 qbix79 Exp $ */ #include #include @@ -385,12 +385,15 @@ static Bitu DOS_21Handler(void) { dos.return_code=reg_al; //Officially a field in the SDA dos.return_mode=RETURN_TSR; break; - case 0x32: /* Get drive parameter block for specific drive */ + case 0x1f: /* Get drive parameter block for default drive */ + case 0x32: /* Get drive parameter block for specific drive */ { /* Officially a dpb should be returned as well. The disk detection part is implemented */ - Bitu drive=reg_dl;if(!drive) drive=dos.current_drive;else drive--; + Bitu drive=reg_dl;if(!drive || reg_ah==0x1f) drive=dos.current_drive;else drive--; if(Drives[drive]) { - reg_al=0x00; - LOG(LOG_DOSMISC,LOG_ERROR)("Get drive parameter block."); + reg_al = 0x00; + SegSet16(ds,dos.tables.dpb); + reg_bx = drive;//Faking only the first entry (that is the driveletter) + LOG(LOG_DOSMISC,LOG_ERROR)("Get drive parameter block."); } else { reg_al=0xff; } @@ -987,23 +990,21 @@ static Bitu DOS_21Handler(void) { LOG(LOG_DOSMISC,LOG_NORMAL)("DOS:Windows long file name support call %2X",reg_al); break; - case 0x68: /* FFLUSH Commit file */ - CALLBACK_SCF(false); //mirek - case 0xE0: - case 0x18: /* NULL Function for CP/M compatibility or Extended rename FCB */ - case 0x1d: /* NULL Function for CP/M compatibility or Extended rename FCB */ - case 0x1e: /* NULL Function for CP/M compatibility or Extended rename FCB */ - case 0x20: /* NULL Function for CP/M compatibility or Extended rename FCB */ - case 0x6b: /* NULL Function */ - case 0x61: /* UNUSED */ - case 0xEF: /* Used in Ancient Art Of War CGA */ - case 0x1f: /* Get drive parameter block for default drive */ - + case 0x68: /* FFLUSH Commit file */ + CALLBACK_SCF(false); //mirek + case 0xE0: + case 0x18: /* NULL Function for CP/M compatibility or Extended rename FCB */ + case 0x1d: /* NULL Function for CP/M compatibility or Extended rename FCB */ + case 0x1e: /* NULL Function for CP/M compatibility or Extended rename FCB */ + case 0x20: /* NULL Function for CP/M compatibility or Extended rename FCB */ + case 0x6b: /* NULL Function */ + case 0x61: /* UNUSED */ + case 0xEF: /* Used in Ancient Art Of War CGA */ case 0x5c: /* FLOCK File region locking */ case 0x5e: /* More Network Functions */ - default: - LOG(LOG_DOSMISC,LOG_ERROR)("DOS:Unhandled call %02X al=%02X. Set al to default of 0",reg_ah,reg_al); - reg_al=0x00; /* default value */ + default: + LOG(LOG_DOSMISC,LOG_ERROR)("DOS:Unhandled call %02X al=%02X. Set al to default of 0",reg_ah,reg_al); + reg_al=0x00; /* default value */ break; }; return CBRET_NONE; diff --git a/src/dos/dos_tables.cpp b/src/dos/dos_tables.cpp index 3f2546ac..4cf0a35f 100644 --- a/src/dos/dos_tables.cpp +++ b/src/dos/dos_tables.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_tables.cpp,v 1.28 2007-06-12 20:22:08 c2woody Exp $ */ +/* $Id: dos_tables.cpp,v 1.29 2007-07-20 18:53:52 qbix79 Exp $ */ #include "dosbox.h" #include "mem.h" @@ -145,6 +145,10 @@ void DOS_SetupTables(void) { real_writew(seg,4,100); //File Table supports 100 files dos_infoblock.SetFCBTable(RealMake(seg,0)); + /* Create a fake DPB */ + dos.tables.dpb=DOS_GetMemory(2); + for(Bitu d=0;d<26;d++) real_writeb(dos.tables.dpb,d,d); + /* Create a fake disk buffer head */ seg=DOS_GetMemory(6); for (Bitu ct=0; ct<0x20; ct++) real_writeb(seg,ct,0);