Closed eregon closed 7 years ago
Holy wow this is amazing, i can actually play a reasonable game of Tetris. This also really speeds up Mario and Pokemon as well.
I'm going to be looking at this over the next few days and probably adding a things to this as well.
Thanks again!!! 🎉
sorry for the delay, i'll probably spend this weekend going through this PR. 😄
Sorry for the delay again, i'm pretty happy with this merge. Thanks again!
You're welcome, thanks for merging!
This PR improves the speed of the emulator on Tetris from 8 FPS to 30 FPS (still some way to go for 60).
I used stackprof to identity the hotspots. The sample profiler is now enabled by passing
--stackprof
toexe/waterfoul start
.The emulator now also displays the FPS in the window title.
The initial stackprof report was:
So
MMU#[]
was clearly the bottleneck.After these commits it looks like:
It is less clear, but
PPU#render_bg
seems fairly slow compared to the rest. Maybe some higher-level optimization could be done such as pre-computing a recurring pattern once, or if the background is a uniform color that might be easy to detect.