2010-12-28 06:03:02 +00:00
|
|
|
#ifdef CPU_CPP
|
|
|
|
|
|
|
|
void CPU::op_io() {
|
2011-08-13 03:51:29 +00:00
|
|
|
cycle_edge();
|
2011-10-28 09:51:43 +00:00
|
|
|
add_clocks(4);
|
2010-12-28 06:03:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
uint8 CPU::op_read(uint16 addr) {
|
2011-08-13 03:51:29 +00:00
|
|
|
cycle_edge();
|
2010-12-28 06:03:02 +00:00
|
|
|
uint8 r = bus.read(addr);
|
2011-10-28 09:51:43 +00:00
|
|
|
add_clocks(4);
|
2010-12-28 06:03:02 +00:00
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CPU::op_write(uint16 addr, uint8 data) {
|
2011-08-13 03:51:29 +00:00
|
|
|
cycle_edge();
|
2010-12-28 06:03:02 +00:00
|
|
|
bus.write(addr, data);
|
2011-10-28 09:51:43 +00:00
|
|
|
add_clocks(4);
|
2010-12-28 06:03:02 +00:00
|
|
|
}
|
|
|
|
|
2011-08-13 03:51:29 +00:00
|
|
|
void CPU::cycle_edge() {
|
2012-04-26 10:51:13 +00:00
|
|
|
if(r.ei) {
|
|
|
|
r.ei = false;
|
|
|
|
r.ime = 1;
|
2011-08-13 03:51:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-04-26 10:51:13 +00:00
|
|
|
uint8 CPU::debugger_read(uint16 addr) {
|
|
|
|
return bus.read(addr);
|
|
|
|
}
|
|
|
|
|
2010-12-28 06:03:02 +00:00
|
|
|
#endif
|