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

gb: Use only 4-LSB in LCD data #55

Open deltabeard opened 2 years ago

deltabeard commented 2 years ago

The LCD pixel data that Peanut-GB produces uses bits 0 and 1 for shade data, and bits 4 and 5 for layer data. If only bits 0-3 are used, then colour mapping using a look up table can be faster. A basic test on the RP2040 showed an improvement of approximately 8 FPS with this change.

This will require an API change.