From b7fb90dbd59e9e25aace2d46373cff0468498c6f Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Thu, 10 Jun 2004 08:48:53 +0000 Subject: [PATCH] Added double byte stuff the proper way (empty table) Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1820 --- include/dos_inc.h | 3 ++- src/dos/dos.cpp | 11 +++++++++-- src/dos/dos_tables.cpp | 8 ++++++-- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/include/dos_inc.h b/include/dos_inc.h index 579471d5..fed50e6d 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.44 2004-05-15 07:57:02 harekiet Exp $ */ +/* $Id: dos_inc.h,v 1.45 2004-06-10 08:48:53 qbix79 Exp $ */ #ifndef DOS_H_ #define DOS_H_ @@ -563,6 +563,7 @@ struct DOS_Block { struct { RealPt mediaid; RealPt tempdta; + RealPt dcbs; } tables; }; diff --git a/src/dos/dos.cpp b/src/dos/dos.cpp index 3a9928f9..eab79ba4 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.71 2004-05-04 18:34:07 qbix79 Exp $ */ +/* $Id: dos.cpp,v 1.72 2004-06-10 08:48:53 qbix79 Exp $ */ #include #include @@ -801,6 +801,14 @@ static Bitu DOS_21Handler(void) { case 0x62: /* Get Current PSP Address */ reg_bx=dos.psp(); break; + case 0x63: /* DOUBLE BYTE CHARACTER SET */ + if(reg_al == 0) { + SegSet16(ds,RealSeg(dos.tables.dcbs)); + reg_si=RealOff(dos.tables.dcbs); + reg_al = 0; + CALLBACK_SCF(false); //undocumented + } else reg_al = 0xff; //Doesn't officially touch carry flag + break; case 0x64: /* Set device driver lookahead flag */ E_Exit("Unhandled Dos 21 call %02X",reg_ah); break; @@ -895,7 +903,6 @@ static Bitu DOS_21Handler(void) { break; case 0x68: /* FFLUSH Commit file */ - case 0x63: /* Weirdo double byte stuff (fails but say it succeeded) available only in MSDOS 2.25 */ CALLBACK_SCF(false); //mirek case 0xE0: case 0x18: /* NULL Function for CP/M compatibility or Extended rename FCB */ diff --git a/src/dos/dos_tables.cpp b/src/dos/dos_tables.cpp index d54c3139..e45fa3f3 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.10 2004-05-04 18:34:08 qbix79 Exp $ */ +/* $Id: dos_tables.cpp,v 1.11 2004-06-10 08:48:53 qbix79 Exp $ */ #include "dosbox.h" #include "mem.h" @@ -78,9 +78,13 @@ void DOS_SetupTables(void) { //CON string real_writew(0x54,0x20+0x00, (Bit16u) 0x4f43); real_writew(0x54,0x20+0x02, (Bit16u) 0x204e); + + /* Allocate DCBS DOUBLE BYTE CHARACTER SET LEAD-BYTE TABLE */ + dos.tables.dcbs=RealMake(DOS_GetMemory(3),0); + mem_writew(Real2Phys(dos.tables.dcbs),0); //empty table + /* Allocate some fake memory else pharlab doesn't like the indos pointer */ sdaseg=DOS_GetMemory(12); - sdaseg=DOS_GetMemory(3); DOS_SDA(sdaseg,0).Init(); }