NagyD / SDLPoP

An open-source port of Prince of Persia, based on the disassembly of the DOS version.
GNU General Public License v3.0
1.1k stars 141 forks source link

Optimizations to OPL3_Generate(). #238

Closed icculus closed 3 years ago

icculus commented 3 years ago

This is just unrolls the inner loop on genering the mixbuff values, and only calculates loop invariants once.

It doesn't seem like much, but this was the biggest hotspot on a CPU profile for the entire game!

More importantly: when run on a Raspberry Pi Zero, the music went from unusable to perfect, as it can now keep up with the audio callback, which is nice for using SDLPoP on some sort of mini RetroPie thing.

nukeykt commented 3 years ago

don't mind if I'll merge this to main nuked opl3 repository?

icculus commented 3 years ago

don't mind if I'll merge this to main nuked opl3 repository?

Fine with me, use it however you like.