deltabeard / Peanut-GB

A Game Boy (DMG) emulator single header library written in C99. Performance is prioritised over accuracy.
https://projects.deltabeard.com/peanutgb/
283 stars 40 forks source link

lcd: use checksum to determine if line needs to be rendered again #58

Open deltabeard opened 2 years ago

deltabeard commented 2 years ago

Before rendering a line on the LCD, use a fast checksum on the tile data for the line to check whether any tiles or sprites have changes for that line. If they have not changed since the last render, then skip rendering that line.

LCD rendering is costly, so not having to render the line again may improve performance. Having to perform a hash on each line may reduce performance however.

deltabeard commented 1 year ago

This checksum could be calculated during the sort performed in #52.