diff --git a/src/dos/dos_execute.cpp b/src/dos/dos_execute.cpp index 1dc618f0..846f604b 100644 --- a/src/dos/dos_execute.cpp +++ b/src/dos/dos_execute.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_execute.cpp,v 1.49 2005-09-19 08:25:38 c2woody Exp $ */ +/* $Id: dos_execute.cpp,v 1.50 2005-10-07 15:16:58 c2woody Exp $ */ #include #include @@ -185,8 +185,11 @@ static bool MakeEnv(char * name,Bit16u * segment) { bool DOS_NewPSP(Bit16u segment, Bit16u size) { DOS_PSP psp(segment); psp.MakeNew(size); - DOS_PSP psp_parent(psp.GetParent()); + Bit16u parent_psp_seg=psp.GetParent(); + DOS_PSP psp_parent(parent_psp_seg); psp.CopyFileTable(&psp_parent,false); + // copy command line as well (Kings Quest AGI -cga switch) + psp.SetCommandTail(RealMake(parent_psp_seg,0x80)); return true; }; diff --git a/src/dos/dos_files.cpp b/src/dos/dos_files.cpp index ad3e7515..4af385ee 100644 --- a/src/dos/dos_files.cpp +++ b/src/dos/dos_files.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_files.cpp,v 1.69 2005-09-11 13:09:45 qbix79 Exp $ */ +/* $Id: dos_files.cpp,v 1.70 2005-10-07 15:16:58 c2woody Exp $ */ #include #include @@ -1014,7 +1014,7 @@ bool DOS_GetAllocationInfo(Bit8u drive,Bit16u * _bytes_sector,Bit8u * _sectors_c Bit16u _free_clusters; Drives[drive]->AllocationInfo(_bytes_sector,_sectors_cluster,_total_clusters,&_free_clusters); SegSet16(ds,RealSeg(dos.tables.mediaid)); - reg_bx=RealOff(dos.tables.mediaid+drive); + reg_bx=RealOff(dos.tables.mediaid+drive*2); return true; } diff --git a/src/dos/dos_programs.cpp b/src/dos/dos_programs.cpp index dc00a07f..baf3a899 100644 --- a/src/dos/dos_programs.cpp +++ b/src/dos/dos_programs.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_programs.cpp,v 1.44 2005-09-29 08:48:39 qbix79 Exp $ */ +/* $Id: dos_programs.cpp,v 1.45 2005-10-07 15:16:58 c2woody Exp $ */ #include #include @@ -203,7 +203,7 @@ public: if (!newdrive) E_Exit("DOS:Can't create drive"); Drives[drive-'A']=newdrive; /* Set the correct media byte in the table */ - mem_writeb(Real2Phys(dos.tables.mediaid)+drive-'A',newdrive->GetMediaByte()); + mem_writeb(Real2Phys(dos.tables.mediaid)+(drive-'A')*2,newdrive->GetMediaByte()); WriteOut(MSG_Get("PROGRAM_MOUNT_STATUS_2"),drive,newdrive->GetInfo()); /* check if volume label is given and don't allow it to updated in the future */ if (cmd->FindString("-label",label,true)) newdrive->dirCache.SetLabel(label.c_str(),false); @@ -725,7 +725,7 @@ public: if (!newdrive) WriteOut(MSG_Get("PROGRAM_IMGMOUNT_CANT_CREATE")); Drives[drive-'A']=newdrive; // Set the correct media byte in the table - mem_writeb(Real2Phys(dos.tables.mediaid)+drive-'A',mediaid); + mem_writeb(Real2Phys(dos.tables.mediaid)+(drive-'A')*2,mediaid); WriteOut(MSG_Get("PROGRAM_MOUNT_STATUS_2"),drive,temp_line.c_str()); if(((fatDrive *)newdrive)->loadedDisk->hardDrive) { if(imageDiskList[2] == NULL) { @@ -751,7 +751,7 @@ public: if (!newdrive) WriteOut(MSG_Get("PROGRAM_IMGMOUNT_CANT_CREATE")); Drives[drive-'A']=newdrive; // Set the correct media byte in the table - mem_writeb(Real2Phys(dos.tables.mediaid)+drive-'A',mediaid); + mem_writeb(Real2Phys(dos.tables.mediaid)+(drive-'A')*2,mediaid); WriteOut(MSG_Get("PROGRAM_MOUNT_STATUS_2"),drive,temp_line.c_str()); } else if (fstype=="none") { if(imageDiskList[drive] != NULL) delete imageDiskList[drive]; diff --git a/src/dos/dos_tables.cpp b/src/dos/dos_tables.cpp index a2bd7754..95bdca02 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.20 2005-08-08 13:33:46 c2woody Exp $ */ +/* $Id: dos_tables.cpp,v 1.21 2005-10-07 15:16:58 c2woody Exp $ */ #include "dosbox.h" #include "mem.h" @@ -75,10 +75,10 @@ static Bit8u country_info[0x22] = { void DOS_SetupTables(void) { dos_memseg=0xd000; Bit16u seg,seg2;Bitu i; - dos.tables.mediaid=RealMake(DOS_GetMemory(2),0); + dos.tables.mediaid=RealMake(DOS_GetMemory(4),0); dos.tables.tempdta=RealMake(DOS_GetMemory(4),0); dos.tables.tempdta_fcbdelete=RealMake(DOS_GetMemory(4),0); - for (i=0;i