Virtua Tennis - Recompilation

Virtua Tennis - Recompilation is a native PC port of Virtua Tennis and Virtua Tennis 2 for Windows and Linux that supports native 16:9 widescreen.

README

VIRTUA TENNIS - RECOMP

A static recompilation of Virtua Tennis (Sega NAOMI, 1999) and Virtua Tennis 2 (Sega NAOMI, 2001) for Windows and Linux. Both games run from the same program, chosen in a launcher menu. Made by Pocket_lucho with Claude. Leer en español

The games' SH-4 machine code is translated ahead of time into C++ (one function per basic block) and compiled to native code. The rest of the NAOMI hardware (PowerVR2 graphics, AICA sound, Maple/JVS input, cartridge) is provided by a fork of Flycast. It shares its base with VIRTUA NBA - RECOMP.

If you want to support me: https://buymeacoffee.com/pocket_lucho

What you need

  • Your own cartridge romsets (MAME naming), one or both:
    • Virtua Tennis / Power Smash: vtennis.zip
    • Virtua Tennis 2 / Power Smash 2: vtenis2c.zip
  • The NAOMI BIOS (naomi.zip): only for the first start of each game and region, to create a boot snapshot. After that, the games boot straight to the SEGA logo without it.
  • Windows 10/11 x64, or Linux x86_64 (glibc 2.35+, e.g. Ubuntu 22.04 or newer).

No game code, graphics, sound or BIOS is included in this repository or in the releases. The recompiled code is generated on your PC from your own ROMs (see below).

Getting started (Windows)

  1. Download the release zip and extract it.
  2. Copy vtennis.zip and/or vtenis2c.zip to roms\ and naomi.zip to data\.
  3. Run BUILD_GAME.bat (once). It
    • downloads the free llvm-mingw compiler (180 MB, first time only, checked by SHA-256),
    • runs each game you have up to its entry point and decodes its program into C++ (a few seconds per game),
    • compiles everything into vt_game.dll (5–20 minutes depending on the CPU),
    • deletes the generated sources.
  4. Run VirtuaTennis-Recompiled.exe, choose a game and press PLAY. Tab / the Settings menu opens the options.

If you add the other game later, run BUILD_GAME.bat again.

Getting started (Linux x86_64)

Download VirtuaTennis-Recomp-linux-x64.tar.gz, extract it, copy the ROMs and the BIOS as above, then run ./build_game.sh once (needs g++ and make: sudo apt install build-essential) and ./VirtuaTennis-Recompiled.

Features

  • Native performance (recompiled code, no JIT), cycle-exact fallback for anything not precompiled.
  • Game launcher: Virtua Tennis and Virtua Tennis 2 in one program.
  • BIOS-free boot from a snapshot, one per BIOS region (Japan, USA, Export, Korea), region selector.
  • Native 16:9: the game camera renders the real wide view (net, players, umpires and crowd stay visible at the edges) while the HUD and the menus keep their 4:3 proportions. The title screen is stretched, the other 2D screens are pillarboxed with stretched edge pixels.
  • FXAA antialiasing (DirectX 11 / OpenGL) on top of supersampling (internal resolution).
  • Built-in cheats (in-game menu → Cheats, off by default):
    • Rival can't score: the secret rivals (Master in Virtua Tennis, King in Virtua Tennis 2) appear when the Arcade mode is cleared on Normal without losing a game and without continues; this cheat makes that easy.
    • Start every game at 40.
  • Spanish and English UI (plus Flycast's other languages), reduced menus, Reset button.
  • Online play through Flycast's GGPO rollback netcode (experimental; both players need the same build, the same romset and the same widescreen setting).

How the legal distribution works

The releases only contain the engine (a modified Flycast, GPL v2) and the builder. The parts that come from the game are produced on the user's PC from the user's own files:

PartWhere it comes from
Recompiled game code (vt_game.dll / libvt_game.so)Generated by BUILD_GAME.bat / build_game.sh from your ROMs
Boot snapshots (data/<romset>_boot_<region>.state)Created at the first start from your ROM and your naomi.zip
Graphics, sound, music, textRead at run time from your ROM

vt/builder/seeds_*.txt only list addresses of code entry points (numbers, no code), used to guide the decoder.

Releases

Pushing a tag v* runs .github/workflows/release.yml, which builds both packages (vt/tools/package_windows.sh, vt/tools/package_linux.sh) and publishes them as a GitHub release.

Building from source

git clone --recursive https://github.com/PocketLucho/Virtua-Tennis---Recompilation
cd Virtua-Tennis---Recompilation
# Windows package (engine + builder), cross-compiled from Linux:
LLVM_MINGW=/path/to/llvm-mingw-20251104-ucrt-ubuntu-22.04-x86_64 vt/tools/package_windows.sh
# Linux package (see the script header for the apt dependencies):
vt/tools/package_linux.sh

Other targets:

  • Libretro core for testing: cmake -B build-lr -DLIBRETRO=ON && ninja -C build-lr. The headless test frontend is vt/host/lr_headless.cpp.
  • Developer build with the blocks linked in (no DLL): generate the sources (VNBA_GENERATE=<dir>, see vt/builder/build_game.ps1) and configure with -DVNBA_AOT_DIR=<dir>.

Technical documentation: vt/docs/TECHNICAL.md. Development log (Spanish): vt/docs/STATUS.es.md.

Legal

  • This project is licensed under the GNU GPL v2 (inherited from Flycast, see LICENSE). Flycast's original README is kept as README.flycast.md.
  • It contains no copyrighted material from Sega: no ROM, BIOS, graphics, sounds, music or translated game code. The recompiled code and the boot snapshots are generated locally from the user's files and must not be redistributed.
  • "Virtua Tennis", "Power Smash", "SEGA" and "NAOMI" are trademarks of their owners; they are used only to describe what this software is compatible with. This project is not affiliated with or endorsed by them.
  • This is not legal advice. Dumping your own cartridge is the only way to obtain the ROM legitimately.