Commit c04828c
feat(psp): runtime theme switcher + autorun script runner (#154)
* feat(psp): runtime theme switcher + autorun script runner
Adds a Settings kiosk app to the PSP backend so themes can be swapped on
the fly (mirrors the SDL3 Settings app, minus the resolution preset list
since PSP is fixed at 480x272). Themes now repaint icons and the static
gradient wallpaper too — not just the bars and bottom shaders — so each
of the seven PSP presets is visibly distinct.
To make the change testable end-to-end without flaky xdotool input
simulation, this also adds a boot-time AUTORUN.txt script runner
(feature `autorun-script`, off by default) that dispatches one command
per frame from the main loop. Verbs: launch / press / cursor / skin /
wait / screenshot / log / exit. Reuses cmd_server's INJECT_QUEUE and
apply_skin_preset so TCP and AUTORUN drive the same code paths. The
`screenshot` verb writes a sentinel file and blocks until the host
harness deletes it; the host captures the PPSSPP window via scrot
(needed because PPSSPP's GU emulation never syncs rendered pixels
back to the PSP RAM mirror, so VRAM reads return only stale boot
content).
Settings UI:
- Settings KioskApp variant + SettingsState (cursor + scroll)
- views_sdi/settings.rs reuses list_view helpers; [*] marker on the
active preset; "X = Apply, O = Back" hint
- input handler: Up/Down navigate, X applies, O closes
- shared skins::apply_skin_preset() consolidates the rebuild + persist
path (terminal `skin NAME`, cmd_server, Settings UI)
- views_sdi::hide_all gains a `settings_` prefix so SDI rows don't
bleed through after exit
Theme variation:
- chrome::draw_dashboard takes &ActiveTheme; icon body / outline /
fold / shadow / label / label_shadow now come from at.icon.*
- per-preset apply_icon_palette() in skins.rs (RetroCGA black+cyan,
HighContrast black+yellow, Solarized teal, Altimit navy+mint, etc.)
- procedural::generate_gradient_with(w, h, &stops) takes a 5-stop
palette; PspSkinPreset::gradient_stops() returns each preset's
colors; main loop regenerates wallpaper texture on skin change so
PSIX, Classic, and HighContrast each get a unique background
Autorun runner:
- crates/oasis-backend-psp/src/autorun.rs (parser + dispatcher)
- cmd_server::request_skin_change made pub for cross-crate access
- desktop::dashboard_icon_center reverses hit_test for `launch <app>`
- main.rs: load AutorunRunner at boot, tick once per frame before
poll_events_inner so injected events land same frame
- docs/psp-autorun.md documents grammar + sentinel mechanics
Test scripts:
- scripts/test-settings-ppsspp.sh: build + drop AUTORUN.txt + watch
for sentinels + scrot the PPSSPP window. Verifies the full Settings
flow end-to-end.
- scripts/test-all-themes-ppsspp.sh: cycles every preset via the
`skin` verb, captures dashboard for each.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix: address AI review feedback (iteration 1)
Automated fix by Claude in response to AI review feedback.
Iteration: 1/5
Co-Authored-By: AI Review Agent <noreply@anthropic.com>
* fix: address AI review feedback (iteration 2)
Automated fix by Claude in response to AI review feedback.
Iteration: 2/5
Co-Authored-By: AI Review Agent <noreply@anthropic.com>
* fix: address AI review feedback (iteration 3)
Automated fix by Claude in response to AI review feedback.
Iteration: 3/5
Co-Authored-By: AI Review Agent <noreply@anthropic.com>
* fix: address AI review feedback (iteration 4)
Automated fix by Claude in response to AI review feedback.
Iteration: 4/5
Co-Authored-By: AI Review Agent <noreply@anthropic.com>
* fix: address AI review feedback (iteration 5)
Automated fix by Claude in response to AI review feedback.
Iteration: 5/5
Co-Authored-By: AI Review Agent <noreply@anthropic.com>
---------
Co-authored-by: AI Agent Bot <ai-agent@localhost>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: AI Review Agent <ai-review-agent@localhost>1 parent 40a6e1b commit c04828c
23 files changed
Lines changed: 1385 additions & 57 deletions
File tree
- crates/oasis-backend-psp
- src
- input_dispatch
- views_sdi
- docs
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
48 | 54 | | |
49 | 55 | | |
50 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
263 | 285 | | |
264 | 286 | | |
265 | 287 | | |
| |||
0 commit comments