mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-01-02 18:29:41 +00:00
Temporarily perhaps, reintroduce post-read and pre-write bus events (for the NES)
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
1bf2a9bdfb
commit
7f501ff29c
@ -10,8 +10,11 @@ namespace EightBit {
|
||||
public:
|
||||
virtual ~Bus() = default;
|
||||
|
||||
Signal<uint16_t> WritingByte;
|
||||
Signal<uint16_t> WrittenByte;
|
||||
|
||||
Signal<uint16_t> ReadingByte;
|
||||
Signal<uint16_t> ReadByte;
|
||||
|
||||
register16_t& ADDRESS();
|
||||
uint8_t& DATA();
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user