Hello guys, so like every other person on the planet I've also developed my own NES emu. It's browser based & cycle accurate so it needs a good CPU to maintain full speed. To run in weaker CPUs, I've tried to implement frame skipping in the following way:
The problem is in some games like Megaman II I see the screen jumping in some scenes and when megaman takes those ladders to go up/down a screen, the screen jumps as if nametables are not being switched. This doesn't happen in normal scrolling scenarios, i.e the entire world of super mario is okay.
I'm thinking it might due to sprite0 hit not being set, so I tried to set sprite hit in the skipped frame in the same scanline/cycle the last frame had. But it's still not working
So my question is, are their any good frame skipping strategies where I don't need to do much work in the ppu but still be accurate enough? Thanks.
Code:
1. After a certain no. of frames, check if we have fallen behind
2. If true, skip a frame
3. When we are skipping, all the ppu does is update vblank flags, clear sprite0 and overflow flags, implement the pre-render line clock skipping on odd frames and generate NMIs. It doesn't do X/Y scrolling, or sprite evaluation, or rendering.
2. If true, skip a frame
3. When we are skipping, all the ppu does is update vblank flags, clear sprite0 and overflow flags, implement the pre-render line clock skipping on odd frames and generate NMIs. It doesn't do X/Y scrolling, or sprite evaluation, or rendering.
The problem is in some games like Megaman II I see the screen jumping in some scenes and when megaman takes those ladders to go up/down a screen, the screen jumps as if nametables are not being switched. This doesn't happen in normal scrolling scenarios, i.e the entire world of super mario is okay.
I'm thinking it might due to sprite0 hit not being set, so I tried to set sprite hit in the skipped frame in the same scanline/cycle the last frame had. But it's still not working
So my question is, are their any good frame skipping strategies where I don't need to do much work in the ppu but still be accurate enough? Thanks.