Give the store its own EmulationStation menu entry

The games were scattered across the box's own systems — a folder inside
c64, another inside tic80, the launchers inside Ports, and the sync a
fourth entry somewhere else. There was no one place where the store
appeared, and living in the box's folders is what forced the gamelist
merging, the backups and every "never step outside your subfolder" check.

Now the store gets a folder of its own, /userdata/roms/<subfolder>, with a
directory per platform, and an es_systems_<id>.cfg overlay declares one ES
system per platform under a shared <group> — which EmulationStation draws
as a single carousel entry holding a folder per system. The gamelists are
ours, the box's systems are untouched, and the sync is startable from
inside the entry: Store -> "Update <store>".

Nothing about emulators is hardcoded. The launch command, the extensions,
the platform, the theme and the emulator list are copied off the box's own
es_systems.cfg — a file Batocera generated for this image, so it lists
exactly what got built into it. %SYSTEM% is resolved to the source system
name on the way, since ES would otherwise substitute ttg-c64, which
configgen has never heard of.

The old behaviour is emulationstation.menu.mode: "merge", and switching
either way migrates: the layout the files are in is recorded in
state.json, and a mismatch removes the old one and downloads again rather
than shuffling files half-way. purge follows that record too, so an
uninstall after an upgrade whose first sync never ran still finds the
games where they actually are.

Every path now goes through a Layout, so the two modes cannot drift apart.
Also: a gamelist or es_systems file whose content has not changed is not
rewritten at all, and the tags ES owns — favourite, playcount, lastplayed
— are carried over onto the nodes we rewrite, which merge mode used to
lose.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-23 12:57:25 +02:00
co-authored by Claude Opus 5
parent e2551d5fd3
commit 3b72cf81cc
5 changed files with 987 additions and 172 deletions
+4 -4
View File
@@ -2,9 +2,9 @@
# Remove a WarpEngine store from a Batocera box.
#
# The engine does the removing, not this script: it is the only thing that knows
# which ROMs, box art, Ports payloads and gamelist entries were the store's — so
# it runs `purge` first, and only then do the launcher, the Ports entry and the
# store home go.
# which ROMs, box art, Ports payloads, gamelist entries and ES systems were the
# store's — so it runs `purge` first, and only then do the launcher, the Ports
# entry and the store home go.
#
# ./uninstall.sh # the only store installed, or say which one
# STORE_ID=example ./uninstall.sh
@@ -127,5 +127,5 @@ if [ "$DRY_RUN" = "1" ]; then
say "dry run — nothing was removed."
else
say "done. EmulationStation was restarted if it was running; if not, the games are"
say "already gone from the gamelists."
say "already gone from the gamelists, and so is the store's own menu entry."
fi