diff --git a/acia.cpp b/acia.cpp new file mode 100644 index 0000000..a6cfdde --- /dev/null +++ b/acia.cpp @@ -0,0 +1,21 @@ +#include + +#include "memory.h" +#include "acia.h" + +void acia::operator=(uint8_t b) { + if (_acc & 1) { + _device->write(b); + return; + } + if ((b & cd_mask) == 0x03) + _device->reset(); + // FIXME: more +} + +acia::operator uint8_t() { + if (_acc & 1) + return _device->read(); + + return _device->more()? rdrf | tdre: 0; +}