V4.9 : 17-Feb-2025 by wavemotion-dave
This is my favorite kind of release - nothing highly visible to the end-user, but a lot of improvements under the hood. The emulation accuracy has gone up here - and the best part is that the game rendering is also 3-4% faster across the board. That's unusual - as accuracy often comes with a slowdown. But I was able to get a 6-7% speed up and with that I gave back some of those gains to improve the overall emulation accuracy.
I've learned quite a bit over the last few years of programming emulators for the DS. One big gain for this round of cleanup was in predictive coding. For example, the branch handling for the 6502 is now optimized to assume the branch is taken (from experiments across a wide variety of 7800 games, the branch is taken more than 95% of the time). So now my cycle table builds in the assumption that the branch is taken - and if the branch is not taken, I simply subtract out those extra cycles which would have been consumed had the branch been taken. Given that we hit this logic about 100K per second - that little change makes an impact.
I had some other optimizations that were not completely 'safe' that I've now removed. Assumptions about how a programmer might access the Pokey registers has been made right. RAM Mirrors are in place though I don't really know if anyone really uses them in any meaningful way - but at least the 7800 Utility Cart now shows a PASS on the internal memory check.
- High Score (HSC) auto-save improvements - no longer write the backing .hsc file if the write didn't actually change HSC data.
- Improved Sally emulation accuracy and optimization pass to render the games 3-4% faster.
- Improved Pokey emulation - missing sounds on games like Ballblazer are now much better.
- Improved memory emulation for more accurate mirror handling - 7800 Utility cart now shows this as a PASS.
- Improved memory caching to help with the really big games (those 512K or larger).
- All but two games on the DSi are now rendered without any form of frameskip (the two holdouts are 1942 and Realsports Baseball). Older DS-Lite/Phat reduces frameskip due to new optimizations.
This is my favorite kind of release - nothing highly visible to the end-user, but a lot of improvements under the hood. The emulation accuracy has gone up here - and the best part is that the game rendering is also 3-4% faster across the board. That's unusual - as accuracy often comes with a slowdown. But I was able to get a 6-7% speed up and with that I gave back some of those gains to improve the overall emulation accuracy.
I've learned quite a bit over the last few years of programming emulators for the DS. One big gain for this round of cleanup was in predictive coding. For example, the branch handling for the 6502 is now optimized to assume the branch is taken (from experiments across a wide variety of 7800 games, the branch is taken more than 95% of the time). So now my cycle table builds in the assumption that the branch is taken - and if the branch is not taken, I simply subtract out those extra cycles which would have been consumed had the branch been taken. Given that we hit this logic about 100K per second - that little change makes an impact.
I had some other optimizations that were not completely 'safe' that I've now removed. Assumptions about how a programmer might access the Pokey registers has been made right. RAM Mirrors are in place though I don't really know if anyone really uses them in any meaningful way - but at least the 7800 Utility Cart now shows a PASS on the internal memory check.
Last edited by wavemotion,











