# CarnageHeart Recompiled
[](https://github.com/Hatdagger/Carnage-heart-recomp/releases)
[](https://github.com/Hatdagger/Carnage-heart-recomp/releases/latest)
[](https://github.com/Hatdagger/Carnage-heart-recomp/releases/latest)
Static recompilation of **CarnageHeart** built on
[psxrecomp](https://github.com/mstan/psxrecomp) and
[recomp-ui](https://github.com/RetroPortingToolKit/recomp-ui).
Native PC port of Carnage Heart (USA, SCUS-94604), the Artdink game where you program your mechs (OKEs) with chip-based AI and send them into battle. Targets: Linux and Windows now; Android and browser planned.
This repository contains **no game data and no recompiled game code**. You generate the code yourself from your own disc.
| | |
|---|---|
| Players | 2 |
| Region | USA |
| Publisher | — |
| Year | — |
## Status
- Linux x64: boots on the bundled OpenBIOS (no Sony BIOS needed), reaches the title screen and the campaign.
- **PlayStation Mouse support restored.** The USA release had its mouse code removed; it is put back from *Carnage Heart EZ* (Japan) in `src/mouse_pad_hle.c`. Left click confirms and right click goes back (the USA button roles, not EZ's), menus follow the pointer and click the item under it, and the cursor no longer snaps to the centre of menu boxes. You don't need a PS1 Mouse: in a normal window the pointer or a touch screen drives the cursor while your pad keeps working.
### Mouse and touch controls
| Input | Does |
|---|---|
| Move the pointer | Moves the game's cursor (the pad takes over again as soon as you press a pad button) |
| Left click / tap | Cross (confirm) on the item under the pointer |
| Right click / two-finger tap | Circle (back), as on the PS1 Mouse. Closes the button menu if it is open |
| Middle click / long press | Opens a small menu at the pointer with the buttons a mouse lacks. On menu screens it lists only the buttons that do something there and says what they do (for example "SELECT: QUIT GAME", "L2: NEXT BASE", "R2: CHIP LIST" on the chip program grid, "L2: NEXT OKE" in battle); **MORE BUTTONS** shows the full list (Triangle, Square, Start, Select, L1, R1, L2, R2). Pick one to press it on the item you middle-clicked; click anywhere else (or middle-click again) to close |
| Mouse wheel | On the chip program grid: scrolls the grid up and down (half a row per notch). Shift + wheel, a sideways wheel or a sideways touchpad swipe scrolls left and right. On lists with arrow buttons (Select Card, Production, Form Unit): one row per notch, wherever the pointer is |
Which buttons each menu screen uses comes from a scan of the game's code (`tools/scan_screens.py`, table in `src/screen_labels.c`), checked in the game. In battles the menu offers **L2: NEXT OKE** (camera to the next OKE), **SETTINGS** (display, speed and camera) and **OKE STATUS** (test battles) or **NEXT OKE** (other battles). As in *Carnage Heart EZ*, while you use the mouse a battle takes left click for OKE status / next OKE and right click for settings, in place of Start and Select. Any other screen shows the full list.
While you use the mouse, the game also switches on the mouse layout that *Carnage Heart EZ* used and the USA release left switched off: menus stop jumping between items, and the base screen's minimap becomes clickable (pointing marks the hex under the cursor, the round arrows turn the view, **MAP** opens the full map). The game's own arrow cursor is hidden while you use the mouse or touch screen (your normal pointer already shows where you are); it comes back with a pad or a real PS1 Mouse. Press a pad button and the pad layout comes back.
Pointer mode is off during netplay. Set `CH_POINTER=0` to turn it off.
## Play on Windows (setup kit)
1. Download `carnageheart-setup--windows-x64.zip` from [Releases](https://github.com/Hatdagger/Carnage-heart-recomp/releases) and unzip it anywhere.
2. Put your own Carnage Heart (USA) Redump dump (the `.cue` and its `.bin` tracks) **beside `CarnageHeart_Recompiled.exe`** (or in a `disc` folder next to it).
3. Run `CarnageHeart_Recompiled.exe`. The first launch is the installer: it finds the disc (it only asks if the disc isn't there), downloads the portable compiler pack once, turns your disc into C and builds the game on your PC. This takes a while the first time.
4. Every launch after that opens the game's launcher directly.
No game data or recompiled code is downloaded; everything game-specific comes from your disc.
### Updates
When the launcher opens, it checks for a newer version. If there is one, a 10-second countdown appears: when it runs out (or you pick **UPDATE NOW**) the launcher downloads and installs the update, rebuilds the game with it and then opens again by itself. Pick **NOT NOW** (or press B / Esc / right click) to skip it this time; you are asked again the next time the launcher opens, and **UPDATE** in the menu installs it whenever you like. Your disc image, memory cards, settings and online games are never touched. Without internet the check fails quietly. To turn the automatic check off, set the environment variable `CH_NO_AUTO_UPDATE=1`.
If setup fails, open `setup-log.txt` in the same folder as the exe. It records every setup step, including the build that runs in a console window after the wizard closes. Send that file when you report a problem.
### Tutorials
Once the game is installed, the launcher shows **INSTALL TUTORIALS**. It makes the lessons' pictures on your PC from your own disc and game: portraits and part pictures are read from the disc image, and the game runs hidden for about four minutes (a new Practice game, nothing saved) while it takes screenshots of the menus. A window shows the progress. Afterwards the row reads **TUTORIALS** and opens the lessons in your web browser (they work offline); **MAKE THE PICTURES AGAIN** retakes them, e.g. after an update. The pictures stay in `tutorials/local/` and are never uploaded or shipped. If the hidden window gives no pictures on your PC, a normal game window opens instead: don't click in it until it closes. Details: `tutorials/local/make-pictures-log.txt`.
### Android app
Once the game is installed, the launcher shows **BUILD ANDROID APP**. It opens a window that builds `CarnageHeart.apk` from your installed game (the first time it downloads the Android tools once). When it finishes, the launcher shows a QR code: scan it with the tablet's camera (tablet on the same Wi-Fi as the PC) and a page opens where you can download the app and your disc files straight from the PC. The link works only while that screen is open, and **SEND APP TO TABLET** on the main menu shows it again later. If Windows asks about the firewall, allow private networks. You can still copy `CarnageHeart.apk` from the game folder by cable instead.
## Play on Steam Deck (or any Linux) with the AppImage
1. Download `CarnageHeart_Recompiled--x86_64.AppImage` from [Releases](https://github.com/Hatdagger/Carnage-heart-recomp/releases) in Desktop Mode, and put it in a folder of its own (for example `~/Games`).
2. Put your own Carnage Heart (USA) Redump dump (the `.cue` and its `.bin` tracks) in the same folder.
3. Double-click the AppImage. If it doesn't start, right-click it > Properties > Permissions and tick "Is executable".
4. The first start installs the game into a `CarnageHeart` folder beside the AppImage. On a Steam Deck it then downloads the compiler pack once (about 830 MB, with a progress window), and builds the game from your disc. This takes a while on the Deck. After that, the launcher opens straight away.
5. For Game Mode: in Steam, *Add a Non-Steam Game* and pick the AppImage. The launcher and the game work with the Deck's controls.
Your saves, settings and memory cards live in that `CarnageHeart` folder. Updates come through the launcher's **UPDATE** page; a newer AppImage also updates the folder, keeping your saves and settings.
## Build from your own disc (developers)
You need your own Redump dump of Carnage Heart (USA): the `.cue` and all three `.bin` tracks.
```sh
git clone --recurse-submodules https://github.com/Hatdagger/Carnage-heart-recomp
cd Carnage-heart-recomp
./psxrecomp/tools/ci/build_emitters.sh
python3 psxrecomp/psxrecomp_cli.py generate --config game.toml --project-root . --disc "/path/to/Carnage Heart (USA).cue"
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DPSX_NETPLAY=OFF -DPSX_RECOMP_UI=OFF -DPSX_ENABLE_VULKAN=OFF
cmake --build build
./build/CarnageHeart_Recompiled --no-launcher --disc "/path/to/Carnage Heart (USA).cue"
```
Generation takes a few minutes and writes about 250 MB of C into `generated/`, which is not committed here. Set `CH_MOUSE_IMPL=LLE` to build the original controller routine without mouse support.
Scaffolded with the New Project Layout. See
`psxrecomp/docs/GAME_PROJECT_SETUP.md` for the full flow.
## Retro Launcher
You can run this title **standalone** (download the release zip, point it at
your disc, play), or manage installs, updates, and disc/BIOS wiring with
**[Retro Launcher](https://github.com/RetroPortingToolKit/Retro-Launcher)** —
the Retro Compilation Manager hub for self-compiling recomps.
[Downloads](https://github.com/RetroPortingToolKit/Retro-Launcher/releases) ·
[Full README & features](https://github.com/RetroPortingToolKit/Retro-Launcher#readme)
Retro checks for updates, installs the prebuilt release zips, and automates
BIOS/ROM/save plumbing so you are not stuck repeating each game’s first run by hand.
## Legal
You must own the original game. Disc images under `disc/` are gitignored and
must never be committed. Retail BIOS dumps are not redistributed and no C
derived from one may be committed; releases run on the bundled MIT OpenBIOS.
`generated/` (the recompiled game C) is **not** committed. Releases are setup kits built by the *Setup kit* workflow (`.github/workflows/setup-kit.yml`) with no disc; each player's first launch generates and compiles the game locally.
Default app icon: `assets/psxrecomp.ico` (and `.png` / `.svg`) — Retro-themed controller mark from `psxrecomp/assets/`. Windows builds embed it via `APP_ICON`.
Optional box art under `launcher_assets/img/` may come from
[libretro-thumbnails](https://github.com/libretro-thumbnails/libretro-thumbnails)
(`Named_Boxarts`); see `BOXART_SOURCE.txt` when present.
## Quick start (dev)
```bash
git submodule update --init --recursive
./psxrecomp/tools/ci/build_emitters.sh
python3 psxrecomp/psxrecomp_cli.py generate \
--config game.toml --project-root . --disc disc/.cue
git add generated && git commit -m "Regenerate game C"
# Configures, builds, and stages overlay_toolchain/ beside the runtime so
# streamed overlays can be compiled to native shards (a bare cmake build
# skips that stage and leaves every overlay gap interpreted).
python3 psxrecomp/psxrecomp_cli.py rebuild \
--config game.toml --project-root . --build-dir build-release --no-pgo
```
Official optimized Windows/Linux releases use the maintained shared builder
with the title disc available. Commit the desired `VERSION`, source and
framework pins, then run:
```bash
scripts/package_release.sh --channel public
# Use --channel playtest for a non-public package; --platform selects Windows/Linux.
```
On Windows PowerShell, use
`psxrecomp/tools/package_title_release.ps1 --channel public`. The generated
`packaging/release.toml` and player instructions define the title payload.
The shared builder owns regeneration, qualified build defaults, fresh private
PGO boot training on supported native toolchains, staging and verification.
Boot training is a build step, not gameplay qualification or a performance
claim. See `psxrecomp/docs/RELEASING_A_TITLE.md`.
The separate *Release builds* CI workflow (tag `vX.Y.Z` or dispatch) builds
committed `generated/` C without a disc on Linux, Windows and macOS. It uses
`scripts/package_prebuilt_release.sh` and attaches compiled-game ZIPs. That
explicit prebuilt path does not train selective PGO and is not the official
optimized-release command. The common builder does not add macOS support.
Studio's current Export action still uses the old prebuilt argument contract;
use the shared command above for optimized releases until Studio adopts the
recipe/channel interface. Its packager detection and `packaging/` warning also
need that adoption; the generated recipe is maintained configuration, not a
forked packager.
## Symbols
Progressive map: `symbols.toml` → `python3 tools/sync_symbols.py` →
`psx_symbols.h` (`PSX_FN_*`). See `psxrecomp/docs/SYMBOLS.md`.
## Framework pins
Submodule gitlinks (`psxrecomp`, optional `recomp-ui`, nested `recomp-net`)
are authoritative. `framework_pins.txt` is an optional scaffold snapshot;
release CI logs SHAs with `record_pins.sh` but builds whatever the gitlinks
resolve to. Bump submodules deliberately — do not float on `main`/`master`
in release CI.
---
R.A.I.D. — Retro AI Development · a Discord for AI-assisted retro reverse-engineering, decomp & recomp