diff --git a/Machines/PCCompatible/PCCompatible.cpp b/Machines/PCCompatible/PCCompatible.cpp index 6c2f6ecf7..d7f3f4c4f 100644 --- a/Machines/PCCompatible/PCCompatible.cpp +++ b/Machines/PCCompatible/PCCompatible.cpp @@ -258,7 +258,7 @@ struct Memory { return write_back_value_; } else { - return memory[low_address] | (memory[high_address] << 8); + return uint16_t(memory[low_address] | (memory[high_address] << 8)); } } @@ -268,8 +268,17 @@ struct Memory { }; struct IO { - template void out([[maybe_unused]] uint16_t port, [[maybe_unused]] IntT value) {} - template IntT in([[maybe_unused]] uint16_t port) { return IntT(~0); } + template void out([[maybe_unused]] uint16_t port, [[maybe_unused]] IntT value) { + if constexpr (std::is_same_v) { + printf("Unhandled out: %02x to %04x\n", value, port); + } else { + printf("Unhandled out: %04x to %04x\n", value, port); + } + } + template IntT in([[maybe_unused]] uint16_t port) { + printf("Unhandled in: %04x\n", port); + return IntT(~0); + } }; class FlowController {