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-27 13:30:19 +00:00
|
|
|
add_clocks(4 >> status.speed_double);
|
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-27 13:30:19 +00:00
|
|
|
add_clocks(4 >> status.speed_double);
|
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-27 13:30:19 +00:00
|
|
|
add_clocks(4 >> status.speed_double);
|
2010-12-28 06:03:02 +00:00
|
|
|
}
|
|
|
|
|
2011-08-13 03:51:29 +00:00
|
|
|
void CPU::cycle_edge() {
|
|
|
|
if(status.ei) {
|
|
|
|
status.ei = false;
|
|
|
|
status.ime = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-12-28 06:03:02 +00:00
|
|
|
#endif
|