KrKr2 Emulator
This repository contains the KrKr2 Emulator, a cross-platform runtime for games made with the
KiriKiri engine (also known as T Visual Presenter). Current builds use SDL3 and software
rendering on Windows x64, Linux x64 and macOS arm64. Android uses SDL3 with a native Material 3
launcher. iOS builds are temporarily disabled.
语言 / Language: 中文 | English
Developer and AI collaboration: AGENTS.md · Documentation index · Architecture · Build and validation · Desktop runtime. These developer guides are maintained in Chinese.
Table of Contents
- Android:
arm64-v8a, x86_64
- Windows: x86_64
- Linux: x86_64
- macOS: arm64
- Common (desktop):
- CMake 3.28+
- Ninja
- Python 3
- Bison 3.8+
- vcpkg
- A C++17 compiler
- Windows:
- Visual Studio 2022, MSVC x64 developer shell
- winflexbison (
win_bison on PATH)
- Linux:
- GCC or Clang, pkg-config, and the native window/dialog development packages listed in the build guide
- macOS:
- Xcode / command line tools
- Android:
- JDK 17, Android SDK, Android NDK and Gradle
- See Android SDL3 host for the current SDK/NDK setup.
Build Environment Setup
Environment Variables
- Windows:
VCPKG_ROOT=D:/vcpkg
- Add the
winflexbison directory to PATH.
- Linux / macOS:
VCPKG_ROOT=/path/to/vcpkg
- Android:
VCPKG_ROOT=/path/to/vcpkg
ANDROID_HOME=/path/to/android/sdk
ANDROID_NDK=/path/to/android/ndk
Note: On Windows, use / or \\ in CMake paths instead of a single \.
Build Steps
Windows (Debug, with tests):
cmake --preset "Windows Debug Config" -DENABLE_TESTS=ON
cmake --build --preset "Windows Debug Build"
ctest --test-dir out/windows/debug -N
ctest --test-dir out/windows/debug --output-on-failure --no-tests=error
The convenience script ./scripts/build-windows.bat wraps the default Debug configure/build.
Linux:
cmake --preset "Linux Debug Config" -DENABLE_TESTS=ON
cmake --build --preset "Linux Debug Build"
ctest --test-dir out/linux/debug --output-on-failure --no-tests=error
Use Linux Release Config / Linux Release Build for a release build. System dependencies and
headless-test commands are in the build guide. The convenience script
./scripts/build-linux.sh wraps the default Debug configure/build.
macOS:
cmake --preset "MacOS Debug Config" -DENABLE_TESTS=ON
cmake --build --preset "MacOS Debug Build"
ctest --test-dir out/macos/debug --output-on-failure --no-tests=error
Use MacOS Release Config / MacOS Release Build for a release build. Runtime launch details are
in macOS desktop host.
Android:
./platforms/android/gradlew -p ./platforms/android assembleDebug
Executable Location
- Windows:
out/windows/debug/bin/krkr2/krkr2.exe
- Linux:
out/linux/debug/bin/krkr2/krkr2
- macOS:
out/macos/debug/bin/krkr2/krkr2.app
- Android:
platforms/android/app/build/outputs/apk/debug/app-debug.apk
Release builds use the same paths under out/<platform>/release/.
Launch a game with:
krkr2 --game /path/to/game
Use --help and --list-settings for command-line options. See
desktop command line for exit codes and validation.
Text Script Regression Tests
KRKR2_ENABLE_SCRIPT_SMOKE is OFF by default and can be enabled in an existing desktop build
without enabling the full test suite. The tests run the real engine with generated scripts and
check text reading modes, BOM/boundary handling, parser diagnostics, and renderer-construction
failure recovery. No commercial game files are used.
cmake --preset "Linux Release Config" -DENABLE_TESTS=OFF -DBUILD_TOOLS=OFF \
-DKRKR2_ENABLE_SCRIPT_SMOKE=ON
cmake --build --preset "Linux Release Build" --target krkr2
LIBGL_ALWAYS_SOFTWARE=1 ALSOFT_DRIVERS=null xvfb-run -a \
ctest --test-dir out/linux/release -R '^(textstream|parser-error|renderer-error)-runtime$' \
--output-on-failure --no-tests=error
Logs and JSON reports are written under the build directory in script-smoke/. These tests do not
prove full game, audio/video or save-load compatibility.
- clang-format@20
- Linux:
clang-format -i --verbose $(find ./cpp ./platforms ./tests ./tools -regex ".+\.\(cpp\|cc\|h\|hpp\|inc\)")
- macOS:
clang-format -i --verbose $(find ./cpp ./platforms ./tests ./tools -name "*.cpp" -o -name "*.cc" -o -name "*.h" -o -name "*.hpp" -o -name "*.inc")
- Windows:
Get-ChildItem -Path ./cpp, ./platforms, ./tests, ./tools -Recurse -File |
Where-Object { $_.Name -match '\.(cpp|cc|h|hpp|inc)$' } |
ForEach-Object { clang-format -i --verbose $_.FullName }
Only format files changed by a contribution; do not reformat the whole tree.
Game Validation
See local samples and validation limits. Compiling and
passing unit tests is not a claim of full game compatibility. Platform-specific validation
checklists are in the Windows,
macOS, Linux and
Android host documents.
Plugin Resources
License
MIT License. See LICENSE for details.
评论