public static CLR_IRQHandler DEV9irqHandler() { try { // Pass our handler to pcsx2. if (irqHandle.IsAllocated) { irqHandle.Free(); //allow garbage collection } Log_Info("Get IRQ"); CLR_IRQHandler fp = new CLR_IRQHandler(_DEV9irqHandler); irqHandle = GCHandle.Alloc(fp); //prevent GC return(fp); } catch (Exception e) when(Log_Fatal(e)) { throw; } }
public static CLR_IRQHandler DEV9irqHandler() { try { // Pass our handler to pcsx2. if (irqHandle.IsAllocated) { irqHandle.Free(); //allow garbage collection } Log_Info("Get IRQ"); CLR_IRQHandler fp = new CLR_IRQHandler(_DEV9irqHandler); irqHandle = GCHandle.Alloc(fp); //prevent GC return(fp); } catch (Exception e) { CLR_PSE_PluginLog.MsgBoxErrorTrapper(e); throw; } }
public static CLR_IRQHandler DEV9irqHandler() { try { // Pass our handler to pcsx2. if (irqHandle.IsAllocated) { irqHandle.Free(); //allow garbage collection } Log_Info("Get IRQ"); CLR_IRQHandler fp = new CLR_IRQHandler(_DEV9irqHandler); irqHandle = GCHandle.Alloc(fp); //prevent GC return fp; } catch (Exception e) { CLR_PSE_PluginLog.MsgBoxError(e); throw; } }
//Less messy to do here than in mono-embed static IntPtr FunctionPointerFromIRQHandler(CLR_IRQHandler func) { return(Marshal.GetFunctionPointerForDelegate(func)); }