Lot's of doschanges for enchanced mode. Thank you c2woody.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1882
This commit is contained in:
parent
3a98ced52c
commit
a5f73e86a5
6 changed files with 134 additions and 35 deletions
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: dos_inc.h,v 1.46 2004-06-24 21:21:48 harekiet Exp $ */
|
||||
/* $Id: dos_inc.h,v 1.47 2004-07-08 20:08:52 qbix79 Exp $ */
|
||||
|
||||
#ifndef DOS_H_
|
||||
#define DOS_H_
|
||||
|
@ -340,6 +340,10 @@ public:
|
|||
void SetFirstMCB(Bit16u _first_mcb);
|
||||
void SetfirstFileTable(RealPt _first_table);
|
||||
void SetBuffers(Bit16u x,Bit16u y);
|
||||
void SetCurDirStruct(Bit32u _curdirstruct);
|
||||
void SetFCBTable(Bit32u _fcbtable);
|
||||
void SetDeviceChainStart(Bit32u _devchain);
|
||||
void SetDiskInfoBuffer(Bit32u _dinfobuf);
|
||||
RealPt GetPointer (void);
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
@ -349,7 +353,7 @@ public:
|
|||
Bit16u regCXfrom5e; // -0x18 CX from last int21/ah=5e
|
||||
Bit16u countLRUcache; // -0x16 LRU counter for FCB caching
|
||||
Bit16u countLRUopens; // -0x14 LRU counter for FCB openings
|
||||
Bit8u stuff1[6]; // -0x12 some stuff, hopefully never used....
|
||||
Bit8u stuff[6]; // -0x12 some stuff, hopefully never used....
|
||||
Bit16u sharingCount; // -0x0c sharing retry count
|
||||
Bit16u sharingDelay; // -0x0a sharing retry delay
|
||||
RealPt diskBufPtr; // -0x08 pointer to disk buffer
|
||||
|
@ -360,13 +364,16 @@ public:
|
|||
RealPt activeClock; // 0x08 active clock device header
|
||||
RealPt activeCon; // 0x0c active console device header
|
||||
Bit16u maxSectorLength; // 0x10 maximum bytes per sector of any block device;
|
||||
RealPt discInfoBuffer; // 0x12 pointer to disc info buffer
|
||||
RealPt diskInfoBuffer; // 0x12 pointer to disk info buffer
|
||||
RealPt curDirStructure; // 0x16 pointer to current array of directory structure
|
||||
RealPt fcbTable; // 0x1a pointer to system FCB table
|
||||
Bit16u protFCBs; // 0x1e protected fcbs
|
||||
Bit8u blockDevices; // 0x20 installed block devices
|
||||
Bit8u lastdrive; // 0x21 lastdrive
|
||||
Bit8u stuff2[0x12]; // 0x22 NUL driver
|
||||
Bit32u nulNextDriver; // 0x22 NUL driver next pointer
|
||||
Bit16u nulAttributes; // 0x26 NUL driver aattributes
|
||||
Bit32u nulStrategy; // 0x28 NUL driver strategy routine
|
||||
Bit8u nulString[8]; // 0x2c NUL driver name string
|
||||
Bit8u joindedDrives; // 0x34 joined drives
|
||||
Bit16u specialCodeSeg; // 0x35 special code segment
|
||||
RealPt setverPtr; // 0x37 pointer to setver
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: dos_classes.cpp,v 1.38 2004-05-15 07:57:04 harekiet Exp $ */
|
||||
/* $Id: dos_classes.cpp,v 1.39 2004-07-08 20:08:52 qbix79 Exp $ */
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -65,8 +65,6 @@ void DOS_InfoBlock::SetLocation(Bit16u segment)
|
|||
/* Clear the initual Block */
|
||||
for(Bitu i=0;i<sizeof(sDIB);i++) mem_writeb(pt+i,0xff);
|
||||
|
||||
sSave(sDIB,activeCon,RealMake(0x54,0));
|
||||
|
||||
sSave(sDIB,regCXfrom5e,(Bit16u)0);
|
||||
sSave(sDIB,countLRUcache,(Bit16u)0);
|
||||
sSave(sDIB,countLRUopens,(Bit16u)0);
|
||||
|
@ -89,6 +87,17 @@ void DOS_InfoBlock::SetLocation(Bit16u segment)
|
|||
sSave(sDIB,sharingCount,(Bit16u)0);
|
||||
sSave(sDIB,sharingDelay,(Bit16u)0);
|
||||
|
||||
sSave(sDIB,nulNextDriver,(Bit32u)0xffffffff);
|
||||
sSave(sDIB,nulAttributes,(Bit16u)0x8004);
|
||||
sSave(sDIB,nulStrategy,(Bit32u)0x00000000);
|
||||
sSave(sDIB,nulString[0],(Bit8u)0x4e);
|
||||
sSave(sDIB,nulString[1],(Bit8u)0x55);
|
||||
sSave(sDIB,nulString[2],(Bit8u)0x4c);
|
||||
sSave(sDIB,nulString[3],(Bit8u)0x20);
|
||||
sSave(sDIB,nulString[4],(Bit8u)0x20);
|
||||
sSave(sDIB,nulString[5],(Bit8u)0x20);
|
||||
sSave(sDIB,nulString[6],(Bit8u)0x20);
|
||||
sSave(sDIB,nulString[7],(Bit8u)0x20);
|
||||
}
|
||||
|
||||
void DOS_InfoBlock::SetFirstMCB(Bit16u _firstmcb)
|
||||
|
@ -106,6 +115,26 @@ void DOS_InfoBlock::SetBuffers(Bit16u x,Bit16u y) {
|
|||
|
||||
}
|
||||
|
||||
void DOS_InfoBlock::SetCurDirStruct(Bit32u _curdirstruct)
|
||||
{
|
||||
sSave(sDIB,curDirStructure,_curdirstruct);
|
||||
}
|
||||
|
||||
void DOS_InfoBlock::SetFCBTable(Bit32u _fcbtable)
|
||||
{
|
||||
sSave(sDIB,fcbTable,_fcbtable);
|
||||
}
|
||||
|
||||
void DOS_InfoBlock::SetDeviceChainStart(Bit32u _devchain)
|
||||
{
|
||||
sSave(sDIB,nulNextDriver,_devchain);
|
||||
}
|
||||
|
||||
void DOS_InfoBlock::SetDiskInfoBuffer(Bit32u _dinfobuf)
|
||||
{
|
||||
sSave(sDIB,diskInfoBuffer,_dinfobuf);
|
||||
}
|
||||
|
||||
RealPt DOS_InfoBlock::GetPointer(void)
|
||||
{
|
||||
return RealMake(seg,offsetof(sDIB,firstDPB));
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: dos_execute.cpp,v 1.41 2004-07-05 11:54:44 harekiet Exp $ */
|
||||
/* $Id: dos_execute.cpp,v 1.42 2004-07-08 20:08:52 qbix79 Exp $ */
|
||||
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
@ -282,7 +282,7 @@ bool DOS_Execute(char * name,PhysPt block_pt,Bit8u flags) {
|
|||
if (!DOS_AllocateMemory(&pspseg,&memsize)) E_Exit("DOS:Exec error in memory");
|
||||
loadseg=pspseg+16;
|
||||
if ((!iscom) & (head.minmemory == 0) & (head.maxmemory == 0))
|
||||
loadseg = (0x9fed0 - imagesize)/16; //c2woody
|
||||
loadseg = (0x9e000 - imagesize)/16; //c2woody
|
||||
|
||||
} else loadseg=block.overlay.loadseg;
|
||||
/* Load the executable */
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "dos_inc.h"
|
||||
|
||||
|
||||
#define MEM_START 0x60 //First Segment that DOS can use
|
||||
#define MEM_START 0x68 //First Segment that DOS can use
|
||||
//#define MEM_START 4000 //First Segment that DOS can use
|
||||
|
||||
static Bit16u memAllocStrategy = 0x00;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: dos_misc.cpp,v 1.10 2004-03-14 19:41:04 qbix79 Exp $ */
|
||||
/* $Id: dos_misc.cpp,v 1.11 2004-07-08 20:08:52 qbix79 Exp $ */
|
||||
|
||||
#include "dosbox.h"
|
||||
#include "callback.h"
|
||||
|
@ -58,6 +58,41 @@ static Bitu INT2A_Handler(void) {
|
|||
|
||||
static bool DOS_MultiplexFunctions(void) {
|
||||
switch (reg_ax) {
|
||||
case 0x1607:
|
||||
if (reg_bx == 0x15) {
|
||||
switch (reg_cx) {
|
||||
case 0x0000: // query instance
|
||||
reg_cx = 0x0001;
|
||||
reg_dx = 0x50; // dos driver segment
|
||||
SegSet16(es,0x50); // patch table seg
|
||||
reg_bx = 0x60; // patch table ofs
|
||||
return true;
|
||||
case 0x0001: // set patches
|
||||
reg_ax = 0xb97c;
|
||||
reg_bx = (reg_dx & 0x16);
|
||||
reg_dx = 0xa2ab;
|
||||
return true;
|
||||
case 0x0003: // get size of data struc
|
||||
if (reg_dx==0x0001) {
|
||||
// CDS size requested
|
||||
reg_ax = 0xb97c;
|
||||
reg_dx = 0xa2ab;
|
||||
reg_cx = 0x000e; // size
|
||||
}
|
||||
return true;
|
||||
case 0x0004: // instanced data
|
||||
reg_dx = 0; // none
|
||||
return true;
|
||||
case 0x0005: // get device driver size
|
||||
reg_ax = 0;
|
||||
reg_dx = 0;
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (reg_bx == 0x18) return true; // idle callout
|
||||
else return false;
|
||||
case 0x1680: /* RELEASE CURRENT VIRTUAL MACHINE TIME-SLICE */
|
||||
//TODO Maybe do some idling but could screw up other systems :)
|
||||
reg_al=0;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: dos_tables.cpp,v 1.12 2004-06-11 12:09:50 qbix79 Exp $ */
|
||||
/* $Id: dos_tables.cpp,v 1.13 2004-07-08 20:08:52 qbix79 Exp $ */
|
||||
|
||||
#include "dosbox.h"
|
||||
#include "mem.h"
|
||||
|
@ -52,39 +52,67 @@ Bit16u DOS_GetMemory(Bit16u pages) {
|
|||
|
||||
void DOS_SetupTables(void) {
|
||||
dos_memseg=0xd000;
|
||||
Bit16u seg;Bitu i;
|
||||
Bit16u seg,seg2;Bitu i;
|
||||
dos.tables.mediaid=RealMake(DOS_GetMemory(2),0);
|
||||
dos.tables.tempdta=RealMake(DOS_GetMemory(4),0);
|
||||
for (i=0;i<DOS_DRIVES;i++) mem_writeb(Real2Phys(dos.tables.mediaid)+i,0);
|
||||
/* Create the DOS Info Block */
|
||||
dos_infoblock.SetLocation(0x4e); //c2woody
|
||||
|
||||
/* Create a fake SFT, so programs think there are 100 file handles */
|
||||
seg=DOS_GetMemory(1);
|
||||
real_writed(seg,0,0xffffffff); //Last File Table
|
||||
real_writew(seg,4,100); //File Table supports 100 files
|
||||
dos_infoblock.SetfirstFileTable(RealMake(seg,0));
|
||||
/* Set buffers to a nice value */
|
||||
dos_infoblock.SetBuffers(50,50);
|
||||
dos_infoblock.SetLocation(0x50); //c2woody
|
||||
|
||||
/* create SDA */
|
||||
sdaseg=0x5a;
|
||||
DOS_SDA(sdaseg,0).Init();
|
||||
|
||||
/* Some weird files >20 detection routine */
|
||||
/* Possibly obselete when SFT is properly handled */
|
||||
// CON string
|
||||
real_writew(0x54,0x00+0x00, (Bit16u) 0x4f43);
|
||||
real_writew(0x54,0x00+0x02, (Bit16u) 0x204e);
|
||||
// CON string
|
||||
real_writew(0x54,0x10+0x00, (Bit16u) 0x4f43);
|
||||
real_writew(0x54,0x10+0x02, (Bit16u) 0x204e);
|
||||
//CON string
|
||||
real_writew(0x54,0x20+0x00, (Bit16u) 0x4f43);
|
||||
real_writew(0x54,0x20+0x02, (Bit16u) 0x204e);
|
||||
real_writed(0x5d,0x0a,0x204e4f43);
|
||||
real_writed(0x5d,0x1a,0x204e4f43);
|
||||
real_writed(0x5d,0x2a,0x204e4f43);
|
||||
|
||||
/* create a CON device driver */
|
||||
seg=0x60;
|
||||
real_writed(seg,0x00,0xffffffff); // next ptr
|
||||
real_writew(seg,0x04,0x8013); // attributes
|
||||
real_writed(seg,0x06,0xffffffff); // strategy routine
|
||||
real_writed(seg,0x0a,0x204e4f43); // driver name
|
||||
real_writed(seg,0x0e,0x20202020); // driver name
|
||||
dos_infoblock.SetDeviceChainStart(RealMake(seg,0));
|
||||
|
||||
/* Create a fake SFT, so programs think there are 100 file handles */
|
||||
seg=0x62;
|
||||
seg2=0x63;
|
||||
real_writed(seg,0,seg2<<16); //Next File Table
|
||||
real_writew(seg,4,100); //File Table supports 100 files
|
||||
real_writed(seg2,0,0xffffffff); //Last File Table
|
||||
real_writew(seg2,4,100); //File Table supports 100 files
|
||||
dos_infoblock.SetfirstFileTable(RealMake(seg,0));
|
||||
|
||||
/* Create a fake CDS */
|
||||
seg=0x64;
|
||||
real_writed(seg,0x00,0x005c3a43);
|
||||
dos_infoblock.SetCurDirStruct(RealMake(seg,0));
|
||||
|
||||
|
||||
|
||||
/* Allocate some fake memory else pharlab doesn't like the indos pointer */
|
||||
/* Pharlab seems to real picky. So don't change this unless needed (the amount of allocated memory that is) */
|
||||
/* Allocate DCBS DOUBLE BYTE CHARACTER SET LEAD-BYTE TABLE */
|
||||
dos.tables.dcbs=RealMake(DOS_GetMemory(12),0);
|
||||
mem_writew(Real2Phys(dos.tables.dcbs),0); //empty table
|
||||
sdaseg=DOS_GetMemory(3);
|
||||
DOS_SDA(sdaseg,0).Init();
|
||||
|
||||
/* Create a fake FCB SFT */
|
||||
seg=DOS_GetMemory(4);
|
||||
real_writed(seg,0,0xffffffff); //Last File Table
|
||||
real_writew(seg,4,100); //File Table supports 100 files
|
||||
dos_infoblock.SetFCBTable(RealMake(seg,0));
|
||||
|
||||
/* Create a fake disk info buffer */
|
||||
seg=DOS_GetMemory(6);
|
||||
seg2=DOS_GetMemory(6);
|
||||
real_writed(seg,0x00,seg2<<16);
|
||||
real_writed(seg2,0x00,0xffffffff);
|
||||
real_writed(seg2,0x0d,0xffffffff);
|
||||
dos_infoblock.SetDiskInfoBuffer(RealMake(seg,0));
|
||||
|
||||
/* Set buffers to a nice value */
|
||||
dos_infoblock.SetBuffers(50,50);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue