Exemple #1
0
        protected internal virtual void executeInterrupts(IList <AbstractInterruptHandler> interruptHandlers, IAction afterInterruptAction, IAction afterHandlerAction)
        {
            if (interruptHandlers != null)
            {
                for (IEnumerator <AbstractInterruptHandler> it = interruptHandlers.GetEnumerator(); it.MoveNext();)
                {
                    AbstractInterruptHandler interruptHandler = it.Current;
                    if (interruptHandler != null)
                    {
                        interruptHandler.execute();
                    }
                }
            }

            if (allegrexInterruptHandlers.Count == 0)
            {
                if (afterInterruptAction != null)
                {
                    afterInterruptAction.execute();
                }
                onEndOfInterrupt();
            }
            else
            {
                InterruptState interruptState = new InterruptState();
                interruptState.save(insideInterrupt, Emulator.Processor.cpu, afterInterruptAction, afterHandlerAction);
                InsideInterrupt = true;

                IEnumerator <AbstractAllegrexInterruptHandler> allegrexInterruptHandlersIterator = allegrexInterruptHandlers.GetEnumerator();
                IAction continueAction = new AfterSubIntrAction(this, interruptState, allegrexInterruptHandlersIterator);

                continueCallAllegrexInterruptHandler(interruptState, allegrexInterruptHandlersIterator, continueAction);
            }
        }
Exemple #2
0
        public virtual void addDeferredInterrupt(AbstractInterruptHandler interruptHandler)
        {
            //if (log.DebugEnabled)
            {
//JAVA TO C# CONVERTER TODO TASK: The following line has a Java format specifier which cannot be directly translated to .NET:
//ORIGINAL LINE: Console.WriteLine(String.format("addDeferredInterrupt insideInterrupt=%b, interruptsEnabled=%b", isInsideInterrupt(), pspsharp.Emulator.getProcessor().isInterruptsEnabled()));
                Console.WriteLine(string.Format("addDeferredInterrupt insideInterrupt=%b, interruptsEnabled=%b", InsideInterrupt, Emulator.Processor.InterruptsEnabled));
            }
            deferredInterrupts.Add(interruptHandler);
        }
Exemple #3
0
        public virtual bool removeInterruptHandler(int intrNumber, AbstractInterruptHandler interruptHandler)
        {
            if (intrNumber < 0 || intrNumber >= PSP_NUMBER_INTERRUPTS)
            {
                return(false);
            }

            LinkedList <AbstractInterruptHandler> interruptHandlers = interrupts[intrNumber];

            if (interruptHandlers == null)
            {
                return(false);
            }

//JAVA TO C# CONVERTER TODO TASK: There is no .NET LinkedList equivalent to the Java 'remove' method:
            return(interruptHandlers.remove(interruptHandler));
        }
Exemple #4
0
        public virtual void addInterruptHandler(int interruptNumber, AbstractInterruptHandler interruptHandler)
        {
            if (interruptNumber < 0 || interruptNumber >= PSP_NUMBER_INTERRUPTS)
            {
                return;
            }

            LinkedList <AbstractInterruptHandler> interruptHandlers = interrupts[interruptNumber];

            if (interruptHandlers == null)
            {
                interruptHandlers           = new LinkedList <AbstractInterruptHandler>();
                interrupts[interruptNumber] = interruptHandlers;
            }

            interruptHandlers.AddLast(interruptHandler);
        }