Example #1
0
        public virtual void continueCallAllegrexInterruptHandler(InterruptState interruptState, IEnumerator <AbstractAllegrexInterruptHandler> allegrexInterruptHandlersIterator, IAction continueAction)
        {
            bool somethingExecuted = false;

            do
            {
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                if (allegrexInterruptHandlersIterator != null && allegrexInterruptHandlersIterator.hasNext())
                {
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
                    AbstractAllegrexInterruptHandler allegrexInterruptHandler = allegrexInterruptHandlersIterator.next();
                    if (allegrexInterruptHandler != null)
                    {
                        //if (log.DebugEnabled)
                        {
                            Console.WriteLine("Calling InterruptHandler " + allegrexInterruptHandler.ToString());
                        }
                        allegrexInterruptHandler.copyArgumentsToCpu(Emulator.Processor.cpu);
                        Modules.ThreadManForUserModule.callAddress(allegrexInterruptHandler.Address, continueAction, true);
                        somethingExecuted = true;
                    }
                }
                else
                {
                    break;
                }
            } while (!somethingExecuted);

            if (!somethingExecuted)
            {
                // No more handlers, end of interrupt
                InsideInterrupt = interruptState.restore(Emulator.Processor.cpu);
                IAction afterInterruptAction = interruptState.AfterInterruptAction;
                if (afterInterruptAction != null)
                {
                    afterInterruptAction.execute();
                }
                onEndOfInterrupt();
            }
        }
Example #2
0
        public virtual void triggerInterrupt(int interruptNumber, IAction afterInterruptAction, IAction afterHandlerAction, AbstractAllegrexInterruptHandler allegrexInterruptHandler)
        {
            //if (log.DebugEnabled)
            {
                Console.WriteLine(string.Format("Triggering Interrupt {0}(0x{1:X}) at 0x{2:X8}", getInterruptName(interruptNumber), interruptNumber, allegrexInterruptHandler.Address));
            }

            // Trigger only this interrupt handler
            allegrexInterruptHandlers.Add(allegrexInterruptHandler);
            executeInterrupts(null, afterInterruptAction, afterHandlerAction);
        }
Example #3
0
 public virtual void pushAllegrexInterruptHandler(AbstractAllegrexInterruptHandler allegrexInterruptHandler)
 {
     allegrexInterruptHandlers.Add(allegrexInterruptHandler);
 }