I made some progress! After I got stuck at a dead end with optimization of my previous code, I once more rewrote the rendering stuff.
This change made the emulation
much faster.
Some numbers (emulation frame time):
- Patch Set 3 (previous version)
- Frogger: 37.8ms
- Enduro: 54.8ms
- Patch Set 4 (current version)
- Frogger: 25.9ms
- Enduro: 35.2ms
Note: the frame time is measured
without the final write to the target LCD, because this part is very hardware dependant.
This final task takes more than 23ms on my test target (YH925), but can be shortened by skipping frames and by moving the function to a coprocessor task.
The goal is a emulation frame time of less than 20ms (corresponding to a frame rate of >50Hz) - this seems within reach now, at least for already fast games like Frogger.