public void ShouldReturnPatchedGameId() { TestContext.WriteLine("MemoryPatchSkipBootCheck, should return a patched game id"); var memoryPatch = MemoryPatch.getInstance(); MemoryPatchSkipBootCheck.run(memoryPatch); var checkLo = memoryPatch.hasPatch(0xFFEC); var checkHi = memoryPatch.hasPatch(0xFFED); Assert.That(checkLo?.value, Is.EqualTo(0x00)); Assert.That(checkHi?.value, Is.EqualTo(0xFF)); }
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; }