示例#1
0
 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];
     }
 }
示例#2
0
        public void RemovePortReader(ushort in_address, IORead in_reader)
        {
            int address = in_address & 0xff;

            m_io_read[address] -= in_reader;
        }
示例#3
0
        public void AddPortReader(ushort in_address, IORead in_reader)
        {
            int address = in_address & 0xff;

            m_io_read[address] += in_reader;
        }