bsnes/bsnes/gameboy/cpu/timing/opcode.cpp

29 lines
458 B
C++
Raw Normal View History

#ifdef CPU_CPP
void CPU::op_io() {
cycle_edge();
add_clocks(4 >> status.speed_double);
}
uint8 CPU::op_read(uint16 addr) {
cycle_edge();
uint8 r = bus.read(addr);
add_clocks(4 >> status.speed_double);
return r;
}
void CPU::op_write(uint16 addr, uint8 data) {
cycle_edge();
bus.write(addr, data);
add_clocks(4 >> status.speed_double);
}
void CPU::cycle_edge() {
if(status.ei) {
status.ei = false;
status.ime = 1;
}
}
#endif