deltabeard / Peanut-GB

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

cgb: allow mapping RGB555 palette to other common colour palettes (eg. RGB565) #102

Open deltabeard opened 5 months ago

deltabeard commented 5 months ago

RGB555 isn't very common, so it will be useful if the look up table mapped directly with the output colour format rather than outputting RGB555 and then the user having to convert RGB555 to their required colour format.

This issue depends on CGB support.

Mr-PauI commented 4 months ago

CGB support sounds great; I deal with the palette conversion when the values are changed, since so long as it is in a valid 16-bit format the output translates to the frame buffer/display correctly. The output format changed part way through my implementation when I upgraded the graphics library. 565 is much more common; though bgr instead of rgb is also something I see with the displays for microcontrollers. Again, so long as the table values are in a format appropriate for the target system or API, they should translate into appropriate values for the display/frame buffer.

I appreciate all your work on this project.

Forgive my ignorance of the CGB specific functions if none of this applies; I'm still digesting the gameboy's programming manual's super gameboy section.