public DiscInterface(IExternalCoreAccessor accessor) : base(accessor) { UnmanagedOpaque = QueryCoreCall <Func <IntPtr, IntPtr> >("DiscInterface.Construct")(ManagedOpaque); SetFp("Dispose", new disposeDelegate(Dispose)); SetFp("GetNumSessions", new GetNumSessionsDelegate(GetNumSessions)); SetFp("GetNumTracks", new GetNumTracksDelegate(GetNumTracks)); SetFp("GetTrack", new GetTrackDelegate(GetTrack)); }
public override void Dispose() { if (disposed) { return; } disposed = true; QueryCoreCall <Action>("DiscInterface.Delete")(); base.Dispose(); }
public EmuFile(IExternalCoreAccessor accessor) : base(accessor) { UnmanagedOpaque = QueryCoreCall <Func <IntPtr, IntPtr> >("EmuFile.Construct")(ManagedOpaque); SetFp("fgetc", new fgetcDelegate(fgetc)); SetFp("fread", new freadDelegate(fread)); SetFp("fwrite", new fwriteDelegate(fwrite)); SetFp("fseek", new fseekDelegate(fseek)); SetFp("ftell", new ftellDelegate(ftell)); SetFp("size", new sizeDelegate(size)); SetFp("dispose", new disposeDelegate(Dispose)); }
public override void Dispose() { if (disposed) { return; } disposed = true; //we will call Delete in the c++ side, which will delete the object, and cause Dispose() to get called. //but, Dispose() can never be called again due to setting the flag above QueryCoreCall <Action>("EmuFile.Delete")(); //do we always want to do this? not sure. but usually. BaseStream.Dispose(); base.Dispose(); }
public PsxCore(IExternalCoreAccessor accessor) : base(accessor) { var domains = new List <MemoryDomain>(1); memoryDomains = domains.AsReadOnly(); CoreOutputComm = new CoreOutputComm(); CoreInputComm = new CoreInputComm(); mDiscInterface = new DiscInterface(mAccessor); UnmanagedOpaque = QueryCoreCall <Func <IntPtr, IntPtr> >("PsxCore.Construct")(ManagedOpaque); QueryCoreCall(out cGetResolution, "PsxCore.GetResolution"); QueryCoreCall(out cUpdateVideoBuffer, "PsxCore.UpdateVideoBuffer"); QueryCoreCall(out cFrameAdvance, "PsxCore.FrameAdvance"); }
void SetFp(string name, Delegate del) { QueryCoreCall <Action <string, IntPtr> >("DiscInterface.Set_fp")(name, ExportDelegate(del)); }