1
0
Fork 0

Added Int 21/67: Set file handle count

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@665
This commit is contained in:
Ulf Wohlers 2003-02-14 22:16:19 +00:00
parent e727664414
commit 44e7e65ab5
3 changed files with 23 additions and 5 deletions

View file

@ -259,7 +259,8 @@ public:
void SetFCB1 (RealPt src);
void SetFCB2 (RealPt src);
void SetCommandTail (RealPt src);
bool SetNumFiles (Bit16u fileNum);
private:
#pragma pack(1)
struct sPSP {

View file

@ -784,11 +784,14 @@ static Bitu DOS_21Handler(void) {
}
LOG_ERROR("DOS:Setting code page table is not supported");
break;
case 0x67: /* Set handle countr */
case 0x67: /* Set handle count */
/* Weird call to increase amount of file handles needs to allocate memory if >20 */
LOG_DEBUG("DOS:67:Set Handle Count not working");
CALLBACK_SCF(false);
break;
{
DOS_PSP psp(dos.psp);
psp.SetNumFiles(reg_bx);
CALLBACK_SCF(false);
break;
};
case 0x69: /* Get/Set disk serial number */
{
switch(reg_al) {

View file

@ -197,6 +197,20 @@ void DOS_PSP::SetFCB2(RealPt src)
if (src) MEM_BlockCopy(PhysMake(seg,offsetof(sPSP,fcb2)),Real2Phys(src),16);
};
bool DOS_PSP::SetNumFiles(Bit16u fileNum)
{
// Allocate needed paragraphs
Bit16u para = (fileNum/16)+((fileNum%16)>0);
RealPt data = RealMake(DOS_GetMemory(para),0);
sSave(sPSP,file_table,data);
sSave(sPSP,max_files,fileNum);
if (fileNum>20) {
for (Bit16u i=0; i<20; i++) SetFileHandle(i,sGet(sPSP,files[i]));
for (i=20; i<fileNum; i++) SetFileHandle(i,0xFF);
};
return true;
};
void DOS_DTA::SetupSearch(Bit8u _sdrive,Bit8u _sattr,char * pattern) {
sSave(sDTA,sdrive,_sdrive);