Exemple #1
0
        private static void QueueCheck(mTiming *timing, void *context, uint cyclesLate)
        {
            if (Dequeue())
            {
                return;
            }

            mTimingSchedule(Timing, QueueCheckEvent, SyncWait);
        }
Exemple #2
0
        private static void mTimingInit(IntPtr timingPtr, IntPtr relativeCyclesPtr, IntPtr nextEventPtr)
        {
            int *relativeCycles = (int *)relativeCyclesPtr;
            int *nextEvent      = (int *)nextEventPtr;

            Console.WriteLine($"mTimingInit, timing @ 0x{timingPtr.ToString("X16")}, relativeCycles: {*relativeCycles}, nextEvent: {*nextEvent}");
            orig_mTimingInit(timingPtr, relativeCyclesPtr, nextEventPtr);

            Timing = (mTiming *)timingPtr;

            GBSIOSetDriver(SIO, Driver);
        }
Exemple #3
0
        public void Dispose()
        {
            if (!Links.Contains(this))
            {
                return;
            }

            Links.Remove(this);
            if (Links.Count > 0)
            {
                return;
            }

            // Last link - dispose.
            h_GBSIOInit.Undo();
            h_GBSIOInit.Free();
            h_GBSIOInit = null;

            h_GBSIODeinit.Undo();
            h_GBSIODeinit.Free();
            h_GBSIODeinit = null;

            h_mTimingInit.Undo();
            h_mTimingInit.Free();
            h_mTimingInit = null;

            h_mCoreConfigLoadDefaults.Undo();
            h_mCoreConfigLoadDefaults.Free();
            h_mCoreConfigLoadDefaults = null;

            h_mSDLAttachPlayer.Undo();
            h_mSDLAttachPlayer.Free();
            h_mSDLAttachPlayer = null;

            Timing = (mTiming *)IntPtr.Zero;
            SIO    = (GBSIO *)IntPtr.Zero;

            Marshal.FreeHGlobal((IntPtr)Driver);
            Driver = (GBSIODriver *)IntPtr.Zero;

            Marshal.FreeHGlobal((IntPtr)QueueCheckEvent->name);
            Marshal.FreeHGlobal((IntPtr)QueueCheckEvent);
            QueueCheckEvent = (mTimingEvent *)IntPtr.Zero;
        }
Exemple #4
0
 public static bool mTimingIsScheduled(mTiming *timing, mTimingEvent * @event) => INTERNAL_mTimingIsScheduled((IntPtr)timing, (IntPtr)@event);
Exemple #5
0
 public static void mTimingDeschedule(mTiming *timing, mTimingEvent * @event) => INTERNAL_mTimingDeschedule((IntPtr)timing, (IntPtr)@event);
Exemple #6
0
 public static void mTimingSchedule(mTiming *timing, mTimingEvent * @event, int when) => INTERNAL_mTimingSchedule((IntPtr)timing, (IntPtr)@event, when);
Exemple #7
0
 public static void _GBSIOProcessEvents(mTiming *timing, void *context, uint cyclesLate) => INTERNAL__GBSIOProcessEvents((IntPtr)timing, (IntPtr)context, cyclesLate);