36 Commits

Author SHA1 Message Date
a5b04fcd08 Document RG35XX Plus boot chain, reorganize device docs
Move device-specific content (hardware, software, libraries) from
TOOLCHAIN.md into new docs/rg35xx-plus.md. Add partition layout,
full boot chain trace (systemd → launcher.sh → loadapp.sh → dmenu_ln),
and sdlamp2 deployment instructions via dmenu_ln config toggle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 15:18:59 +01:00
4f6d1de8e2 Always clean-build in Docker to avoid stale binary
The Docker build target now runs `make clean all` instead of bare
`make`, so it rebuilds regardless of an existing build/sdlamp2.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:44:14 +01:00
a0f95c7252 Combine Play/Stop into toggle, add Previous Cassette button
Merge the separate Stop and Play buttons into one slot that toggles
between play/stop and shows the corresponding icon. Use the freed
slot for a Previous Cassette button, mirroring Next Cassette.

Layout: [Volume] [Prev] [Rewind] [Play/Stop] [FF] [Next]

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:38:17 +01:00
2daf9f7955 Start paused, respect pause state on next-tape, quiet joystick log
Player was autoplaying on startup and on file switch. Now switch_file()
preserves the current paused state so the app launches paused and
"next tape" only continues playing if already playing. Joystick name
printf moved behind --debug flag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:30:33 +01:00
b6728a7482 Add convention: no privileged containers or system-wide changes without approval
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:18:05 +01:00
71debd0be2 Update docs to reflect arm64 Docker build container
Replace Buildroot toolchain references with the new docker-arm64 setup
in CLAUDE.md, TOOLCHAIN.md, and the changelog.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:08:58 +01:00
6bd858d05b Remove stale docker/.build from gitignore
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:06:21 +01:00
a58dafdff5 Remove old Buildroot cross-compilation toolchain
The docker/ directory contained a 32-bit ARM Buildroot toolchain that
didn't match the target device (aarch64 Ubuntu 22.04). Replaced by the
arm64 Docker container in docker-arm64/.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:05:59 +01:00
a3a8831286 Add docker-arm64/.build to gitignore
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:05:41 +01:00
a1bafece22 Add arm64 Docker build container for native cross-compilation
Uses ubuntu:22.04 arm64 image running under QEMU emulation to produce
aarch64 binaries that match the target device exactly (same glibc, same
distro). Replaces the broken Buildroot cross-compilation approach.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:04:41 +01:00
7597f17f9e Document target device hardware, software, and library inventory
Adds a Target Device section to TOOLCHAIN.md with specs gathered over
SSH from the Anbernic RG35XX Plus. Confirms the device runs Ubuntu 22.04
with all required shared libraries (SDL2, FFmpeg) pre-installed, making
the Buildroot toolchain unnecessary. Updates Possible Approaches to
reflect that native arm64 container builds are confirmed working.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 13:29:53 +01:00
b1c72ef876 Document cross-compilation toolchain findings and aarch64 mismatch
The Docker/Buildroot toolchain produces 32-bit ARM binaries but the
RG35XX target runs a 64-bit aarch64 userland. Add docs/TOOLCHAIN.md
covering the full pipeline, config details, patches, and three possible
approaches to fix the architecture mismatch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 13:04:12 +01:00
a09d1e0279 Restore original toolchain dockerfile 2026-02-13 12:13:23 +01:00
d68e1d0f22 Enable FFmpeg and SDL2 in Buildroot cross-compilation config
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 12:11:23 +01:00
cbe3d67132 Replace build scripts with a Makefile
Single Makefile supports native builds (pkg-config) and cross-compilation
(CROSS_COMPILE/PREFIX env vars). Fixes -Wformat-truncation and
-Wstringop-truncation warnings at -O2 by sizing current_file to match
audio_files (256) and replacing strncpy with snprintf.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 11:54:36 +01:00
2fd764f60f Add raw joystick fallback for non-standard controllers
Open the joystick via SDL_JoystickOpen() when no GameController mapping
exists, fixing d-pad and face button input on devices like the Anbernic
retro handheld (GUID not in SDL's database). Handles JOYHATMOTION for
d-pad navigation and JOYBUTTONDOWN button 0 for activation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 11:37:19 +01:00
dbc3f11797 Ignore docker cross compilation toolchain state file 2026-02-13 10:51:53 +01:00
97162f8ec7 Use bash for aarch64 build script 2026-02-13 10:50:47 +01:00
52d5bbd971 Move controls.png to assets/ and gitignore all of build/
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 10:31:23 +01:00
238343b5e8 Fix -Wformat-truncation warning in window title formatting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 10:28:26 +01:00
7e67589150 Embed controls.png into binary so it can run from any directory
The spritesheet is compiled in as a C byte array. An external
controls.png in cwd still takes precedence for skinning. Includes
tools/embed_png.py to regenerate the header if the asset changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 10:25:22 +01:00
8f8cbc97c7 Add docker container with toolchain and libraries to build aarch64 binary 2026-02-12 17:01:12 +01:00
e3a2bca794 Add --debug flag for diagnosing controller input on handheld
Logs joystick enumeration at startup (name, GameController status, GUID)
and all SDL input events in the main loop to help diagnose why the retro
handheld's d-pad/buttons aren't recognized by the GameController API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 16:08:13 +01:00
141dbd97e0 Add audio/ to .gitignore
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 11:05:07 +01:00
1a2a7e337b Fix concat tool: handle embedded album art and strip track numbers from chapters
The m4a muxer doesn't support mjpeg as a regular video stream, causing
concatenation to fail when inputs contain album art. Extract art separately
and re-attach it with attached_pic disposition. Also strip leading track
numbers (e.g. "01 ") from chapter titles.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 11:03:38 +01:00
6209a087d7 Add lossless M4A concatenation tool
Shell script to recombine individual story m4a files back into
per-cassette files using ffmpeg concat demuxer (stream copy, no
re-encoding). Generates chapter markers from input filenames and
preserves album art.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 09:45:27 +01:00
3ba7b31148 Add volume control and d-pad/keyboard navigation
Replace mouse input with cursor-based navigation (arrow keys / d-pad +
Enter / A button) and add app-level volume control with a persistent
vertical slider, enabling use on a handheld gaming device without mouse
or system mixer access.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 09:06:00 +01:00
9f65414947 Add CLAUDE.md with project context for Claude Code
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 21:59:04 +01:00
fb6a6b263d Add .claude/ to .gitignore
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 21:53:10 +01:00
9db8dfdd48 Implement streaming decoder, seeking, persistence, file switching, album art
Replace fire-and-forget decode_audio() with a streaming Decoder that uses
libswresample to convert planar float to interleaved stereo, fixing the
sped-up audio bug and eliminating multi-GB memory usage for long files.

Add 10-second rewind/fast-forward, stop (pause in place), position
persistence per file via positions.txt, directory scanning with file
switching, embedded album art display, and a progress bar. Handles both
old and new FFmpeg channel layout APIs via version preprocessor check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-10 20:41:40 +01:00
d03d0a1f8b Add functional specification document 2026-02-10 20:00:19 +01:00
f367e1f9a0 Use older struct member for older libav version 2026-01-28 14:21:51 +01:00
5622209261 Add build script for aarch64 2026-01-28 14:21:19 +01:00
a80bd0c480 Semi working version 2026-01-28 13:37:34 +01:00
333ab8f82d WIP: controls 2026-01-16 17:58:00 +01:00
c1deafb7dd Initial commit 2026-01-14 23:06:37 +01:00