Digimon Digital Card Battle: the PC port

ddcb-pc_port is a native PC port of Digimon Digital Card Battle for Windows and Linux that rebuilds the game's executable from decompiled C code.

README

Digimon Digital Card Battle: the PC port

Note

This is a fork for a PC port. The matching decompilation is the work of juandav at ReGame-Labs/dcb_decomp, and this fork exists with its author's agreement. It adds a native PC port built from the same C on psxstack, the stack behind the Digimon World 2003 port. Decompilation work belongs upstream; their README follows the port's part of this page, unchanged.

Note

AI disclosure. The port is built with heavy use of AI: most of its code, tools, tests and documentation were written by AI coding agents (Anthropic's Claude, through Claude Code), directed and checked by a human maintainer. The result is verified mechanically: the PlayStation build must stay byte-identical to the original, and the port is replayed against an emulator by the reference tests. The decompilation itself is juandav's work.

A native PC port of Digimon Digital Card Battle (PlayStation, USA, SLUS-01328) for Linux and Windows. The decompiled C rebuilds a byte-identical copy of the game's executable and overlays, and the same C, compiled for your PC, runs the game natively, with a launcher and optional mods.

Important

This repository contains no game data. You need your own copy of the game: the port reads everything from your disc image. This project is not affiliated with or endorsed by Bandai, Bandai Namco or Sony.

Contents

Playing the PC port

Supported platforms
PlatformState
Linux x86_64 (glibc 2.39 or newer: Ubuntu 24.04, Fedora 40, Debian 13, or later)Supported
Windows 10 or newer, 64-bitSupported; tested under Wine so far, not yet on real Windows
macOSNot planned yet
Download

Open the Releases page and download the latest package for your system. The .debug file and the -debug.zip are the programs' debug info for crash reports; they are not needed to play. SHA256SUMS and SHA256SUMS-windows hold the checksums (sha256sum -c SHA256SUMS).

Linux: dcb-<version>-x86_64.AppImage (v0.1.0's is dcb-0.1.0-linux-x86_64.AppImage). Make it executable and run it:

chmod +x dcb-*x86_64.AppImage
./dcb-*x86_64.AppImage

The AppImage opens the launcher, which holds the game and its mods. Nothing needs installing or compiling. If your system cannot mount AppImages, run it with --appimage-extract-and-run.

Windows: dcb-<version>-windows-x86_64.zip. Unzip it anywhere (its files must stay together: the launcher finds the game beside itself) and run dcb-launcher.exe. The programs are not signed, so Windows may show a SmartScreen warning the first time: choose "More info", then "Run anyway".

Provide your disc image

The game is read from your own disc image of Digimon Digital Card Battle (USA), SLUS-01328:

  • It must be the raw .bin + .cue dump (one MODE2/2352 track, 215,661,936 bytes), SHA-1 b3945b3e76c1fcc554a7614e2b4211d974990105. Dumping tools such as Redump-style rippers produce this format.
  • Other releases (the Japanese and the European discs) are not accepted by the port yet.

In the launcher's Disc screen choose the .cue (or the .bin), drag it onto the window, or type its path. The launcher checks the SHA-1 once and remembers the disc; then press Play. The launcher hides while the game runs and comes back when it ends.

Settings, controls and saves
  • Video, Graphics (the renderer, its resolution, the filters), Audio, System (memory cards, updates, Steam), Controls (keyboard and gamepad rebinding, hotkeys) and Mods are the launcher's other screens.
  • Keyboard defaults: arrows the D-pad, X cross (confirm), C circle, Z square, S triangle, Enter START, Backspace or right Shift SELECT, Q and E L1 and R1, 1 and 3 L2 and R2; P pauses, F11 toggles fullscreen, F5 and F9 save and load a quick save state. A gamepad works as on a PlayStation (south button cross, east circle; the left stick is the D-pad too). A second gamepad can be player 2 (the Controls screen's Gamepad tab), for versus duels and trades.
  • The in-game menu: Escape (or Back+Start on a gamepad) pauses the game and opens the same screens in its window, applied live.
  • Fast-forward (hold Tab, 4x) and Faster loading are mods, off until you switch them on in the Mods screen: fast-forward is the way through the two-minute opening movie, which cannot be skipped, as on the PlayStation.
  • Filters (the GPU renderer): one for the duel field and the menus (sharp by default), one for the polygon battles and the fusions.
  • Updates: from the version after v0.1.0 the launcher checks this repository's latest release when it starts (one request to GitHub, through the system's curl; nothing about you is sent) and offers to update itself. Turn it off on the System screen, or start it with --no-update-check.
  • Steam: Add to Steam on the System screen adds the launcher as a non-Steam game (its artwork is a placeholder for now).
  • Where things are kept: ~/.local/share/dcb/ on Linux ($XDG_DATA_HOME/dcb/), %APPDATA%\dcb\ on Windows: settings.json, the memory cards card1.mcd and card2.mcd (the same format as PCSX-Redux's, so a card moves between the port and the emulator), logs/last-run.log (the last game run's output) and crashes/ (crash reports). A portable.txt file beside the launcher keeps all of this in the launcher's own folder instead.

Details: docs/PORT.md "Running it", and psxstack's launcher/README.md.

What works

The port is a work in progress. What the reference tests cover, replayed against the original in an emulator: the boot, the opening movie, the title, registering a new player, choosing a starter and the tutorial duel to its end; saves written by the port load in the emulator and the other way round; the sound reproduces the emulator's sound-chip writes. The rest of the game runs but is less tested; the deck editor, fusion and the ending are being brought under test. The current state in words is docs/STATUS.md.

Reporting an issue

Found a bug, a crash, or something that plays differently from the original? Please open an issue. A useful report has:

  • the version (the package's file name, or the commit you built) and your system (distribution or Windows version, desktop, GPU, gamepad);
  • what happened and what you expected, ideally compared with the original game on a PS1 or an emulator;
  • steps to reproduce from a new game or a save (attach the memory card from the settings directory if it helps);
  • the output: after an error the launcher's Play screen shows the exit status and the game's last lines, with a Copy button; on Windows, the matching crash-<date>.dmp from the crashes folder if there is one;
  • screenshots or a short video when it is visual.

Please check the open issues first, and never attach the game's files or a disc image. Questions about the code are welcome as issues too. A problem in the decompilation itself belongs to upstream.

Developing the port

The port lives in files of its own: port/ (the game side of psxstack's contract: port/CMakeLists.txt, the adapter and game.json in port/game/, the tools in port/tools/), scripts/, tests/, packaging/, docs/ and the psxstack submodule (clone with --recursive, or git submodule update --init psxstack). Upstream's files carry only the port's hooks, under #ifdef PC_PORT, and the PlayStation build stays byte-identical (scripts/build.sh ends with every binary OK).

scripts/setup.sh                      # once: submodules, binutils, Python venv, upstream's deps (dump your disc as "Getting the game files" says below)
scripts/setup.sh disc sdl             # the disc image as disks/us/dcb_us.bin + .cue; SDL3, DXC and Dear ImGui at psxstack's pins
scripts/build.sh                      # the PS1 build: every binary byte-identical
scripts/probe.sh                      # the port's configure and the host-compile probe over every unit (no disc)
scripts/port_build.sh --sdl           # the window build, build/port-sdl/dcb, and its input self-test
build/port-sdl/dcb --disc disks/us/dcb_us.cue --window --memcard1 build/card1.mcd   # play
scripts/launcher_build.sh             # build/launcher/dcb-launcher and its self-test
.venv/bin/python tests/port/run.py    # the port replays the emulator's pad scripts (tests/replay/) and compares the records
scripts/setup.sh windows && scripts/build_windows.sh --test   # the Windows cross-build, tested under Wine
DocumentContents
docs/STATUS.mdWhere the port stands
docs/PORT.mdHow the port works: the plan, running it, releases, what the game needs, sound, testing
docs/DECISIONS.mdHow the fork works and why
docs/THIRD_PARTY.mdCredits and everything borrowed from other projects
psxstack's docs/GAME_CONTRACT.md, docs/PORT.md, docs/RUNTIME.mdThe stack: what a game supplies, how the runtime and the launcher work

Work items are the issues. Pull requests about the port go to this fork; changes to the decompilation go upstream, under its CONTRIBUTING.md. Our own work is under the same MIT licence as the decompilation.


Everything below is upstream's README, kept as it is so that upstream merges stay easy.

Digimon Digital Card Battle decomp

|---|---|---|---| | πŸ‡ΊπŸ‡Έ USA (SLUS_013.28) | Code | Data | Functions | | πŸ‡―πŸ‡΅ Japan (SLPS_025.06) | Code | Data | Functions | | πŸ‡ͺπŸ‡Ί Europe (SLES_039.00) | Code | Data | Functions |

Executable Overlays

Build Platform Versions Compiler Fake matches | hacks License

A matching decompilation of Digimon Digital Card Battle for the PlayStation: C source that compiles back into byte-identical copies of the game's executable and of its overlays. The USA, Japanese and European releases are all fully matched, code and data, from the same source tree.

This repository does not contain any game data. You need your own copy of the game to build it.

Progress map

Each rectangle is a module, sized by its code; green means it matches. Click it for the details on decomp.dev.

Status

Every version is at 100 % of its code and 100 % of its data:

VersionExecutableOverlaysGame functionsCodeData
us (SLUS_013.28)506 / 506864 / 8641,370 / 1,370100 %100 %
jp (SLPS_025.06)531 / 531660 / 6601,191 / 1,191100 %100 %
eu (SLES_039.00)506 / 5061,092 / 1,0921,598 / 1,598100 %100 %
  • Every function of the game, in the executable and in the overlays, is C that compiles to the original bytes. No INCLUDE_ASM or INCLUDE_RODATA is left in the game's code.
  • Jump tables, strings and constants live in the C of the function that uses them. Tables and globals are written in C in the module that defines them. Each overlay's zeroed data is laid out in its <prefix>_bss.c.
  • Code that was written in assembly stays as assembly source, with a comment saying what shows it is hand-written. Examples are the task switching and interrupt glue (src/main/startup.s), the soft-float routines (src/main/libmath.s) and some PsyQ objects.
  • Functions and globals carry descriptive names taken from the evidence: the strings they use, the SDK calls they make, and the data they touch. The versions share their names.
  • The PsyQ 4.7 libraries linked into the USA executable are decompiled too, one file per library object. They are not the game's code, so they are left out of the progress. The 71 PsyQ functions still in assembly are mostly BIOS call stubs and register-level code, plus a few near misses. In jp and eu the libraries, the start-up code and the soft-float routines are still splat's disassembly.

Progress is measured by objdiff with one unit per module. It is tracked on decomp.dev, which comments on every pull request with what it changes.

Fake matches and hacks

The matched C is meant to read as natural C, but some spots only match through a form that natural C wouldn't take for granted. Each one carries a comment that says so, in one of three standard forms (CONTRIBUTING.md has the rules), and the badge above counts them: fake matches, then the other two kinds together.

KindCountMarker
Fake matches8a comment that starts with /* fake match: and says what is forced and why
Unused frame locals96/* unused, but it is in the original stack frame */
Form-dependent matches36a comment that says the match depends on the form
Functions still in assembly71INCLUDE_ASM
  • A fake match is the last resort: a form forced only for the code it makes, such as an empty do {} while (0) that ends a CSE block or a variable that exists only to shape the code.
  • An unused frame local, such as the char buf[72] of several window draw functions, is a local that the code never touches, kept because the original's stack frame has room for it: without it, the frame is smaller than the original's.
  • A form-dependent match is C that matches in one of several equivalent forms only: a statement macro whose do {} while (0) weighs a variable's uses, an extra block, an if kept on one line or without braces, a copy of a variable, a type, or the form of a loop that each version's compiler needs.
  • The functions still in assembly are not in the badge. They are all PsyQ's, in src/main/psyq/, and out of the progress.

tools/hacks.py --list lists every one with its file, line and function, and also the code that was written in assembly, which is not a hack (src/main/startup.s, src/main/libmath.s and some PsyQ objects, as .s files), and the padding that some objects have after their data, written as a top-level __asm__.

The CI checks with tools/hacks.py --check README.md that the badge and the table above are up to date. Work to replace them with natural C is ongoing: a pull request that matches one of them without the forced form is welcome. TODO.md lists them with the rest of what is left to polish.

The game's binaries

The executable loads one overlay at a time from P.DRV, at the end of its own .bss (OVERLAY_AREA, 0x801DDF38 in us). Each overlay has its own splat config, source folder and symbol prefix. The USA release's:

BinaryPrefixSourceWhat it runs
SLUS_013.28src/main/the engine: tasks, rendering, models, windows and text, the card database, the duel loop, the scripts
OPENSEGOPEN_src/openseg/the title screen and movies, user registration and the starter deck, memory card saves, friend battles and trades
SAISEGSAI_src/saiseg/the areas and world map, opponent selection, area scripts, the hacking screen, Digi-Parts and rewards
SUBSEGSUB_src/subseg/the deck editor (base and auto decks, sorting, naming) and the partner screen
EVOSEGEVO_src/evoseg/card fusion and its results and rewards, the partner status, the cutscenes
KAWSEGKAW_src/kawseg/the duel's rules: hands, bonuses, the CPU opponent, the tutorial, the duel menu and HUD, results, prizes and EXP
SUGSEGSUG_src/sugseg/the 3D battle: its scene, camera and HUD, and the effect scripts behind every attack
ENDSEGEND_src/endseg/the player records screen shown by the ending and the menu

The Japanese release has two overlays that the USA one doesn't, and no OPENSEG or EVOSEG. The European release has all nine, its INTSEG and NISSEG from a Japanese debug build (How the versions are organised):

BinaryPrefixSourceWhat it runs
INTSEGINT_src/intseg/jp's new-game intro, where Babamon asks for the player's name and birthday and hands over a starter deck
NISSEGNIS_src/nisseg/jp's title screen,