public byte peek(UInt16 address) { switch (address) { case 0: return(dir); case 1: { byte retval = dataRead; // for unused bits in input mode, the value comes from the "capacitor" // set real value of bit 6 if ((dir & 0x40) == 0) { retval &= (byte)(0xbf); // ~0x40; retval |= dataBit6.readBit(pla.getPhi2Time()); } // set real value of bit 7 if ((dir & 0x80) == 0) { retval &= (byte)(0x7f); // ~0x80; retval |= dataBit7.readBit(pla.getPhi2Time()); } return(retval); } default: return(ramBank.peek(address)); } }
// RAM access methods public override byte readMemByte(UInt16 addr) { return(ramBank.peek(addr)); }