Repository navigation
guide building
Working manual · 0.0.1-alpha · source snapshot 16 November 2026
These are repository build instructions. They are not a claim that the installed binary or every handheld configuration has passed acceptance testing.
The Pro hardware test now confirms visible graphics with the framebuffer handoff.
Its completed control capture supplies tools/handheld/gamecontrollerdb.txt for
the stock classic joystick GUID. Copy this file to Contour/gamecontrollerdb.txt;
the launcher loads it automatically. SDL face mappings use physical positions,
digital L2/R2 map from buttons 10/11, and the sticks use axes 0/1 and 2/3.
Menu produces buttons 8 and 13; only 8 maps to Guide. Guide is the dedicated MENU navigation modifier (see menu-navigation.md); stick-click actions remain unbound. Volume/Power remain firmware controls.
The mapping still needs a final in-application check on the Pro.
One application and one project format serve Windows x64 and Linux AArch64. RG35XX H is the reference device; RG35XX Pro is a second deployment target for the same H700 binary. Hardware compatibility is not yet verified.
Use a Visual Studio developer shell with C++20 tools, a Windows SDK and CMake 3.21 or newer on PATH (presets require 3.21). The existing non-preset build still works with CMake 3.20:
cmake -S . -B build
cmake --build build --config Debug
ctest --test-dir build -C Debug --output-on-failureOr use separate preset build directories:
cmake --preset windows-release
cmake --build --preset windows-release
ctest --preset windows-releaseReplace windows-release with windows-debug for Debug. Presets use CMake's
default Visual Studio generator and x64 architecture. If your environment sets
a different default generator, pass -G "Visual Studio 18 2026" (or your installed
Visual Studio generator) on first configure.
The default build stages dist/windows-x64/Contour.exe, SDL3.dll when SDL is
shared, and assets/. Existing executables under build/bin/<configuration>
remain available. ContourStage builds and stages just the application if an
optional desktop authoring tool is running and has its executable locked:
cmake --build build --config Debug --target ContourStageThe Pro reports firmware 20251206, Allwinner H700 Linux 4.9.170. Its returned
report confirms AArch64 Ubuntu 22.04, glibc 2.35, libstdc++ symbols through
GLIBCXX_3.4.30, /dev/fb0 with a 640x480 panel and 640x960 virtual buffer,
32-bit pixels/2560-byte stride, mali_kbase, ALSA and ANBERNIC-keys input.
There is no /dev/dri. The earlier KMS/DRM build cannot drive this firmware.
Contour now offers h700-stock-release: SDL software rendering with a small Linux
framebuffer presentation boundary, retaining SDL3 input/audio and all shared UI.
tools/handheld/Contour Device Check.sh reads system/library/device information
and writes Contour-device-report.txt beside itself. Copy the script to the
card's Roms/APPS, launch it from App Center -> APPS, then return the report.
This uses the documented stock H700 app launcher convention.
The checker successfully ran on this Pro. No packages, firmware
settings, network services or graphics device state are changed by the checker.
It is a setup diagnostic, not an application binary or a firmware SDK.
Instructions are included in dist/Contour-Device-Check.zip and
tools/handheld/README.txt. Shell syntax and report generation were smoke-tested
under Git Bash on Windows, including a script directory containing spaces;
the returned hardware report was then used to select framebuffer presentation.
With Visual Studio's CMake/Ninja tools installed, run in PowerShell:
./tools/handheld/BuildStockWindows.ps1
./tools/handheld/PackageStock.ps1The first command downloads Arm GNU 11.3.Rel1 for Windows/AArch64 Linux (about
293 MB) and the Ubuntu Jammy ARM64 ALSA development/runtime packages, verifies
pinned SHA256 checksums, extracts them into build/handheld-sdk, and builds
h700-stock-release. The SDK supplies glibc 2.35. Subsequent runs reuse the files.
No system-wide toolchain install, PATH change or firmware change is performed.
The short gcc SDK directory is intentional: GCC 11's Windows path expansion
fails on some standard-library headers with the original long archive name.
Pass -CMakePath and -NinjaPath if automatic Visual Studio discovery is unsuitable.
Stock SDL is static; ALSA and the C/C++ runtimes remain firmware libraries. The minimal build enables Linux joystick enumeration and software rendering, with optional GPU, camera, desktop backends, HIDAPI and udev support disabled. The built-in controller still uses SDL's Linux joystick backend and kernel mappings. This configuration needs no Mali, DRM, GBM or EGL headers/libraries.
The packaging command verifies an AArch64 ELF and its match to the stock build,
then creates dist/Contour-RG35XX-Stock-Test.zip containing Contour.sh,
Contour/contour, assets, SDL's license and installation notes. This is a plain
stock-app test bundle, not a PortMaster package. Extract on the PC and copy the
script and folder into Roms/APPS. Launch from App Center -> APPS. User data goes
under Contour/data; INST starts in Contour/data/Samples and can browse the shared
user library. See migration and layout. The launcher logs
to Contour/Contour-launch.log and prioritizes AArch64 runtime library paths over
the firmware's mixed 32/64-bit paths. Preserve data when updating.
Hold Select+L1+R1, then press Start to quit through the existing unsaved-edit confirmation. The exact same binary is intended for compatible H700 devices; successful hardware rendering, mapping, sound, saves and performance remain to be tested on the Pro and H. The first Pro launch ran its main loop but left the Anbernic loading screen visible and found no SDL gamepad. Test build 2 reapplies the existing framebuffer mode, unblanks its layer and submits the current viewport after copying each frame. The stock launcher selects SDL's classic joystick backend; SDL derives controls from kernel button mappings, without a guessed Pro mapping. Saved framebuffer pixels and the viewport are restored on normal exit.
Copy the additional Contour Test.sh beside Contour.sh and launch Contour Test
only after the first normal launch has finished migrating the user library. It uses the firmware's timeout command to request exit after 30 seconds,
with a forced stop five seconds later if necessary. If timeout is unavailable,
it logs an error and returns without starting Contour. Exit status 124 is expected
for this timed test. Use it only to test display/buttons, not to edit a project.
The regular Contour launcher has no time limit.
The display handoff is based on the sunxi framebuffer driver's set_par, blank and pan operations. This related vendor driver is supporting evidence, not verification of this exact firmware kernel. Both fixes still require the next Pro hardware test.
Use an SDK matching the firmware's 64-bit userspace, not merely its CPU. Both devices must provide a compatible AArch64 loader, libc/libstdc++, graphics and audio stack for the same binary to work. A modern generic ARM64 Linux binary is not automatically compatible with an older firmware.
Required on the build host:
- CMake 3.21+, Ninja, host pkg-config and an AArch64 GCC with C++20 support; alternatively Clang/Clang++ with the target C++ standard library and linker.
- A firmware development sysroot containing headers, libraries, linker files and
target
.pcmetadata. A copy of a runtime SD card alone is usually insufficient. - Target development libraries for ALSA, libdrm, GBM, EGL and GLES2. Include udev development support for SDL controller discovery where the firmware uses udev.
The original h700-release configuration selects SDL's KMS/DRM and ALSA backends, without
X11, Wayland, PulseAudio or PipeWire. Configuration fails if KMS/DRM or ALSA was
requested but could not actually be compiled. This is a concrete initial backend
choice, not evidence that every H700 firmware exposes compatible KMS/GBM/EGL.
Confirm the firmware stack before deployment; no kernel/driver changes are made.
SDL3 is built directly from vendored/SDL with the same target compiler and
sysroot as Contour. H700 defaults to static SDL, so it needs no separate SDL3
shared library. This does not make libc, libstdc++, ALSA or the GPU stack
static; those must be provided by compatible firmware. SDL's configuration summary
shows the backends actually compiled. See the bundled
SDL Linux notes (repository reference: ../vendored/SDL/docs/README-linux.md).
| Documentation still to add |
|---|
| Annotated current-build screenshots and a recorded controller walkthrough for this topic. |
Repository sources used for this page:
docs/Building.md
This is a documentation/source review, not a new runtime or hardware test. Physical response, screenshots and listening examples still need verification on a recorded build.