diff options
Diffstat (limited to 'bus.cpp')
-rw-r--r-- | bus.cpp | 57 |
1 files changed, 28 insertions, 29 deletions
@@ -7,7 +7,6 @@ #include "vdp.hpp" #include "io.hpp" -#include <algorithm> #include <cassert> #include <cstdarg> #include <cstdbool> @@ -115,21 +114,21 @@ static inline bool ranges_overlap( static inline void m68k_read_callback(const uint32_t address, const uint32_t size) { - const auto access_it = std::find_if( - access_bkpts.begin(), - access_bkpts.end(), - [&](const Breakpoint& b) { return ranges_overlap(address, size, b.offset, b.length); }); - if (access_it != access_bkpts.end()) { - printf("Access watchpoint @ 0x%08x\n", address); - m68k_breakpoint_callback(); + for (size_t bi = 0; bi < access_bkpts.size(); bi++) { + const auto& b = access_bkpts[bi]; + if (ranges_overlap(address, size, b.offset, b.length)) { + printf("Access watchpoint @ 0x%08x\n", address); + m68k_breakpoint_callback(); + break; + } } - const auto it = std::find_if( - read_bkpts.begin(), - read_bkpts.end(), - [&](const Breakpoint& b) { return ranges_overlap(address, size, b.offset, b.length); }); - if (it != read_bkpts.end()) { - printf("Read watchpoint @ 0x%08x\n", address); - m68k_breakpoint_callback(); + for (size_t bi = 0; bi < read_bkpts.size(); bi++) { + const auto& b = read_bkpts[bi]; + if (ranges_overlap(address, size, b.offset, b.length)) { + printf("Read watchpoint @ 0x%08x\n", address); + m68k_breakpoint_callback(); + break; + } } } @@ -196,21 +195,21 @@ static inline void memory_write_concrete( static inline void m68k_write_callback(const uint32_t address, const uint32_t size) { - const auto access_it = std::find_if( - access_bkpts.begin(), - access_bkpts.end(), - [&](const Breakpoint& b) { return ranges_overlap(address, size, b.offset, b.length); }); - if (access_it != access_bkpts.end()) { - printf("Access watchpoint @ 0x%08x\n", address); - m68k_breakpoint_callback(); + for (size_t bi = 0; bi < access_bkpts.size(); bi++) { + const auto& b = access_bkpts[bi]; + if (ranges_overlap(address, size, b.offset, b.length)) { + printf("Access watchpoint @ 0x%08x\n", address); + m68k_breakpoint_callback(); + break; + } } - const auto it = std::find_if( - write_bkpts.begin(), - write_bkpts.end(), - [&](const Breakpoint& b) { return ranges_overlap(address, size, b.offset, b.length); }); - if (it != write_bkpts.end()) { - printf("Write watchpoint @ 0x%08x\n", address); - m68k_breakpoint_callback(); + for (size_t bi = 0; bi < read_bkpts.size(); bi++) { + const auto& b = read_bkpts[bi]; + if (ranges_overlap(address, size, b.offset, b.length)) { + printf("Write watchpoint @ 0x%08x\n", address); + m68k_breakpoint_callback(); + break; + } } } |