YsRecomp

Ys Book I & II, on PC

The 1989 TurboGrafx-CD classic, statically recompiled to run natively on Windows.

No emulator and no BIOS file: point it at your own bin/cue and play, with a widescreen-friendly display, smooth motion above 60 FPS and an options menu in the game's own style.

Ys II village on a 16:9 screen with the Fill crop and the new status bar
Windows 10 / 11 No System Card BIOS needed Keyboard and controllers Free and open source (MIT)

Features

Everything the original does, exactly as it did it, plus a PC layer drawn around the game. Every extra can be switched off in the options menu.

Launcher with the covers of Ys I & II, Ys III and Ys IV

A launcher in the game's style

Pixel starfield, the game's 8x8 letters and its own sound effects, with the covers of the three PC Engine Ys games. Ys Book I & II is the playable one.

Options menu over the game, Audio page open

Options menu in the game's own font

Esc or the controller's Menu button opens it, styled like Ys's own SELECT menu with the letters read from your disc. The game pauses; the music keeps playing.

Enemy health bar and +1 EXP +90 GOLD popup in a Ys II canal

Enemy HP bars and rewards

A small bar over the enemy you hit, and "+EXP / +GOLD" where it falls, both read from the game's own combat and reward routines.

Adol close-up with and without the visible equipment option

Equipment you can see

On the map Adol wears the sword, shield and armor you equipped, each with its own shape and colors, even in the reflection on the ice of Darm Tower. In the original he always looks the same (left: original sprite, right: with the option on).

Ys I hospital conversation with the portrait window

Scenes and windows that fit

In Fill mode, portrait scenes are shown whole with the status bar below, and the game's talk, shop and menu windows come out at 3/4 scale so they fit. Instant dialog shows the typed-out texts whole.

Close-up of the CRT shadow mask effect

CRT effects

Scanlines, Lines+mask, Slot mask, Shadow mask, Glow, Glow+mask and Glow+slot, in Normal or Bright. The mask follows your screen's resolution, and the HUD and menus get the same look.

  • No BIOS file. The 43 System Card routines the game uses were rewritten in C and checked against the real BIOS.
  • Smooth fades. The game's 7 brightness steps blend smoothly into each other.
  • Display. Fullscreen or window, resolution, refresh rate, V-Sync on or off for G-Sync/FreeSync, window size.
  • Image. Sharp or smooth filter, integer scale, TV (8:7), square or stretched pixels.
  • HUD background. Black or one of 14 dark gradients chosen to suit the gold status bar.
  • Sound. Separate volumes for CD music, chip music, effects and voices; a chip filter that removes the harsh hiss on high notes.
  • Controls. XInput and other controllers, remappable keys and buttons, two controller layouts.
  • Skip intro straight to the title menu, and pause in background when the window loses focus.
  • Portable. Settings and saves stay in the program's folder; nothing goes to AppData.

Before and after

On the console the map sits inside an ornate frame with a status panel below it. YsRecomp can keep that frame, or remove it and rebuild the status as a slim bar read from the panel cells the game writes, so the map fills a modern screen. Same frame of the game, both ways:

The original 256x224 picture with the game's frame and status panel
OriginalThe game's own 256x224 picture: frame and panel, 4:3.
The same moment in Fill mode on a 16:9 screen
FillFrame removed, map filling 16:9, new status bar: H.P with its maximum, M.P, NEXT and GOLD.
OriginalThe game's frame and status panel, as on the TV.
FullThe frame removed, with the status panel rebuilt below the map.
CompactThe map with the status bar in two rows below it.
WideCrops a little off the sides for a wider picture.
FillCrops more and fills a 16:9 screen.

Smooth motion

Ys runs at 60 steps per second, but its camera moves in an uneven rhythm: 2, 2, 2, 2 pixels and then 0, so the map shudders slightly as you walk. YsRecomp reads the camera and every character's position from the game's own tables and draws the picture between pixels, on the GPU, at your monitor's refresh rate: 120, 144, 180 Hz or more.

The game itself still runs exactly as before; only the drawing changes. The picture is about 1/60 s behind the controls, and the option can be turned off for the original 60 frames per second.

Side by side at half speed: the original scrolling rhythm and smooth motion
Ys I, walking through the field, shown at half speed. Top: original rhythm. Bottom: smooth motion.

How it was made

YsRecomp is not an emulator running the game: the game's machine code was translated to C ahead of time and compiled into the program, with a simulated PC Engine around it. The goal was to be correct first, and to prove it.

  1. Map the disc

    The game loads its code from the CD in many pieces. Its file table and loader were worked out into a disc map, so the recompiler finds all of the disc's code at once.

  2. Translate to C

    Each HuC6280 instruction becomes C that calls the same routine as the interpreter. The rare code that is not found falls back to the interpreter.

  3. Check in lockstep

    The recompiled game runs side by side with the interpreter, compared after every instruction; the interpreter was compared with the Geargrafx emulator frame by frame and sample by sample.

  4. Replace the BIOS

    The System Card routines the game calls were rewritten in C and checked at every call against the real BIOS, so no BIOS file is needed.

  5. Read it from the game

    The extras hook into what the game is doing (its windows, camera, actors, fades, status panel and rewards) instead of guessing from the picture.

43BIOS routines rewritten in C
5 billion+instructions checked in lockstep in the first Ys sessions
~0.001%of instructions left to the interpreter in long sessions
Both gamesfinished start to end on the PC version, with no BIOS
Written by an AI, directed by a player. All of the code was written by Claude (Anthropic's AI), directed and play-tested by the author, who set the goals, played the games through, recorded sessions, reported what he saw and approved each step. Every step ended with an automated test, and the recorded sessions are replayed as regression tests. The recompiler and the simulated console live in a separate project, PCERecomp; the full story is in the development log.

Download and play

  1. Download YsRecomp.zip from the Releases page and unzip it anywhere. No installation.
  2. Make a BIN/CUE image of Ys Book I & II (USA) from your own disc: one .cue and its .bin files in one folder.
  3. Run YsRecomp.exe and choose that folder. The disc is checked, and a message says what is wrong if a file is missing or the version differs.
  4. Press Run (Enter) in the launcher. Esc opens the options at any time.

Windows 10 or 11, 64-bit. The game is not included: you need your own copy.

Get the latest release

Controls

KeyboardController
D-padArrow keysD-pad
Button IXA
Button IIZB
SelectSpaceY
RunEnterX
Options menuEscMenu
FullscreenAlt+Enter

Keys and buttons can be changed in Options > Controls.

Build from source

The game's C code is generated on your machine from your own disc, and the build and tests also use your own dump of the System Card 2.0 BIOS. Neither is ever committed. You need Visual Studio 2022 Build Tools and Python 3.14; SDL3 is downloaded by CMake.

git clone --recursive https://github.com/Fabiano-Gelain/YsRecomp.git
cd YsRecomp
# your own files in roms\ :
#   Ys Book I & II (USA).cue + its .bin tracks
#   [BIOS] TurboGrafx CD System Card (USA) (v2.0).pce
.\build.ps1            # first build generates the game's C (~12 min)
.\build.ps1 -Test      # quick tests
.\build.ps1 -Package   # player package in dist\

More in the README.