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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user