Context:
The gamebook played a single hard-coded book. We want the master to
boot into a library of several stories, shown as tiles, and let the
player pick one with the pad.
Approach:
Turn the gamebook component into a two-mode machine (LIBRARY / STORY).
On boot it loads /sdcard/gamebook/library.json and shows the stories as
a tile grid; selecting one loads that book's <id>.json and plays it;
finishing a story returns to the library.
Changes:
- display_ui: new library view — a 2x3 grid of title tiles with the
selected one highlighted (display_ui_library_show/hide); it wins the
view selector while open.
- gamebook.c: LIBRARY/STORY modes; load library.json + per-book
<id>.json from the SD; grid navigation (up/down +/-2, left/right
+/-1, click opens); story ending click returns to the library.
- main.c: gamebook_init only installs the pad hook; gamebook_start()
(which opens the library) is now called after the SD + media_manager
are up, so the boot picker actually finds the SD pack.
Impact:
The Freenove boots straight into a story picker and runs any book from
the SD library, fully offline. Hardware-validated: boots into a
6-story library.