diff --git a/libretro/glue.c b/libretro/glue.c index f5d1ac9a24..c9b13a1a12 100644 --- a/libretro/glue.c +++ b/libretro/glue.c @@ -110,6 +110,20 @@ pascal OSErr FSRead (short refNum, long *count, void *buffPtr) return err; } +pascal OSErr FSWrite (short refNum, long *count, const void *buffPtr) +{ + OSErr err; + ParamBlockRec pb; + memset(&pb, 0, sizeof(pb)); + pb.ioParam.ioRefNum = refNum; + pb.ioParam.ioBuffer = (void *)buffPtr; + pb.ioParam.ioReqCount = *count; + + err = PBWriteSync(&pb); + *count = pb.ioParam.ioActCount; + return err; +} + pascal OSErr GetEOF (short refNum, long *logEOF) { OSErr err; @@ -120,3 +134,23 @@ pascal OSErr GetEOF (short refNum, long *logEOF) *logEOF = (long)pb.ioParam.ioMisc; return err; } + +pascal OSErr GetFPos (short refNum, long *filePos) +{ + OSErr err; + ParamBlockRec pb; + pb.ioParam.ioRefNum = refNum; + err = PBGetFPosSync(&pb); + *filePos = pb.ioParam.ioPosOffset; + return err; +} + +pascal OSErr SetFPos (short refNum, short posMode, long posOff) +{ + ParamBlockRec pb; + memset(&pb, 0, sizeof(pb)); + pb.ioParam.ioRefNum = refNum; + pb.ioParam.ioPosMode = posMode; + pb.ioParam.ioPosOffset = posOff; + return PBSetFPosSync(&pb); +}