1
0
Fork 0

Added DOS_InfoBlock - firstMCB support

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@229
This commit is contained in:
Ulf Wohlers 2002-08-27 10:30:33 +00:00
parent 29354c1390
commit d60f2f6da0
3 changed files with 32 additions and 6 deletions

View file

@ -29,6 +29,8 @@
#include "dos_inc.h"
DOS_Block dos;
DOS_InfoBlock dosInfoBlock;
static Bit8u dos_copybuf[0x10000];
static Bitu call_20,call_21,call_theend;
@ -532,7 +534,6 @@ static Bitu DOS_21Handler(void) {
CALLBACK_SCF(true);
}
break;
break;
case 0x47: /* CWD Get current directory */
//TODO Memory
if (DOS_GetCurrentDir(reg_dl,name1)) {
@ -628,11 +629,12 @@ static Bitu DOS_21Handler(void) {
case 0x51: /* Get current PSP */
reg_bx=dos.psp;
break;
case 0x52: /* Get list of lists */
SegSet16(es,0);
reg_bx=0;
LOG_ERROR("Call is made for list of lists not supported let's hope for the best");
break;
case 0x52: { /* Get list of lists */
Bit16u seg;
dosInfoBlock.GetDIBPointer(seg,reg_bx);
SegSet16(es,seg);
LOG_DEBUG("Call is made for list of lists - let's hope for the best");
break; }
//TODO Think hard how shit this is gonna be
//And will any game ever use this :)
case 0x53: /* Translate BIOS parameter block to drive parameter block */

View file

@ -266,3 +266,23 @@ RealPt DOS_ParamBlock::cmdtail(void){
return mem_readd(off+offsetof(sParamBlock,exec.cmdtail));
}
// * Dos Info Block (list of lists) *
void DOS_InfoBlock::SetLocation(Bit16u segment)
{
seg = segment;
dib = (SDosInfoBlock*)HostMake(segment,0);
Bit16u size = sizeof(SDosInfoBlock);
memset(dib,0,sizeof(SDosInfoBlock));
};
void DOS_InfoBlock::SetFirstMCB(RealPt pt)
{
dib->firstMCB = pt;
};
void DOS_InfoBlock::GetDIBPointer(Bit16u& segment, Bit16u& offset)
{
segment = seg;
offset = offsetof(SDosInfoBlock,firstDPB);
};

View file

@ -158,5 +158,9 @@ void DOS_SetupMemory(void) {
mcb->size=0x9FFE - MEM_START;
mcb->type=0x5a; //Last Block
dos.firstMCB=MEM_START;
// Create Dos Info Block : maximum size 95 Bytes....
dosInfoBlock.SetLocation(DOS_GetMemory(6));
dosInfoBlock.SetFirstMCB(RealMake(dos.firstMCB,0));
}