From d60f2f6da066a21bddc6a352e029db39ca5e499d Mon Sep 17 00:00:00 2001 From: Ulf Wohlers Date: Tue, 27 Aug 2002 10:30:33 +0000 Subject: [PATCH] Added DOS_InfoBlock - firstMCB support Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@229 --- src/dos/dos.cpp | 14 ++++++++------ src/dos/dos_classes.cpp | 20 ++++++++++++++++++++ src/dos/dos_memory.cpp | 4 ++++ 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/dos/dos.cpp b/src/dos/dos.cpp index 33439ad1..a2f40513 100644 --- a/src/dos/dos.cpp +++ b/src/dos/dos.cpp @@ -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 */ diff --git a/src/dos/dos_classes.cpp b/src/dos/dos_classes.cpp index 42c14913..04cd8a33 100644 --- a/src/dos/dos_classes.cpp +++ b/src/dos/dos_classes.cpp @@ -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); +}; diff --git a/src/dos/dos_memory.cpp b/src/dos/dos_memory.cpp index 2a4bcc14..14e8a5d9 100644 --- a/src/dos/dos_memory.cpp +++ b/src/dos/dos_memory.cpp @@ -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)); }