Exemplo n.º 1
0
 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;
     }
 }
Exemplo n.º 2
0
        public void RemovePortWriter(ushort in_address, IOWrite in_writer)
        {
            int address = in_address & 0xff;

            m_io_write[address] -= in_writer;
        }
Exemplo n.º 3
0
        public void AddPortWriter(ushort in_address, IOWrite in_writer)
        {
            int address = in_address & 0xff;

            m_io_write[address] += in_writer;
        }