diff options
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | bus.cpp | 32 |
2 files changed, 35 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ba5328..6f60f90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,7 +89,9 @@ target_compile_definitions(emulator PRIVATE DEBUG_TRACE_INSTRUCTIONS=0 DEBUG_TRACE_GDB_REMOTE=0 DEBUG_TRACE_VDP_ACCESS=1 - DEBUG_TRACE_IO_ACCESS=1 + DEBUG_TRACE_IO_ACCESS=0 + DEBUG_TRACE_PSG_ACCESS=0 + DEBUG_TRACE_Z80RAM_ACCESS=0 HAS_GRAPHICS=1 ) @@ -148,6 +148,13 @@ static inline ReadResult memory_read( true, }; } else if (is_in_range(address, SOUND_RAM_START, SOUND_RAM_SIZE)) { + if (DEBUG_TRACE_Z80RAM_ACCESS) { + printf( + "Z80RAM r%d%s @0x%08x\n", + bitness * 8, + (bitness <= 1 ? " " : ""), + SOUND_RAM_START + address); + } return ReadResult{ memory_read_concrete(bitness, g_sound_ram, address - SOUND_RAM_START), true, @@ -159,6 +166,13 @@ static inline ReadResult memory_read( }; } else if (is_in_range(address, VDP_START, VDP_SIZE)) { if (address == PSG_START) { + if (DEBUG_TRACE_PSG_ACCESS) { + printf( + "PSG r%d%s @0x%08x\n", + bitness * 8, + (bitness <= 1 ? " " : ""), + PSG_START + address); + } // XXX PSG does not seem necessary to implement return ReadResult{ g_psg[0], true }; } @@ -226,6 +240,15 @@ static inline bool memory_write( memory_write_concrete(bitness, g_ram, address - RAM_START, value); return true; } else if (is_in_range(address, SOUND_RAM_START, SOUND_RAM_SIZE)) { + if (DEBUG_TRACE_Z80RAM_ACCESS) { + printf( + "Z80RAM w%d%s @0x%08x 0x%0*x\n", + bitness * 8, + (bitness <= 1 ? " " : ""), + SOUND_RAM_START + address, + bitness * 2, + value); + } memory_write_concrete(bitness, g_sound_ram, address - SOUND_RAM_START, value); return true; } else if (is_in_range(address, IO1_START, IO1_SIZE)) { @@ -233,6 +256,15 @@ static inline bool memory_write( return true; } else if (is_in_range(address, VDP_START, VDP_SIZE)) { if (address == PSG_START) { + if (DEBUG_TRACE_PSG_ACCESS) { + printf( + "PSG w%d%s @0x%08x 0x%0*x\n", + bitness * 8, + (bitness <= 1 ? " " : ""), + PSG_START + address, + bitness * 2, + value); + } // XXX PSG does not seem necessary to implement g_psg[0] = value & 0xff; return true; |