public void Write(int addr, int val) { switch (addr & 0xFC00) { case 0x1800: Via0.Write(addr, val); break; case 0x1C00: Via1.Write(addr, val); break; default: if ((addr & 0x8000) == 0 && (addr & 0x1F00) < 0x800) { _ram[addr & 0x7FF] = val & 0xFF; } break; } }