diff --git a/include/dos_inc.h b/include/dos_inc.h index ba9a9ee..fa128d9 100644 --- a/include/dos_inc.h +++ b/include/dos_inc.h @@ -286,19 +286,19 @@ public: void SaveVectors (void); void RestoreVectors (void); - void SetSize (Bit16u size) { SaveIt(2,0x02,size); /*sSave(sPSP,next_seg,size);*/ }; - Bit16u GetSize (void) { return (Bit16u)GetIt(2,0x02); /*sGet(sPSP,next_seg);*/ }; - void SetEnvironment (Bit16u envseg) { SaveIt(2,0x2c,envseg);/*sSave(sPSP,environment,envseg);*/ }; - Bit16u GetEnvironment (void) { return (Bit16u)GetIt(2,0x2c);/*return (Bit16u)sGet(sPSP,environment);*/ }; + void SetSize (Bit16u size) { sSave(sPSP,next_seg,size); }; + Bit16u GetSize (void) { return (Bit16u)sGet(sPSP,next_seg); }; + void SetEnvironment (Bit16u envseg) { sSave(sPSP,environment,envseg); }; + Bit16u GetEnvironment (void) { return (Bit16u)sGet(sPSP,environment); }; Bit16u GetSegment (void) { return seg; }; void SetFileHandle (Bit16u index, Bit8u handle); Bit8u GetFileHandle (Bit16u index); - void SetParent (Bit16u parent) { SaveIt(2,0x16,parent); /*sSave(sPSP,psp_parent,parent);*/ }; - Bit16u GetParent (void) { return (Bit16u)GetIt(2,0x16);/*sGet(sPSP,psp_parent);*/ }; - void SetStack (RealPt stackpt) { SaveIt(4,0x2e,stackpt); /*sSave(sPSP,stack,stackpt);*/ }; - RealPt GetStack (void) { return GetIt(4,0x2e);/*sGet(sPSP,stack);*/ }; - void SetInt22 (RealPt int22pt) { SaveIt(4,0x0A,int22pt);/*sSave(sPSP,int_22,int22pt);*/ }; - RealPt GetInt22 (void) { return GetIt(4,0x0A); /*sGet(sPSP,int_22);*/ }; + void SetParent (Bit16u parent) { sSave(sPSP,psp_parent,parent); }; + Bit16u GetParent (void) { return (Bit16u)sGet(sPSP,psp_parent); }; + void SetStack (RealPt stackpt) { sSave(sPSP,stack,stackpt); }; + RealPt GetStack (void) { return sGet(sPSP,stack); }; + void SetInt22 (RealPt int22pt) { sSave(sPSP,int_22,int22pt); }; + RealPt GetInt22 (void) { return sGet(sPSP,int_22); }; void SetFCB1 (RealPt src); void SetFCB2 (RealPt src); void SetCommandTail (RealPt src); diff --git a/src/dos/dos_classes.cpp b/src/dos/dos_classes.cpp index 8f54ea4..80161f2 100644 --- a/src/dos/dos_classes.cpp +++ b/src/dos/dos_classes.cpp @@ -175,45 +175,32 @@ void DOS_PSP::MakeNew(Bit16u mem_size) { // DOS_PSP prevpsp(dos.psp()); /* Clear it first */ Bitu i; - for (i=0;i<0x100;i++) mem_writeb(pt+i,0); + for (i=0;i=GetIt(2,0x32)) return 0xff; - PhysPt files=Real2Phys(GetIt(4,0x34)); - /*if (index>=sGet(sPSP,max_files)) return 0xff; - PhysPt files=Real2Phys(sGet(sPSP,file_table));*/ + if (index>=sGet(sPSP,max_files)) return 0xff; + PhysPt files=Real2Phys(sGet(sPSP,file_table)); return mem_readb(files+index); } void DOS_PSP::SetFileHandle(Bit16u index, Bit8u handle) { - if (index0); RealPt data = RealMake(DOS_GetMemory(para),0); - SaveIt(4,0x34,data); - //sSave(sPSP,file_table,data); - SaveIt(2,0x32,fileNum); - //sSave(sPSP,max_files,fileNum); + sSave(sPSP,file_table,data); + sSave(sPSP,max_files,fileNum); Bit16u i; - for (i=0; i<20; i++) SetFileHandle(i,GetIt(1,0x18+i*1)/*sGet(sPSP,files[i])*/); + for (i=0; i<20; i++) SetFileHandle(i,sGet(sPSP,files[i])); for (i=20; i