acia now a real device

This commit is contained in:
Stephen Crane 2018-09-13 11:24:05 +01:00
parent 5d8524f5c0
commit b8e9532628
1 changed files with 21 additions and 0 deletions

21
acia.cpp Normal file
View File

@ -0,0 +1,21 @@
#include <stdint.h>
#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;
}