Check if files are withing MAX_FILES limits
Added buffers to lists of lists. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1048
This commit is contained in:
parent
3ea9d2e62a
commit
25a243ed74
2 changed files with 10 additions and 2 deletions
|
@ -73,6 +73,12 @@ void DOS_InfoBlock::SetfirstFileTable(RealPt _first_table){
|
|||
sSave(sDIB,firstFileTable,_first_table);
|
||||
}
|
||||
|
||||
void DOS_InfoBlock::SetBuffers(Bit16u x,Bit16u y) {
|
||||
sSave(sDIB,buffers_x,x);
|
||||
sSave(sDIB,buffers_y,y);
|
||||
|
||||
}
|
||||
|
||||
RealPt DOS_InfoBlock::GetPointer(void)
|
||||
{
|
||||
return RealMake(seg,offsetof(sDIB,firstDPB));
|
||||
|
@ -164,7 +170,7 @@ void DOS_PSP::CopyFileTable(DOS_PSP* srcpsp,bool createchildpsp)
|
|||
if(createchildpsp)
|
||||
{ //copy obeying not inherit flag.(but dont duplicate them)
|
||||
bool allowCopy = (handle==0) || ((handle>0) && (FindEntryByHandle(handle)==0xff));
|
||||
if(Files[handle] && !(Files[handle]->flags & DOS_NOT_INHERIT) && allowCopy)
|
||||
if((handle<DOS_FILES) && Files[handle] && !(Files[handle]->flags & DOS_NOT_INHERIT) && allowCopy)
|
||||
{
|
||||
SetFileHandle(i,handle);
|
||||
}
|
||||
|
|
|
@ -55,12 +55,14 @@ void DOS_SetupTables(void) {
|
|||
for (i=0;i<DOS_DRIVES;i++) mem_writeb(Real2Phys(dos.tables.mediaid)+i,0);
|
||||
mem_writeb(Real2Phys(dos.tables.indosflag),0);
|
||||
/* Create the DOS Info Block */
|
||||
dos_infoblock.SetLocation(DOS_GetMemory(6));
|
||||
dos_infoblock.SetLocation(DOS_GetMemory(1+(sizeof(DOS_InfoBlock::sDIB)/16)));
|
||||
/* 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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue