public void poke(UInt16 address, byte value) { switch (address) { case 0: // when switching an unused bit from output (where it contained a // stable value) to input mode (where the input is floating), some // of the charge is transferred to the floating input if (dir != value) { // check if bit 6 has flipped from 1 to 0 if ((dir & 0x40) != 0 && (value & 0x40) == 0) { dataBit6.writeBit(pla.getPhi2Time(), data); } // check if bit 7 has flipped from 1 to 0 if ((dir & 0x80) != 0 && (value & 0x80) == 0) { dataBit7.writeBit(pla.getPhi2Time(), data); } dir = value; updateCpuPort(); } value = pla.getLastReadByte(); break; case 1: // when writing to an unused bit that is output, charge the "capacitor", // otherwise don't touch it if ((dir & 0x40) != 0) { dataBit6.writeBit(pla.getPhi2Time(), value); } if ((dir & 0x80) != 0) { dataBit7.writeBit(pla.getPhi2Time(), value); } if (data != value) { data = value; updateCpuPort(); } value = pla.getLastReadByte(); break; default: break; } ramBank.poke(address, value); }
public override void writeMemByte(UInt16 addr, byte value) { ramBank.poke(addr, value); }