private void UpdateRegister(Interrupts interrupt, bool value) { var register = _mmu.ReadByte(MemorySchema.INTERRUPT_REQUEST_REGISTER); Helpers.SetBit(ref register, (int)interrupt, value); _mmu.WriteByte(register, MemorySchema.INTERRUPT_REQUEST_REGISTER); }
public void Reset(bool usingBootROM, GBCMode gbcMode) { _gbcMode = gbcMode; if (usingBootROM) { _registers.A = (byte)(_gbcMode != GBCMode.NoGBC ? 0x11 : 0x01); } else { _mmu.WriteByte(0, MemorySchema.BOOT_ROM_DISABLE_REGISTER); _registers.AF = (ushort)(_gbcMode != GBCMode.NoGBC ? 0x11B0 : 0x01B0); _registers.BC = 0x0013; _registers.DE = 0x00D8; _registers.HL = 0x014D; _sp.SP = 0xFFFE; _pc = 0x100; } _mmu.Reset(usingBootROM); }