public SceUID sceIoDopen(string DirectoryPath) { try { var Info = HleIoManager.ParsePath(DirectoryPath); Info.HleIoDrvFileArg.HleIoDriver.IoDopen(Info.HleIoDrvFileArg, Info.LocalPath); return(HleIoManager.HleIoDrvFileArgPool.Create(Info.HleIoDrvFileArg)); } catch (DirectoryNotFoundException) { throw new SceKernelException(SceKernelErrors.ERROR_ERRNO_FILE_NOT_FOUND); } catch (FileNotFoundException) { throw new SceKernelException(SceKernelErrors.ERROR_ERRNO_FILE_NOT_FOUND); } catch (InvalidOperationException InvalidOperationException) { Console.Error.WriteLine(InvalidOperationException); } finally { _DelayIo(IoDelayType.Dopen); } throw new SceKernelException(SceKernelErrors.ERROR_ERRNO_NOT_A_DIRECTORY); }
public int sceIoGetstat(string FileName, SceIoStat *SceIoStat) { var Info = HleIoManager.ParsePath(FileName); try { Info.HleIoDriver.IoGetstat(Info.HleIoDrvFileArg, Info.LocalPath, SceIoStat); return(0); } catch (FileNotFoundException FileNotFoundException) { Console.Error.WriteLine("Can't find file '{0}'", FileName); Console.Error.WriteLine(FileNotFoundException); return((int)SceKernelErrors.ERROR_ERRNO_FILE_NOT_FOUND); } catch (Exception Exception) { Console.Error.WriteLine(Exception); return(-1); } finally { _DelayIo(IoDelayType.GetStat); } }
public int sceIoAddDrv(PspIoDrv *PspIoDrv) { var Name = Memory.ReadStringz(PspIoDrv->name, Encoding.UTF8); HleIoManager.SetDriver(Name + ":", new GuestHleIoDriver(InjectContext, PspIoDrv)); return(0); }
public override void InitializeComponent() { this.IsRunning = true; this.CpuProcessor = PspEmulatorContext.GetInstance <CpuProcessor>(); this.GpuProcessor = PspEmulatorContext.GetInstance <GpuProcessor>(); this.PspAudio = PspEmulatorContext.GetInstance <PspAudio>(); this.PspConfig = PspEmulatorContext.PspConfig; this.PspRtc = PspEmulatorContext.GetInstance <PspRtc>(); this.PspDisplay = PspEmulatorContext.GetInstance <PspDisplay>(); this.PspController = PspEmulatorContext.GetInstance <PspController>(); this.MipsEmiter = new MipsEmiter(); this.Kirk = new Kirk(); this.Kirk.kirk_init(); this.HleOutputHandler = PspEmulatorContext.GetInstance <HleOutputHandler>(); // @TODO FIX! New Instances!? this.ThreadManager = PspEmulatorContext.GetInstance <HleThreadManager>(); this.SemaphoreManager = PspEmulatorContext.GetInstance <HleSemaphoreManager>(); this.EventFlagManager = PspEmulatorContext.GetInstance <HleEventFlagManager>(); this.MemoryManager = new HleMemoryManager(this.CpuProcessor.Memory); this.ModuleManager = PspEmulatorContext.GetInstance <HleModuleManager>(); this.CallbackManager = PspEmulatorContext.GetInstance <HleCallbackManager>(); this.HleIoManager = PspEmulatorContext.GetInstance <HleIoManager>(); this.HleRegistryManager = PspEmulatorContext.GetInstance <HleRegistryManager>(); this.HleInterruptManager = PspEmulatorContext.GetInstance <HleInterruptManager>(); }
public int sceIoChstat(string FileName, SceIoStat *SceIoStat, int Bitmask) { try { var Info = HleIoManager.ParsePath(FileName); return(Info.HleIoDriver.IoChstat(Info.HleIoDrvFileArg, FileName, SceIoStat, Bitmask)); } finally { _DelayIo(IoDelayType.ChStat); } }
public int sceIoRmdir(string DirectoryPath) { try { var Info = HleIoManager.ParsePath(DirectoryPath); Info.HleIoDrvFileArg.HleIoDriver.IoRmdir(Info.HleIoDrvFileArg, Info.LocalPath); return(0); } finally { _DelayIo(IoDelayType.Rmdir); } }
public int sceIoRename(string OldFileName, string NewFileName) { try { var Info1 = HleIoManager.ParsePath(OldFileName); var Info2 = HleIoManager.ParsePath(NewFileName); if (!Info1.Equals(Info2)) { throw new NotImplementedException("Rename from different filesystems"); } return(Info1.HleIoDriver.IoRename(Info1.HleIoDrvFileArg, OldFileName, NewFileName)); } finally { _DelayIo(IoDelayType.Rename); } }
public int sceIoRemove(string FileName) { try { var Info = HleIoManager.ParsePath(FileName); return(Info.HleIoDriver.IoRemove(Info.HleIoDrvFileArg, FileName)); } catch (Exception Exception) { Console.Error.WriteLine(Exception); return(-1); } finally { _DelayIo(IoDelayType.Remove); } }
public SceUID _sceIoOpen(string FileName, HleIoFlags Flags, SceMode Mode, bool Async) { var Info = HleIoManager.ParsePath(FileName); try { ConsoleUtils.SaveRestoreConsoleColor(ConsoleColor.DarkGreen, () => { Console.WriteLine("Opened ({0}): '{1}'", Async ? "Async" : "NO Async", FileName); }); Info.HleIoDrvFileArg.HleIoDriver.IoOpen(Info.HleIoDrvFileArg, Info.LocalPath, Flags, Mode); Info.HleIoDrvFileArg.FullFileName = FileName; var Uid = HleIoManager.HleIoDrvFileArgPool.Create(Info.HleIoDrvFileArg); if (Async) { Info.HleIoDrvFileArg.AsyncLastResult = (long)Uid; } return(Uid); } catch (IOException IOException) { Logger.Error("IOException: {0}", IOException); } catch (InvalidOperationException InvalidOperationException) { Logger.Error("InvalidOperationException: {0}", InvalidOperationException); } finally { if (!Async) { _DelayIo(IoDelayType.Open); } } if (Async) { Info.HleIoDrvFileArg.AsyncLastResult = (long)SceKernelErrors.ERROR_ERRNO_FILE_NOT_FOUND; return(HleIoManager.HleIoDrvFileArgPool.Create(Info.HleIoDrvFileArg)); } else { //Console.Error.WriteLine("Didn't find file '{0}'", FileName); throw new SceKernelException(SceKernelErrors.ERROR_ERRNO_FILE_NOT_FOUND, $"Didn't find file '{FileName}'"); } }
//[HlePspNotImplemented] public int sceIoDevctl(string DeviceName, uint Command, byte *InputPointer, int InputLength, byte *OutputPointer, int OutputLength) { try { var Info = HleIoManager.ParseDeviceName(DeviceName); return(Info.HleIoDrvFileArg.HleIoDriver.IoDevctl(Info.HleIoDrvFileArg, DeviceName, Command, InputPointer, InputLength, OutputPointer, OutputLength)); } catch (NotImplementedException NotImplementedException) { Console.Error.WriteLine(NotImplementedException); return(-1); } finally { _DelayIo(IoDelayType.Devctl); } }
public int sceIoDelDrv(string DriverName) { HleIoManager.RemoveDriver(DriverName + ":"); return(0); }