public void UpdateKeyState_ChangeStateToPressedWithLogicalAndInterrupts_CpuInterrupted()
        {
            AgbMemoryMap  memoryMap  = new AgbMemoryMap();
            AgbCpu        cpu        = new AgbCpu(memoryMap);
            AgbController controller = new AgbController(memoryMap, cpu);

            memoryMap.WriteU32(0x4000208, 1);      // IME = 1
            memoryMap.WriteU16(0x4000200, 0x1000); // IE = Key
            memoryMap.WriteU16(0x4000132, 0xC003); // Key interrupts enabled, logical AND, A and B

            memoryMap.FlushMmio();

            controller.UpdateKeyState(ControllerKey.A, true);
            controller.UpdateKeyState(ControllerKey.B, true);

            Assert.Equal(CpuMode.Irq, cpu.CurrentStatus.Mode);
        }
        public void UpdateKeyState_ChangeStateToPressedAndCheckBitfield_BitSet(ControllerKey key)
        {
            AgbMemoryMap  memoryMap  = new AgbMemoryMap();
            AgbController controller = new AgbController(memoryMap, null);

            controller.UpdateKeyState(key, true);

            ushort mmioValue = memoryMap.ReadU16(0x4000130);

            Assert.True(BitUtil.IsBitSet(mmioValue, (int)key));
        }