mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-01-11 02:29:50 +00:00
cac871cf2b
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
32 lines
703 B
C++
32 lines
703 B
C++
#include "stdafx.h"
|
|
#include "InputOutput.h"
|
|
|
|
uint8_t EightBit::InputOutput::readInputPort(const uint8_t port) {
|
|
OnReadingPort(port);
|
|
const auto value = m_input[port];
|
|
OnReadPort(port);
|
|
return value;
|
|
}
|
|
|
|
void EightBit::InputOutput::writeOutputPort(const uint8_t port, const uint8_t value) {
|
|
OnWritingPort(port);
|
|
m_output[port] = value;
|
|
OnWrittenPort(port);
|
|
}
|
|
|
|
void EightBit::InputOutput::OnReadingPort(uint8_t port) {
|
|
ReadingPort.fire(port);
|
|
}
|
|
|
|
void EightBit::InputOutput::OnReadPort(uint8_t port) {
|
|
ReadPort.fire(port);
|
|
}
|
|
|
|
void EightBit::InputOutput::OnWritingPort(uint8_t port) {
|
|
WritingPort.fire(port);
|
|
}
|
|
|
|
void EightBit::InputOutput::OnWrittenPort(uint8_t port) {
|
|
WrittenPort.fire(port);
|
|
}
|