Repository navigation
Android port, piece 3: the game code built on the device, and the movies - #614
Merged
Merged
Conversation
The setup builds the game code on the device from the player's own extracted game files, as on the desktop (runtime/gamebuild.c), with the bundled generator and compiler. From LASRecompAndroid by mamcjr (MIT). - android/deps/build_gen_deps.sh: Python 3.14 for Android (python.org), capstone, unicorn and lz4 built with the NDK, their bindings (lz4.block through liblz4: android/gen/lz4), and zig 0.17.0 for aarch64 Linux (the desktop's version). Pinned sources and checksums. - The APK: Python's launcher, libpython, the native libraries and zig as lib*.so in nativeLibraryDir (the only place Android runs programs from); the rest as assets/gen.zip, unpacked by the activity into internal storage once per install or update, on its own thread (the build waits). - gamebuild.c on Android: those tools and their environment, the generator with --dyn-base, zig for aarch64-linux-musl, linked -nostdlib against libmain.so. Flags in the app's CMake (GAMELIB_CFLAGS / GAMELIB_SHARED), with -dag-maps-huge-region=500 and no UBSan / stack protector. - gamelib.c: the library is loaded from a copy in internal storage (shared storage is mounted noexec), made again when the built one changed. - CI: the Android job builds the builder too; the APK check allows its files and looks inside gen.zip file by file. Tested on the arm64 Android 15 emulator: the generator wrote main (538 files, 86,669 functions) in 38 s and sdk in 10 s, the build finished in 1316 s on 4 cores, and the library loaded and the game booted until the title movie (movie.c needs FFmpeg, not on Android yet). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The game crashed at its title movie on Android: runtime/hle/movie.c (the game's movie player, on FFmpeg) was left out of the app, so movie::Extractor stayed a stub and the game read an object that was never made. The start screen's background frame (the title movie's) was missing for the same reason. - android/deps/build_deps.sh builds FFmpeg 9.0.2 for arm64 with the desktop builds' LGPL-only configuration (tools/linux/build_deps.sh), unversioned library names (Android loads shipped libraries by exact name), and the same not-GPL check. Cross settings from LASRecompAndroid by mamcjr (MIT). - The app links avcodec / avformat / avutil / swscale and builds movie.c; the LARECOMP_NO_FFMPEG guards are gone. CI's APK check allows the four libraries. Tested on the arm64 Android 15 emulator: the start screen shows its background, and Play runs the opening movie at 60 fps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #612: it targets #612's branch, so the diff shows only this work. Once #612 is merged, switch the base to
beta_6. Ported from mamcjr's LASRecompAndroid (MIT). With this the game boots on Android. Desktop builds are unchanged.Building the game code on the device
runtime/gamebuild.c). Nothing from the game ships.android/deps/build_gen_deps.shbuilds, from pinned sources:lib*.so.assets/gen.zip. The app unpacks it once per install or update, and the build waits for that if needed.gamebuild.con Android: the generator runs with--dyn-base, and zig compiles foraarch64-linux-musl, linking-nostdlibagainstlibmain.so.gamelib.cloads the library from a copy in internal storage, since shared storage is mounted noexec.Movies
build_deps.shbuilds FFmpeg 9.0.2 with the desktop's LGPL-only configuration and the same not-GPL check.movie.c. Without it, the game crashed at its title movie, and the start screen had no background.CI
gen.zipfile by file, so only the builder's own files can ship there.Tested on the arm64 Android 15 emulator
Known
🤖 Generated with Claude Code