From cc46a45a737896ffcb3c17d107f040b4b0b4b014 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Thu, 1 Sep 2022 00:48:49 +0200 Subject: [PATCH] Emulator: Print blargg's test ROM output --- src/emu.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/emu.cpp b/src/emu.cpp index 57f930e..6126002 100644 --- a/src/emu.cpp +++ b/src/emu.cpp @@ -66,10 +66,6 @@ void Emu::writeMemory(uint32_t address, uint32_t value) { for (auto& memory_space : m_memory_spaces) { auto& memory = memory_space.second; - if (address == 0xff50) { - Loader::the().disableBootrom(); - } - if (address >= memory.start_address && address <= memory.end_address) { // Note: ECHO RAM hack if (address >= 0xc000 && address <= 0xddff) { @@ -77,6 +73,18 @@ void Emu::writeMemory(uint32_t address, uint32_t value) } memory.memory[memory.active_bank][address - memory.start_address] = value; + + if (address == 0xff50) { + print("DISABLING BOOTROM\n"); + Loader::the().disableBootrom(); + } + + // Write serial data from linkport I/O, used for blargg's test ROMs + if (address == 0xff02 && value == 0x81) { + uint32_t data = readMemory(0xff01); + print("{:c}", (data >= 58 && data <= 64) ? data + 7 : data); + } + return; } }