Hello everyone,
As many before, I'm writting a NES emulator. That's a very cool adventure so far, and after many effort I have a working version. That's mainly because of all the valuable information I found here.
However, there is something that I absolutely don't understand.
My CPU implementation is executing instructions as fast as possible (but well it's not quite that fast by the way), and the PPU is rendering scanline 1 by 1 as fast as possible. I'm attributing ~114 cycles to the CPU, then render 1 scanline, then back to the CPU etc ...
For some reason, the games I'm able to start, and that run a demo (such a donkey kong, or mario bros) run at an "expected" speed. I was thinking that I had to implement some kind of speed adjustment to stick to the 6502 frequency, or that the games execution will be sloppy and changing: but it seems it's not the case.
Maybe the answer lies only in my code, but well, I was thinking that maybe there is an obvious explanation...
emulation speed
Moderator: Moderators
Re: emulation speed
Game logic pretty much always waits for NMI. If you emulate a bunch of extra scanlines, or extra cycles per scanline, normally those cycles will be spent simply waiting in the idle loop.
Re: emulation speed
It is also possible that your code is waiting for the frame buffer which refreshs at 60 fps.
Re: emulation speed
Direct3d present waits for a frame.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!