1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-19 19:16:34 +00:00

Added the concept of a trap handler to the all-RAM processor and exposed it via the test Z80 classes.

This commit is contained in:
Thomas Harte
2017-05-19 21:20:28 -04:00
parent eae1f78221
commit 62b432c046
5 changed files with 83 additions and 0 deletions
+14
View File
@@ -22,3 +22,17 @@ void AllRAMProcessor::set_data_at_address(uint16_t startAddress, size_t length,
uint32_t AllRAMProcessor::get_timestamp() {
return timestamp_;
}
void AllRAMProcessor::check_address_for_trap(uint16_t address) {
if(trap_addresses_.find(address) != trap_addresses_.end()) {
trap_handler_->processor_did_trap(*this, address);
}
}
void AllRAMProcessor::set_trap_handler(TrapHandler *trap_handler) {
trap_handler_ = trap_handler;
}
void AllRAMProcessor::add_trap_address(uint16_t address) {
trap_addresses_.insert(address);
}