After reading over the docs I have determined that instead of doing per-frame rendering (as I'm doing now), I really need to do scanline rendering to most accurately depict the NES hardware's actual system. So it looks like tonight I will be tearing up my PPU logic, as well as throwing together some calculations in notepad to determine proper timings for things like hblank, vsync, as well as the internal clock speeds for everything.
I think what I will do is use MS offsets to determine when to do what next. For example, if I draw 60 times a second, I will, in the tight program loop, check to see if lastRender is >= 16, and if so, render. From what I'm reading, the NES games are VERY dependant on clock speeds for both rendering, as well as the processor. If I'm emulating them out of sync (which I obviously am right now), it will most likely cause all kinds of problems. For example, some games may want to split the screen half-way down. It would do this by modifying the screen scroll value halfway through the rendering of the screen. If I didn't do scanline rendering, this code would simply not work. We'll see how it all pans out in the near future. Stay tune!
2 comments:
Awesome project! I'm very excited to see this progress and learn some low-level programming ideas/implementations in the process.
Yeah, I'm just new to blogging so I'll have to find a happy balance between technical details and the general progress :)
Post a Comment