2017-05-17 01:19:17 +00:00
|
|
|
//
|
|
|
|
// Z80AllRAM.hpp
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 16/05/2017.
|
|
|
|
// Copyright © 2017 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef Z80AllRAM_hpp
|
|
|
|
#define Z80AllRAM_hpp
|
|
|
|
|
|
|
|
#include "Z80.hpp"
|
2017-05-17 01:28:17 +00:00
|
|
|
#include "../AllRAMProcessor.hpp"
|
2017-05-17 01:19:17 +00:00
|
|
|
|
|
|
|
namespace CPU {
|
|
|
|
namespace Z80 {
|
|
|
|
|
2017-05-17 01:28:17 +00:00
|
|
|
class AllRAMProcessor:
|
2017-05-31 02:41:23 +00:00
|
|
|
public ::CPU::AllRAMProcessor {
|
2017-05-17 01:28:17 +00:00
|
|
|
|
2017-05-17 01:19:17 +00:00
|
|
|
public:
|
2017-05-31 02:41:23 +00:00
|
|
|
static AllRAMProcessor *Processor();
|
2017-05-22 23:24:11 +00:00
|
|
|
|
|
|
|
struct MemoryAccessDelegate {
|
2017-05-22 23:49:38 +00:00
|
|
|
virtual void z80_all_ram_processor_did_perform_bus_operation(AllRAMProcessor &processor, BusOperation operation, uint16_t address, uint8_t value, int time_stamp) = 0;
|
2017-05-22 23:24:11 +00:00
|
|
|
};
|
2017-05-31 02:41:23 +00:00
|
|
|
inline void set_memory_access_delegate(MemoryAccessDelegate *delegate) {
|
2017-05-22 23:24:11 +00:00
|
|
|
delegate_ = delegate;
|
|
|
|
}
|
|
|
|
|
2017-05-31 02:41:23 +00:00
|
|
|
virtual void run_for_cycles(int cycles) = 0;
|
|
|
|
virtual uint16_t get_value_of_register(Register r) = 0;
|
|
|
|
virtual void set_value_of_register(Register r, uint16_t value) = 0;
|
|
|
|
virtual bool get_halt_line() = 0;
|
2017-06-02 02:33:05 +00:00
|
|
|
virtual void reset_power_on() = 0;
|
2017-06-03 21:41:45 +00:00
|
|
|
virtual void set_interrupt_line(bool value) = 0;
|
|
|
|
virtual void set_non_maskable_interrupt_line(bool value) = 0;
|
2017-05-31 02:41:23 +00:00
|
|
|
|
2017-06-13 02:22:00 +00:00
|
|
|
virtual int get_length_of_completed_machine_cycles() = 0;
|
|
|
|
|
2017-05-31 02:41:23 +00:00
|
|
|
protected:
|
2017-05-22 23:24:11 +00:00
|
|
|
MemoryAccessDelegate *delegate_;
|
2017-05-31 02:41:23 +00:00
|
|
|
AllRAMProcessor() : ::CPU::AllRAMProcessor(65536), delegate_(nullptr) {}
|
2017-05-17 01:19:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* Z80AllRAM_hpp */
|