diff options
Diffstat (limited to 'bus.cpp')
-rw-r--r-- | bus.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -142,9 +142,13 @@ static inline bool memory_write( #define MASK_24(X) ((X) & (0xFF << 24)) +extern void m68k_read_callback(const uint32_t address, const uint32_t size); +extern void m68k_write_callback(const uint32_t address, const uint32_t size); + unsigned int m68k_read_memory_8(unsigned int address) { assert(MASK_24(address) == 0); // Just curious + m68k_read_callback(address, 4); const struct read_result ret = memory_read(BITNESS_8, address); if (!ret.successful) exit_error("Read error u8 @%08x", address); @@ -153,6 +157,7 @@ unsigned int m68k_read_memory_8(unsigned int address) unsigned int m68k_read_memory_16(unsigned int address) { + m68k_read_callback(address, 2); assert(MASK_24(address) == 0); // Just curious const struct read_result ret = memory_read(BITNESS_16, address); if (!ret.successful) @@ -162,6 +167,7 @@ unsigned int m68k_read_memory_16(unsigned int address) unsigned int m68k_read_memory_32(unsigned int address) { + m68k_read_callback(address, 1); assert(MASK_24(address) == 0); // Just curious const struct read_result ret = memory_read(BITNESS_32, address); if (!ret.successful) @@ -190,6 +196,7 @@ unsigned int m68k_read_disassembler_32(unsigned int address) void m68k_write_memory_8(unsigned int address, unsigned int value) { assert(MASK_24(address) == 0); // Just curious + m68k_write_callback(address, 1); const bool successful = memory_write(BITNESS_8, address, value); if (!successful) exit_error("Attempted to write %02x (u8) to address %08x", value&0xff, address); @@ -198,6 +205,7 @@ void m68k_write_memory_8(unsigned int address, unsigned int value) void m68k_write_memory_16(unsigned int address, unsigned int value) { assert(MASK_24(address) == 0); // Just curious + m68k_write_callback(address, 2); const bool successful = memory_write(BITNESS_16, address, value); if (!successful) exit_error("Attempted to write %04x (u16) to address %08x", value&0xffff, address); @@ -206,6 +214,7 @@ void m68k_write_memory_16(unsigned int address, unsigned int value) void m68k_write_memory_32(unsigned int address, unsigned int value) { assert(MASK_24(address) == 0); // Just curious + m68k_write_callback(address, 4); const bool successful = memory_write(BITNESS_16, address, value); if (!successful) exit_error("Attempted to write %08x (u32) to address %08x", value, address); |