From ed3cf413dfe5f874f203f8b6a696af29cfc47dcd Mon Sep 17 00:00:00 2001 From: Oxore Date: Tue, 30 Aug 2022 16:49:38 +0300 Subject: Impl emulator stepping with GDB --- bus.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'bus.cpp') diff --git a/bus.cpp b/bus.cpp index caff07c..aef20a4 100644 --- a/bus.cpp +++ b/bus.cpp @@ -3,6 +3,7 @@ #include "bus.hpp" #include "musashi-m68k/m68k.h" +#include "utils.hpp" #include #include @@ -62,34 +63,35 @@ static inline unsigned int memory_read_concrete( (base[address + 2] << 8) | base[address + 3]; } - __builtin_unreachable(); + UNREACHABLE(); } static inline struct read_result memory_read( enum bitness bitness, unsigned int address) { - if (is_in_range(address, ROM_START, ROM_SIZE)) - return (struct read_result){ + if (is_in_range(address, ROM_START, ROM_SIZE)) { + return read_result{ memory_read_concrete(bitness, g_rom, address - ROM_START), true, }; - else if (is_in_range(address, RAM_START, RAM_SIZE)) - return (struct read_result){ + } else if (is_in_range(address, RAM_START, RAM_SIZE)) { + return read_result{ memory_read_concrete(bitness, g_ram, address - RAM_START), true, }; - else if (is_in_range(address, IO1_START, IO1_SIZE)) - return (struct read_result){ + } else if (is_in_range(address, IO1_START, IO1_SIZE)) { + return read_result{ memory_read_concrete(bitness, g_io1, address - IO1_START), true, }; - else if (is_in_range(address, IO2_START, IO2_SIZE)) - return (struct read_result){ + } else if (is_in_range(address, IO2_START, IO2_SIZE)) { + return read_result{ memory_read_concrete(bitness, g_io2, address - IO2_START), true, }; - return (struct read_result){0, false}; + } + return read_result{0, false}; } static inline void memory_write_concrete( -- cgit v1.2.3