Skip to content
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

Merged
merged 10 commits into from
Jan 6, 2022

Conversation

Daft-Freak
Copy link
Collaborator

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:

  • Paletted lores mode on non-pico (doesn't reconfigure LTDC like hires, just changes the input format to the doubling magic)
  • RGB565 modes on non-pico
  • Returns false instead of just ignoring you on non-supported modes/formats (so everything except 565 on pico)
  • The API function this uses could easily be extended to allow things like passing in a framebuffer pointer

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)

Daft-Freak and others added 10 commits November 14, 2021 22:33
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.
Loosely based on the PR

Co-Authored-By: Alistair Buxton <[email protected]>
Basically just changing the source format to the DMA2D copies
Unbreaks everything that uses the default mode
@Gadgetoid
Copy link
Contributor

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 😆

@Gadgetoid Gadgetoid merged commit 4581fe3 into 32blit:master Jan 6, 2022
@Gadgetoid
Copy link
Contributor

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.

@Daft-Freak Daft-Freak deleted the screen-surface-cleanup branch January 6, 2022 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants