public void Write(ushort addr, ushort bus) { if (addr >= 0x9000) { // 0x9000 <= addr < 0xffff in PROM throw new InvalidOperationException("Cannot write to PROM"); } else if (addr >= 0x8000) { // 0x8000 <= addr <= 0x8fff in IO Range IOWrite?.Invoke(addr, bus); } else { // addr < 0x8000 in SRAM _sram.Span[addr] = bus; } }
public void RemovePortWriter(ushort in_address, IOWrite in_writer) { int address = in_address & 0xff; m_io_write[address] -= in_writer; }
public void AddPortWriter(ushort in_address, IOWrite in_writer) { int address = in_address & 0xff; m_io_write[address] += in_writer; }