-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Screen mode cleanup and extended API #730
Conversation
Not crashing is good
Adds a struct containing only the data/size/format, which is all that was used from those Surfaces. Reduces the size per mode from 84 to 20 bytes and gets them out of RAM
They're based on sys_width/height, which doesn't change on resize
Merge the two simple cases, handle lores palette (not a thing yet)
Uses a new API that takes a template struct and fills it. Also adds lores palette support.
Camel... snakes?
Loosely based on the PR Co-Authored-By: Alistair Buxton <a.j.buxton@gmail.com>
Basically just changing the source format to the DMA2D copies
Unbreaks everything that uses the default mode
Thanks for putting this together- I have been buried in HUB75 LED matrix stuff for a while but I should get some time for 32blit soon. Looks like things are starting to bubble away here post retail launch. ARGB4444 parity between 32blit and PicoSystem would be interesting. Another step toward absorbing games built with the PicoSystem SDK 😆 |
Thank you- merging this because it's sat around for far too long and it'd be handy to have available for people to start tinkering with even if I don't immediately tag a release. Of course it may cause havoc if there's no firmware build to support the new and shiny 😬 but I don't want to bottleneck things too much. |
I thought about it too much and had to write it... cleanup based on an old patch, 565 bits loosely based on the other PR.
The main thing this adds is:
bool set_screen_mode(ScreenMode new_mode, PixelFormat format)
, which enables:lores
mode on non-pico (doesn't reconfigure LTDC likehires
, just changes the input format to the doubling magic)This does increase the API minor version, so games built with this won't run on older firmware (but old games will be fine).
Updated screen mode test. Cycles through all six mode/format combinations. A/B for manual mode change.
(Adding extra formats to the STM32 HAL is reasonably easy if for some reason someone wanted ARGB4444... or 1555... or even 4bit paletted)