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

Pico loader #877

Draft
wants to merge 68 commits into
base: master
Choose a base branch
from
Draft

Pico loader #877

wants to merge 68 commits into from

Conversation

Daft-Freak
Copy link
Collaborator

I finally untangled this!

Building with BLIT_EXECUTABLE_PICO_BLIT=1 creates .blit files instead of .uf2s, these are mostly portable between devices. (The framebuffer size is still set a compile time, so if you have the board set to PicoSystem (the default) the resulting .blit won't run on a device with a > 240x240 display. PicoVision is unaffected by this as its framebuffer is in the PSRAMs)

Installing multiple blits requires manually building them for different offsets (-DBLIT_EXECUTABLE_PICO_BLIT_OFFSET_KB=x), the launcher is built at a lower offset be default. On RP2350-based devices address translation is used to support running blits from any offset. Not much hardware to try that on though...

Some of the CDC API used by the tools is supported and can be used to flash blits onto a PicoSystem. This requires manually specifying the port as the tools don't recognise the VID/PID. (Which should probably be changed to something other than 0xCAFE first).

There's currently no menu but the "hold HOME to exit" feature is there. (If the device has a HOME button... Sorry PicoSystem users.)

Still a lot of missing bits and duplicated logic with the -stm32 port, I have some plans to clean that up a bit. Need to see what it looks like complete first though...

(May edit if I remember more details... Been working on this for > 1.5 years...)

Right now it's just a BLIT header instead of boot2, built at a 512k
offset to allow launching one thing without position independent code
Seems a bit weird, but needed to get the right framebuffer size
It's... not unusable
Launches the first thing it finds. has some fixed locations for API consts/data.
No update/tick, page-flipping doesn't work, firmware uses 130k RAM
Only builds one at a time, which causes less problems. Controlled by PICO_STANDALONE_UF2/PICO_BLIT in blit_executable or BLIT_EXECUTABLE_PICO_STANDALONE_UF2/BLIT_EXECUTABLE_PICO_BLIT globally
firmware now reserves 32k of RAM (may need less)
larger project for the future: share this code
So that it actually does the thing it's supposed to do
Instead of returning the loader's data
Thought I had a corrupt SD card, but it was just every game writing their saves to the same place
Technically it would work from the flash-based storage as well, but that seems a bit silly
This should be replaced with the auto-update logig from the STM32 firmware at some point
Another api wrapper
Now a class with some helpers instead of a global uint8_t array
Gets rid of a bunch of linker warnings
In the transpose case this'll fault hard... Instead of just messing up some DMA
We've got two incompatible devices here now
Will be useful when we're using address translation
This requires compiling them for a 4MB offset
I think this is it, doesn't seem to be any helpers in the SDK...
This has been broken since set_framebuffer...
This is the only way for switching between two double-buffered modes to work
It's all low-level stuff the loader should've done
Hopefully fixes random button presses at startup?
It does things we need to not crash and doesn't do any of the things that caused problems on 2350
@Gadgetoid
Copy link
Contributor

Not much hardware to try that on though...

Might fix that in short order! No controls tho...

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