Esempio n. 1
0
        public void DetectFirqCouldNotBeTriggered()
        {
            TestContext.WriteLine("detect that firq could not be triggered");

            cpu.set("flags", 0x00);
            cpu.firq();
            Assert.That(0, Is.EqualTo(0));
        }
Esempio n. 2
0
        public WpcCpuBoard(RomObject romObject)
        {
            ram         = Enumerable.Repeat((byte)0, memoryMapper.MEMORY_ADDR_HARDWARE).ToArray();
            romSizeMBit = romObject.romSizeMBit;
            systemRom   = romObject.systemRom;
            romFileName = romObject.fileName;
            gameRom     = romObject.gameRom;
            memoryPatch = MemoryPatch.getInstance();
            if (romObject.gameIdMemoryLocation != null)
            {
                MemoryPatchGameId.run(memoryPatch, (ushort)romObject.gameIdMemoryLocation);
            }
            if (romObject.skipWpcRomCheck)
            {
                Debug.Print("skipWpcRomCheck TRUE");
                MemoryPatchSkipBootCheck.run(memoryPatch);
            }
            memoryWriteHandler = MemoryHandler.getInstance(romObject.memoryPosition, ram);

            cpu = Cpu6809.getInstance(_write8, _read8);

            InterruptCallbackData interruptCallback = new InterruptCallbackData
            {
                irq         = cpu.irq,
                firqFromDmd = () =>
                {
                    cpu.firq();
                    asic.firqSourceDmd(true);
                },
                reset = cpu.reset
            };

            InitObject initObject = new InitObject
            {
                interruptCallback = interruptCallback,
                romSizeMBit       = romSizeMBit,
                romObject         = romObject,
                ram = ram,
                hasAlphanumericDisplay = romObject.hasAlphanumericDisplay
            };

            hasAlphaNumbericDisplay = romObject.hasAlphanumericDisplay;
            asic         = CpuBoardAsic.getInstance(initObject);
            soundBoard   = SoundBoard.getInstance(initObject);
            displayBoard = DisplayBoard.getInstance(initObject);
            externalIo   = ExternalIo.getInstance();

            ticksIrq = 0;
            protectedMemoryWriteAttempts = 0;
            memoryWrites = 0;
        }