So I'm about ready to write and implement a PPU into my emulator project. Currently my CPU passes nestest tests up until unsupported opcodes tend to appear around halfway through. It is also cycle correct, taking into account page boundaries. The code does all its thing and then tells the CPU to "sleep" for the number of cycles that instruction and addresmode consumes.
Before I start though, I'm wondering how I would time the PPU's 3 ticks per CPU tick. Would it be as simple as just
or is it more involved than this?
Thanks!
Before I start though, I'm wondering how I would time the PPU's 3 ticks per CPU tick. Would it be as simple as just
Code:
void loop(){
while(running){
tickCPU();
tickPPU();
tickPPU();
tickPPU();
}
}
while(running){
tickCPU();
tickPPU();
tickPPU();
tickPPU();
}
}
or is it more involved than this?
Thanks!