27 : interface(interface_)
28 , ppiModeCallback(invalidPpiModeSetting)
46 return readPortA(time);
48 return readPortB(time);
50 return readPortC(time);
52 return readControlPort(time);
62 return peekPortA(time);
64 return peekPortB(time);
66 return peekPortC(time);
68 return readControlPort(time);
78 writePortA(value, time);
81 writePortB(value, time);
84 writePortC(value, time);
87 writeControlPort(value, time);
94byte I8255::readPortA(EmuTime::param time)
96 switch (control &
MODE_A) {
100 return interface.
readA(time);
112byte I8255::peekPortA(EmuTime::param time)
const
114 switch (control &
MODE_A) {
117 return interface.
peekA(time);
128byte I8255::readPortB(EmuTime::param time)
130 switch (control &
MODE_B) {
134 return interface.
readB(time);
145byte I8255::peekPortB(EmuTime::param time)
const
147 switch (control &
MODE_B) {
150 return interface.
peekB(time);
160byte I8255::readPortC(EmuTime::param time)
162 byte tmp = readC1(time) | readC0(time);
163 switch (control &
MODE_A) {
172 switch (control &
MODE_B) {
183byte I8255::peekPortC(EmuTime::param time)
const
185 return peekC1(time) | peekC0(time);
188byte I8255::readC1(EmuTime::param time)
195 return latchPortC & 0xf0;
199byte I8255::peekC1(EmuTime::param time)
const
204 return latchPortC & 0xf0;
208byte I8255::readC0(EmuTime::param time)
212 return interface.
readC0(time);
215 return latchPortC & 0x0f;
219byte I8255::peekC0(EmuTime::param time)
const
222 return interface.
peekC0(time);
224 return latchPortC & 0x0f;
228byte I8255::readControlPort(EmuTime::param )
const
233void I8255::writePortA(
byte value, EmuTime::param time)
235 switch (control &
MODE_A) {
244 outputPortA(value, time);
247void I8255::writePortB(
byte value, EmuTime::param time)
249 switch (control &
MODE_B) {
257 outputPortB(value, time);
260void I8255::writePortC(
byte value, EmuTime::param time)
262 switch (control &
MODE_A) {
271 switch (control &
MODE_B) {
279 outputPortC(value, time);
282void I8255::outputPortA(
byte value, EmuTime::param time)
287 interface.
writeA(value, time);
291void I8255::outputPortB(
byte value, EmuTime::param time)
296 interface.
writeB(value, time);
300void I8255::outputPortC(
byte value, EmuTime::param time)
305 interface.
writeC1(latchPortC >> 4, time);
309 interface.
writeC0(latchPortC & 15, time);
313void I8255::writeControlPort(
byte value, EmuTime::param time)
325 outputPortA(latchPortA, time);
326 outputPortB(latchPortB, time);
327 outputPortC(latchPortC, time);
330 auto bitmask =
byte(1 << ((value &
BIT_NR) >> 1));
333 latchPortC |= bitmask;
336 latchPortC &= ~bitmask;
338 outputPortC(latchPortC, time);
341 switch (control &
MODE_A) {
350 switch (control &
MODE_B) {
365 byte result = latchPortA;
375 byte result = latchPortB;
385 byte result = latchPortC;
397template<
typename Archive>
400 ar.serialize(
"latchPortA", latchPortA,
401 "latchPortB", latchPortB,
402 "latchPortC", latchPortC,
virtual byte peekB(EmuTime::param time) const =0
virtual void writeB(byte value, EmuTime::param time)=0
virtual nibble readC0(EmuTime::param time)=0
virtual byte readA(EmuTime::param time)=0
virtual void writeC1(nibble value, EmuTime::param time)=0
virtual byte readB(EmuTime::param time)=0
virtual void writeA(byte value, EmuTime::param time)=0
virtual nibble readC1(EmuTime::param time)=0
virtual void writeC0(nibble value, EmuTime::param time)=0
virtual byte peekA(EmuTime::param time) const =0
virtual nibble peekC1(EmuTime::param time) const =0
virtual nibble peekC0(EmuTime::param time) const =0
void reset(EmuTime::param time)
byte peek(byte port, EmuTime::param time) const
I8255(I8255Interface &interface, EmuTime::param time, StringSetting &invalidPpiModeSetting)
byte read(byte port, EmuTime::param time)
void serialize(Archive &ar, unsigned version)
void write(byte port, byte value, EmuTime::param time)
TclObject execute() const
This file implemented 3 utility functions:
uint8_t byte
8 bit unsigned integer
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)