diff --git a/inc/Bus.h b/inc/Bus.h index 3d016d6..9424119 100644 --- a/inc/Bus.h +++ b/inc/Bus.h @@ -10,8 +10,11 @@ namespace EightBit { public: virtual ~Bus() = default; + Signal WritingByte; Signal WrittenByte; + Signal ReadingByte; + Signal ReadByte; register16_t& ADDRESS(); uint8_t& DATA(); diff --git a/src/Bus.cpp b/src/Bus.cpp index 44bb0f0..3bc3b62 100644 --- a/src/Bus.cpp +++ b/src/Bus.cpp @@ -41,7 +41,9 @@ uint16_t EightBit::Bus::peekWord(uint16_t address) { uint8_t EightBit::Bus::read() { ReadingByte.fire(ADDRESS().word); - return reference(); + const auto returned = reference(); + ReadByte.fire(ADDRESS().word); + return returned; } uint8_t EightBit::Bus::read(uint16_t offset) { @@ -55,6 +57,7 @@ uint8_t EightBit::Bus::read(register16_t address) { } void EightBit::Bus::write(uint8_t value) { + WritingByte.fire(ADDRESS().word); reference() = value; WrittenByte.fire(ADDRESS().word); }