diff --git a/dosbox-wii.pnproj b/dosbox-wii.pnproj
index 3a16c87..f95792f 100644
--- a/dosbox-wii.pnproj
+++ b/dosbox-wii.pnproj
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/include/dos_inc.h b/include/dos_inc.h
index fa128d9..ba9a9ee 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) { 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); };
+ 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);*/ };
Bit16u GetSegment (void) { return seg; };
void SetFileHandle (Bit16u index, Bit8u handle);
Bit8u GetFileHandle (Bit16u index);
- 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 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 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 9d2fe6f..8f54ea4 100644
--- a/src/dos/dos_classes.cpp
+++ b/src/dos/dos_classes.cpp
@@ -25,7 +25,6 @@
#include "dos_inc.h"
#include "support.h"
-
void DOS_ParamBlock::Clear(void) {
memset(&exec,0,sizeof(exec));
memset(&overlay,0,sizeof(overlay));
@@ -176,32 +175,45 @@ void DOS_PSP::MakeNew(Bit16u mem_size) {
// DOS_PSP prevpsp(dos.psp());
/* Clear it first */
Bitu i;
- for (i=0;i=sGet(sPSP,max_files)) return 0xff;
- PhysPt files=Real2Phys(sGet(sPSP,file_table));
+ if (index>=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));*/
return mem_readb(files+index);
}
void DOS_PSP::SetFileHandle(Bit16u index, Bit8u handle) {
- if (index0);
RealPt data = RealMake(DOS_GetMemory(para),0);
- sSave(sPSP,file_table,data);
- sSave(sPSP,max_files,fileNum);
+ SaveIt(4,0x34,data);
+ //sSave(sPSP,file_table,data);
+ SaveIt(2,0x32,fileNum);
+ //sSave(sPSP,max_files,fileNum);
Bit16u i;
- for (i=0; i<20; i++) SetFileHandle(i,sGet(sPSP,files[i]));
+ for (i=0; i<20; i++) SetFileHandle(i,GetIt(1,0x18+i*1)/*sGet(sPSP,files[i])*/);
for (i=20; i