public void Read(ushort addr, ref ushort bus) { if (addr >= 0x9000) { // 0x9000 <= addr < 0xffff in PROM bus |= _prom.Span[addr - 0x9000]; } else if (addr >= 0x8000) { // 0x8000 <= addr <= 0x8fff in IO Range IOReadEventArgs args = new IOReadEventArgs(bus); IORead?.Invoke(addr, args); bus |= args.data; } else { // addr < 0x8000 in SRAM bus |= _sram.Span[addr]; } }
public void RemovePortReader(ushort in_address, IORead in_reader) { int address = in_address & 0xff; m_io_read[address] -= in_reader; }
public void AddPortReader(ushort in_address, IORead in_reader) { int address = in_address & 0xff; m_io_read[address] += in_reader; }