mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-12-23 00:29:47 +00:00
Simplify I/O port event handling.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
156cb66904
commit
fa03e8dc55
@ -4,7 +4,6 @@
|
||||
#include <array>
|
||||
|
||||
#include "Signal.h"
|
||||
#include "PortEventArgs.h"
|
||||
|
||||
namespace EightBit {
|
||||
class InputOutput {
|
||||
@ -18,11 +17,11 @@ namespace EightBit {
|
||||
uint8_t readOutputPort(uint8_t port) { return output[port]; }
|
||||
void writeOutputPort(uint8_t port, uint8_t value);
|
||||
|
||||
Signal<PortEventArgs> ReadingPort;
|
||||
Signal<PortEventArgs> ReadPort;
|
||||
Signal<uint8_t> ReadingPort;
|
||||
Signal<uint8_t> ReadPort;
|
||||
|
||||
Signal<PortEventArgs> WritingPort;
|
||||
Signal<PortEventArgs> WrittenPort;
|
||||
Signal<uint8_t> WritingPort;
|
||||
Signal<uint8_t> WrittenPort;
|
||||
|
||||
protected:
|
||||
void OnReadingPort(uint8_t port);
|
||||
|
@ -1,18 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace EightBit {
|
||||
class PortEventArgs {
|
||||
public:
|
||||
PortEventArgs(uint8_t port)
|
||||
: m_port(port) {}
|
||||
|
||||
uint8_t getPort() const {
|
||||
return m_port;
|
||||
}
|
||||
|
||||
private:
|
||||
uint8_t m_port;
|
||||
};
|
||||
}
|
@ -143,7 +143,6 @@
|
||||
<ClInclude Include="..\inc\InputOutput.h" />
|
||||
<ClInclude Include="..\inc\IntelProcessor.h" />
|
||||
<ClInclude Include="..\inc\Memory.h" />
|
||||
<ClInclude Include="..\inc\PortEventArgs.h" />
|
||||
<ClInclude Include="..\inc\Processor.h" />
|
||||
<ClInclude Include="..\inc\Ram.h" />
|
||||
<ClInclude Include="..\inc\Register.h" />
|
||||
|
@ -35,9 +35,6 @@
|
||||
<ClInclude Include="..\inc\InputOutput.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\inc\PortEventArgs.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\inc\Bus.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
|
@ -15,21 +15,17 @@ void EightBit::InputOutput::writeOutputPort(uint8_t port, uint8_t value) {
|
||||
}
|
||||
|
||||
void EightBit::InputOutput::OnReadingPort(uint8_t port) {
|
||||
PortEventArgs event(port);
|
||||
ReadingPort.fire(event);
|
||||
ReadingPort.fire(port);
|
||||
}
|
||||
|
||||
void EightBit::InputOutput::OnReadPort(uint8_t port) {
|
||||
PortEventArgs event(port);
|
||||
ReadPort.fire(event);
|
||||
ReadPort.fire(port);
|
||||
}
|
||||
|
||||
void EightBit::InputOutput::OnWritingPort(uint8_t port) {
|
||||
PortEventArgs event(port);
|
||||
WritingPort.fire(event);
|
||||
WritingPort.fire(port);
|
||||
}
|
||||
|
||||
void EightBit::InputOutput::OnWrittenPort(uint8_t port) {
|
||||
PortEventArgs event(port);
|
||||
WrittenPort.fire(event);
|
||||
WrittenPort.fire(port);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user