# AC6Recomp > [!CAUTION] > This project is still work in progress. It can boot and run in-game, but bugs, crashes, and missing functionality should be expected. A native PC port of **Ace Combat 6: Fires of Liberation** built on top of the [ReXGlue SDK](https://github.com/rexglue/rexglue-sdk). The Xbox 360 PowerPC game code is statically recompiled to x86-64, while visible rendering currently remains authoritative in the vendored RexGlue/Xenia graphics backend. ## About this fork This is a fork of [sal063/AC6_recomp](https://github.com/sal063/AC6_recomp), adding Linux support. Two things differ from upstream: - **No prebuilt binaries.** The ReXGlue SDK is vendored as source only; upstream's prebuilt host binaries (`tools/binutils/`, the Dear ImGui example libs) are removed because nothing in the build references them. See [thirdparty/rexglue-sdk/VENDORED.md](thirdparty/rexglue-sdk/VENDORED.md) for the pinned commit and the full list of local patches. - **Linux port.** Host-dependent code moved behind `src/ac6_port/`, plus fixes in the vendored SDK for POSIX signal handling, event synchronisation, sockets, and codegen. Linux support **boots and renders**, with known audio and input issues — see [Linux status](#linux-status). --- ## Disclaimer This project is an unofficial, non-commercial fan effort. It is **not affiliated with, endorsed by, or associated with** Bandai Namco Entertainment, Project Aces, or Microsoft. *Ace Combat 6: Fires of Liberation* and all related assets, characters, and trademarks are the property of their respective owners. **This repository contains source code only. It does not contain, and will never contain, any game data.** To use this software you must supply your own legally obtained copy of the game. No game files, disc images, DLC packages, title updates, or console keys are distributed here, and none may be committed to this repository. The software is provided as-is, without warranty of any kind. It is experimental: expect bugs, crashes, and visual or audio differences from the original console release. Do not redistribute builds bundled with game data. --- ## Features Everything listed here is on by default unless noted, and each fix can be turned off individually. See [Important console variables](#important-console-variables). - **60 FPS.** The game can now run up to 60 FPS, with the flight model corrected. - **High quality terrain.** Terrain is drawn at the full resolution shipped on the disc, twice what the console rendered. Cracks and seams that appear over mountains are also removed. - **Resolution scaling.** Render internally at 2× (1440p) or 3× (2160p) and beyond for a much sharper image. - **Ultrawide support.** Optional hor+ widescreen in missions and cutscenes. - **AC7-like keyboard and mouse controls.** Mouse steering, remappable bindings, live-reloaded from a config file. Controllers work out of the box, including a virtual pad when none is connected. - **Japanese language support.** - **Texture replacement modding** — see [Modding docs](#modding-docs). ### Fixes *Most of the known issues with the recomp have been fixed. Please report if you have found more issues.* *Performance is a known issue with the recomp! Due to native renderer not yet implemented, a powerful GPU is recommended to be able to run the game at 60 FPS at high resolution!* --- ## Quick Start Guide ### Requirements | | Windows | Linux | |---|---|---| | **OS** | Windows 10 or 11, 64-bit | x86-64 glibc distro, 64-bit | | **CPU** | **Must support AVX2** — Intel 4th-gen Core (2013) or newer, AMD Zen (2017) or newer. | same | | **GPU** | Direct3D 12 capable | Vulkan 1.1+ capable | | **Dev deps** (build only) | Visual Studio 2022 + Clang component, CMake, Ninja, Python | Clang 18+, CMake 3.25+, Ninja, `libgtk-3-dev`, `libx11-xcb-dev`, `pkg-config`, Python 3, `extract-xiso` for ISO extraction | | **Game data** | Your own legally obtained copy of Ace Combat 6 (US region only! Europe and Japan is not supported) | same | *Note that the system requirement does not guarantees that the recomp will perform well on your system!* ### Steps (Windows) 1. **Get a build.** Either download from release, or build from source (see [How to build](#how-to-build)). 2. **Provide the game data.** Put *one* of the following next to `ac6recomp.exe`: - the game's `.iso` disc image **or** - an `assets/` folder containing the extracted game files. 4. **(Optional) Add DLC.** Extracted DLC packages can be placed next to the executable, inside a folder named `dlc/`. 5. **Run `ac6recomp.exe`.** On first run it creates `ac6recomp.toml` beside the executable, which contains the game settings. 6. **In-game keys:** - `F3` - toggle FPS overlay - `F4` - settings overlay (browse and change most options live) - `F11` - toggle fullscreen ### Steps (Linux) 1. **Build from source** (see [How to build](#how-to-build)) — or run the automated script: ```bash ./setup_and_build.sh # checks prerequisites, extracts the ISO, builds ``` 2. **Provide the game data** the same way: a `.iso` or an `assets/` folder next to the `ac6recomp` binary. 3. **Run `./ac6recomp`.** Keys are identical to Windows (`F3` / `F4` / `F11`). > **Linux notes** > - Rendering uses the Vulkan backend; D3D12 does not exist on Linux. > - Keyboard+mouse input is event-driven (X11/Wayland via GTK). Mouse-steering cursor confinement behaves like a resting mouse if the cursor leaves the window. > - The `ac6_widescreen` feature requires the patched vendored SDK (included) — see `thirdparty/rexglue-sdk/VENDORED.md`. --- ## Important console variables Settings live in **`ac6recomp.toml`** next to the executable. Most can also be changed live in the `F4` overlay. Some only take effect after a restart. > [!IMPORTANT] > In `.toml`, **use forward slashes in paths**. A single backslash is an escape character and one bad line silently voids the entire file, sending every setting back to its default. | cvar | default | what it does | |---|---|---| | `user_language` | `1` | Sets the language. `1` for English, `2` for Japanese. | | `fullscreen` | `false` | Start in fullscreen (`F11` toggles at runtime) | | `draw_resolution_scale_x` | `1` | Internal render scale on the x axis. `1` for 1280, `2` for 2560, `3` for 3840, etc. | | `draw_resolution_scale_y` | `1` | Internal render scale on the y axis. `1` for 720, `2` for 1440, `3` for 2160, etc. | | `ac6_unlock_fps` | `true` | Allow framerates above the stock 30 fps | | `ac6_dynamic_vblank` | `true` | Keep menus and cutscenes at their native 60 Hz pacing while gameplay runs at your target | | `ac6_performance_mode` | `true` | Reduces logging and diagnostic overhead | | `ac6_widescreen` | `false` | Ultrawide support (hor+) in missions. Menus and hangar stay 16:9 | | `ac6_widescreen_cinematics` | `true` | With ultrawide on, also widen in-engine cinematics. They are staged for 16:9, so this can expose set edges | | `ac6_terrain_hd` | `true` | Draw terrain at the full shipped resolution (2× what the console drew), which also removes terrain cracks | | `ac6_fullres_effects` | `false` | Draw clouds, smokes, trails, and afterburner effect at native resolution (2× what the console drew), slightly affects performance | | `ac6_cursor_hide_seconds` | `3.0` | Hide the mouse cursor after this many idle seconds. `0` = never hide | | `ac6_kbm_enabled` | `false` | **Enable keyboard and mouse controls.** Off by default — controllers work out of the box | | `ac6_kbm_config` | `ac6_input.toml` | Path to the key bindings file. Edits are picked up live | | `ac6_texture_swaps_enabled` | `false` | Enable texture replacement mods (see [Modding docs](#modding-docs)) | For 1440p, set both `draw_resolution_scale_x` and `draw_resolution_scale_y` to `2`. For 2160p or 4K, set them to `3`. For 1440p Ultrawide, it is recommended to set `draw_resolution_scale_x` to `3` and `draw_resolution_scale_y` to `2`. ### Troubleshooting crashes (Linux) The Windows crash-report file is not produced on Linux (the SDK's crash reporter is Windows-only for now). Instead, the system's core dumps cover it fully — build `RelWithDebInfo` (the default preset), keep the build tree, and after a crash: ```bash coredumpctl list ac6recomp # find the crash coredumpctl gdb # open it under gdb with full symbols ``` ### Fixes These are on by default and exist so a problem can be isolated. Turning one off restores the original behavior, bugs included. | cvar | default | what it fixes | |---|---|---| | `ac6_effect_mode_fix` | `false` | **IMPORTANT: If your clouds and afterburner effects are flickering, set this to `true`!** | | `ac6_fix_scaling` | `true` | Upscaling mosaic on deferred passes (only active above 1× scale) | | `ac6_fix_deswizzle` | `true` | Mosaic and streak artifacts from the game's manual texture de-swizzle | | `ac6_fix_dof` | `true` | Cutscene depth-of-field striping and ghosting above 1× scale | | `ac6_fix_trails` | `true` | Invisible missile and jet trails | | `ac6_fix_water_line` | `true` | Lines across open water seen at a grazing angle | | `ac6_flare_drop_quad2` | `true` | Faint rectangle around the sun | | `ac6_cutscene_resync` | `true` | Keeps cutscene video locked to its audio after a render hitch | --- ## Default keybinds Controllers work with no configuration. **Keyboard and mouse are off by default**. Set `ac6_kbm_enabled = true` to enable them. Bindings live in `ac6_input.toml`, created next to the executable on first run after `ac6_kbm_enabled` is enabled. By default, the keybinds are similar to Ace Combat 7. ### Flight | action | keys | | action | keys | |---|---|---|---|---| | Pitch down / up | `1` / `3` | | Fire machine gun | `Mouse1`, `Left Ctrl` | | Roll left / right | `A` / `D` | | Fire missile | `Mouse2`, `Space` | | Yaw left / right | `Q` / `E` | | Change weapon | `Mouse wheel`, `C` | | Accelerate | `W` | | Switch targets | `Tab` | | Decelerate | `S` | | Change view | `V` | | High-G turn | `2` | | Radar / map | `R` | | Autopilot | `Z`, `X` | | Landing gear | `G` | | Pause | `Escape` | | | | **Mouse** steers the aircraft. Hold `Left Alt` (camera control) to look around with the mouse instead of steering. **Camera:** `Numpad 8` / `2` / `4` / `6` — up / down / left / right. **Wingman commands:** arrow keys. ### Menus | action | keys | |---|---| | Navigate | `W` `A` `S` `D` or arrow keys | | Confirm | `Space`, `Mouse1` | | Cancel | `Escape`, `Backspace`, `Mouse2` | | Start | `Enter` | | Back | `Tab` | --- ## Linux status Work in progress, but **it boots and renders**. The Linux build reaches the intro cutscenes at roughly 30 FPS. Known issues: - Performance is well below the 60 FPS target. Keyboard input is **off by default** — both keyboard paths are opt-in, on every platform. Set one of these in `ac6recomp.toml`: ```toml mnk_mode = true # SDK keyboard/mouse -> virtual pad ac6_kbm_enabled = true # AC6's own AC7-style keyboard+mouse controls ``` Note that with `ac6_kbm_enabled` the AC6 mapper installs itself from a hook on the guest's `CGaUserInput::Update`; if that hook never runs, its binding file (`ac6_input.toml`) is never written and the mapper stays inert. `mnk_mode` does not depend on that hook. Debugging notes: - `ptrace_scope` is often `1`, so `gdb -p` on a running instance fails. Take a core instead: the process **ignores SIGQUIT**, so use `kill -ABRT` with `ulimit -c unlimited` and open the core with `gdb ./ac6recomp core.N`. `coredumpctl` only works if you actually have systemd-coredump. - Killing the runtime with `SIGKILL` leaks its `/dev/shm/xenia_memory_*` mapping (~4.8 GB each). They accumulate and fill `/dev/shm`, after which guest memory allocation fails with a **SIGBUS** that looks like a real crash. Clear them between runs: `rm -f /dev/shm/xenia_memory_*`. - `log_level = "info"` in `ac6recomp.toml` is needed for the boot log to be useful. --- ## How to build ### Option A: Automatic setup (recommended) #### Windows The automated build script handles environment setup, ISO extraction, and the multi-step CMake build: 1. Place your legally obtained **Ace Combat 6 ISO** in the repository root directory. 2. Run `setup_and_build.bat`. The script locates Visual Studio, extracts the assets, runs codegen, and builds the runtime using the MSVC backend. 3. Copy the compiled executable and default config to the root directory to run: ```powershell Copy-Item out/build/win-amd64-relwithdebinfo/ac6recomp.exe . -Force ``` 4. Run `ac6recomp.exe` directly from the root directory. 5. Optionally create a shortcut to the executable. #### Linux ```bash ./setup_and_build.sh ``` Same flow: prerequisites check, ISO extraction (`extract-xiso`), codegen, build. The script stages `ac6recomp` in the repository root. Pass `--clean` to wipe `out/` first. ### Option B: Manual build #### Windows ```bash cmake --preset win-amd64-relwithdebinfo cmake --build --preset win-amd64-relwithdebinfo --target ac6recomp_codegen cmake --preset win-amd64-relwithdebinfo cmake --build --preset win-amd64-relwithdebinfo ``` The executable is placed at `out/build/win-amd64-relwithdebinfo/ac6recomp.exe`. On Windows, use the preset commands above rather than plain `cmake -L` in the repo root. If you previously configured from an `x86` Visual Studio prompt or with the wrong compiler on `PATH`, delete `out/build/win-amd64-relwithdebinfo` and re-run the preset from a normal 64-bit PowerShell/CMD window or an x64 Native Tools prompt. #### Linux ```bash cmake --preset linux-amd64-relwithdebinfo cmake --build --preset linux-amd64-relwithdebinfo --target ac6recomp_codegen # needs assets/default.xex cmake --preset linux-amd64-relwithdebinfo cmake --build --preset linux-amd64-relwithdebinfo ``` The executable is placed at `out/build/linux-amd64-relwithdebinfo/ac6recomp`. The Linux presets use unversioned `clang`/`clang++` (Clang 18 or newer; on Ubuntu/Debian you may need the `clang-XX` packages with `CC=/CXX` overrides or symlinks). --- ## Repository policy This repository contains source code only. Do **not** commit or redistribute: - retail game data - `default.xex` - disc images, packages, title updates, or firmware files - console keys or any other proprietary Microsoft / publisher material Users must supply their own legally obtained game files locally. ## Modding docs - [Texture Swap Modding Guide](docs/TEXTURE_SWAP_MODDING_GUIDE.txt) - [Texture Swap Reference](docs/TEXTURE_SWAPS.txt) ## Project layout ```text AC6_recomp/ |- src/ | |- ac6_backend_fixes/ AC6-specific backend diagnostics and fix routing | |- ac6_native_graphics.* AC6 frame-boundary analysis and overlay status | |- ac6_port/ Host-platform services (memory scan, window, DXGI types) | |- d3d_hooks.* Guest D3D capture and shadow-state hooks | `- render_hooks.* Timing and frame pacing hooks |- thirdparty/rexglue-sdk/ Vendored RexGlue SDK (see its VENDORED.md) |- generated/ Generated recomp sources |- assets/ Local game files, not kept in repo `- docs/RENDERER_ARCHITECTURE.txt ``` ## License See [LICENSE](LICENSE).