KAMO
KAMO = Kirby & The Amazing Mirror + Online
The game recompiled to run natively on PC, with online co-op for up to four players.
> [!IMPORTANT]
> KAMO does not include the game. You need your own legally dumped ROM of **Kirby & The Amazing
> Mirror (USA)**; no BIOS is needed. KAMO is an unofficial fan project, not
> affiliated with, endorsed or sponsored by Nintendo or HAL Laboratory. Kirby and all related
> names are trademarks of their respective owners.
## About
Kirby & The Amazing Mirror was built around four-player co-op, but playing it that way has always
meant four Game Boy Advance systems, four cartridges and link cables. KAMO brings the game to PC
and replaces the link cable with the internet: create a room, invite your friends or open it to
everyone, and explore the Mirror World together.
The game's machine code is translated to C++ ahead of time from your own ROM (static
recompilation with [GBARecomp](https://github.com/mstan/gbarecomp)) and runs natively; there is
no CPU emulator. The Game Boy Advance hardware around it (graphics, sound, timers, link cable) is
reproduced by the GBARecomp runtime.
## Status
| | |
|---|---|
| Single player | โ
Playable |
| Online co-op, 2 players (public and private rooms) | โ
Tested between two PCs |
| Online co-op, 3โ4 players | ๐งช Testing: no port to open (direct ICE links, 0.6.0); not yet played between real PCs |
| LAN / Direct IP rooms, 2โ4 players, no sign-in | ๐งช Testing: not yet played in a real match |
| Continue an online match | โ
|
| Installer and automatic updates | โ
|
| Coverage of every level, boss and sub-game in multiplayer | ๐จ In progress |
| macOS and Linux builds | ๐งช Testing: build from source, untested |
See the [roadmap](docs/ROADMAP.md) for details.
## Playing
1. Download `KAMO-Setup-.exe` from the
[latest release](https://github.com/OmegaElMegadivo/KAMO/releases/latest) and run it. It asks for your
ROM once: only the USA release, SHA-1 `274b102b6d940f46861a92b4e65f89a51815c12c`, is accepted,
and KAMO only remembers where the file is. (A portable zip is there too; it asks for the ROM
the first time it starts.) There are no macOS or Linux downloads yet: build KAMO from source
([Building](#building)) and start `./KAMO`.
2. KAMO opens on its menu: **Play alone**, **Play online** or **Options**.
3. In the game, **F1** or **Esc** (or a stick click, L3 / R3, on a gamepad) opens the game menu: display
and sound options, the keyboard and gamepad buttons, save states and the shortcuts, alone and
online. **Back to main menu** there, or closing the window, returns to KAMO's menu. Every menu
works with a gamepad too (B goes back).
4. Keys: arrows move, **Z** is A (jump), **X** is B, **C** / **V** are L / R, **Enter** is Start,
**Right Shift** is Select. On a gamepad the d-pad or the left stick moves.
**16:9 screens.** The game was made for the GBA's 3:2 screen, so full screen on a 16:9 monitor
leaves bars at the sides. **Options > Display and sound > Stretch to fill the screen** removes
them, alone and online (each player chooses for their own screen): the picture gets wider and
shows no more of the level.
**Picture.** **Options > Display and sound > Image filter**: Sharp pixels (the original look),
Smooth, or HQ2x, HQ3x and HQ4x, which round off the edges of the pixel art and use more CPU.
Online, each player picks their own.
**Graphics card.** The processor draws the game; the graphics card only scales the picture to the
window. On a PC with two (most gaming laptops) KAMO asks for the dedicated one. **Options >
Display and sound > Graphics card** shows the one in use and lets you pick the integrated one or
none; a change applies the next time KAMO starts.
Each time its menu opens, KAMO checks for a new version and updates itself after checking the
download's size and SHA-256 against the release: an installed copy runs the new installer, a
portable copy (the zip) swaps its own files for the new ones and opens again. Your settings, ROM
path, saves and sign-in stay as they are. It also works from
[RecompLauncher](https://github.com/elripalda/RecompLauncher): the release zip carries a
`recomplauncher.json`, and the launcher hands KAMO the ROM and installs the updates. On macOS and
Linux KAMO does not check for updates: download new versions from the
[releases](https://github.com/OmegaElMegadivo/KAMO/releases) page, or build them from source.
### Online
1. **Play online**. The first time, sign in with Discord (the lobby server needs it; KAMO
remembers it). Then create a room (public, or private with a password) for
two to four players, or join one from the list.
2. Everyone presses **I'm ready**; the host presses **Start match**. In the game choose
**Start Game > Multi Player**; player 1 confirms.
3. To stop, open the menu (**F1**, **Esc** or a stick click) and choose **Save and leave**, or
close the game window: the online match is saved and the next one goes on from there
(see **Your progress** below). The menu does not pause the match, and Esc never leaves it.
If a player stops answering, the others see **Waiting for player N** over the game; after 20
seconds the match ends. In rooms of three or more, the host's **Start match** waits until every
player reaches the host's PC. `netplay\online.log` and `netplay\crash.log` in KAMO's folder say
what went wrong.
In the room, players can **chat**, the host wears a **crown**, and a **Connection** line says
whether the host's port is open and which players reach it.
**LAN / Direct IP.** The button at the bottom right of **Play online** switches to rooms without
the lobby server or a sign-in, for two to four players. Rooms on your network are listed; friends
elsewhere type the host's address under **Join by address**, and the host forwards UDP port 7777
on the router. Windows Firewall on the host must let KAMO in, and on each PC that should list
LAN rooms; otherwise type the host's address.
**Your Kirby.** Pick your Kirby's colour in **Options > Your Kirby**: every player in the match sees
your Kirby in it. Names above the Kirbys are there too, as a beta (off by default).
**Input lag.** With **Automatic** (the default) the match starts from the room's pings and then
adjusts the delay by itself while you play. A number in **Options > Online** fixes it instead:
lower responds sooner, higher stutters less. Press **F** while playing online to see the
connection (lag, delay, margin, rollback) and what a frame costs your PC.
**Speed.** Every PC runs the consoles of every player, so the match goes at the pace of the
slowest PC: a frame lasts 16.7 ms, and a PC that needs more for three or four consoles slows
everyone down. The **F** line marks that PC as **slow**; closing other programs, plugging the
laptop in and the Sharp pixels filter help. A slow PC no longer raises the input delay.
**Your progress.** Alone and online share one save: every match starts from each player's
single-player save, and each saved match writes your console's save back to it (**Options > Online >
Copy my online progress to my single-player save**, on by default), if that save is still the one
the match started from. The previous file is kept as `.before-online.bak`.
**Where saves go.** Your game and save-state slots are in the `saves` folder inside KAMO's folder
(`saves\kirby-amazing-mirror.sav`, `saves\states\`). A save that sat next to the ROM from an older
version is copied there the first time. Uninstalling asks whether to delete them; by default they stay.
**When something fails**, KAMO says what happened and what to do, with an error code, and keeps a
log of the room and the match in `netplay\online.log` next to `KAMO.exe` (`netplay/online.log`
on macOS and Linux; send it with a bug report).
Everyone needs the same KAMO version and the same ROM, and a match saved with one KAMO version can
only be continued with that version.
How online play works is described in [docs/MULTIPLAYER.md](docs/MULTIPLAYER.md).
## Building
See [`recomp/README.md`](recomp/README.md) (Windows, Linux and macOS). The build recompiles your
own ROM locally; nothing generated from it is committed.
## Project layout
| Path | Contents |
|---|---|
| `recomp/` | The game host and KAMO's menu, the game configuration (`game.toml`), KAMO's patches to GBARecomp, its recomp-net and recomp-ui, installer and package files |
| `external/gbarecomp` | GBARecomp: recompiler and runtime (submodule) |
| `external/recomp-ui` | recomp-ui: online lobby backend, in-game menu, Dear ImGui (submodule) |
| `tools/` | Build script with a RAM watchdog, the test suite and the packaging script (`.ps1` for Windows, `.sh` for Linux and macOS) |
| `docs/` | Multiplayer design and roadmap |
## Contributing
Bug reports and pull requests are welcome; see [CONTRIBUTING.md](CONTRIBUTING.md). Keep game
content out of the repository: no ROMs, BIOS files, saves, save states, extracted assets, code
generated from the ROM, or screenshots of the game.
## Credits
- [GBARecomp](https://github.com/mstan/gbarecomp) by Matthew Stanley, used under the PolyForm
Noncommercial License 1.0.0, with its components
[arm-recomp-core](https://github.com/mstan/arm-recomp-core),
[recomp-net](https://github.com/RetroPortingToolKit/recomp-net) and
[rbengine](https://github.com/RetroPortingToolKit/rbengine) (MIT). KAMO also carries
recomp-net 0.1.12's LAN room module, unchanged (`recomp/patches/recomp-net-0002-lan-room.patch`).
- [libjuice](https://github.com/paullouisageneau/libjuice) by Paul-Louis Ageneau (MPL-2.0),
built into recomp-net unchanged: the ICE links that connect online players with no port to open.
- [hqx](https://github.com/grom358/hqx) by Maxim Stepin and Cameron Zemek (LGPL-2.1-or-later),
included in GBARecomp: the HQ2x/HQ3x/HQ4x image filters, shipped as the separate, replaceable
`gbarecomp-hqx.dll` with its source.
- [recomp-ui](https://github.com/mstan/recomp-ui) (MIT): the online lobby, the in-game menu and its
copy of [Dear ImGui](https://github.com/ocornut/imgui) (MIT), used for KAMO's menu.
- [Inno Setup](https://jrsoftware.org/isinfo.php): builds the installer.
- [KNID](https://github.com/sweatyeggs69/KNID) by sweatyeggs69 (MIT): KAMO versions up to 0.1.x
were built on it.
- [SDL](https://libsdl.org) and [zlib](https://zlib.net).
Full license texts are in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
## License
KAMO's own sources are released under the [MIT License](LICENSE). Builds include GBARecomp and
are therefore limited to noncommercial use (see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)).