Virtua Fighter 2 Recomp

Virtua Fighter 2 Recomp is a native PC port of Virtua Fighter 2 that recompiles the game's program to native code and supports higher resolutions and smoother frame rates.

README

Virtua Fighter 2 Recomp

Virtua Fighter 2 Recomp

Virtua Fighter 2 (SEGA, arcade, Model 2, 1994) as a native PC game: the game's own i960 program, recompiled to native code, with render scales up to 6x, widescreen and smooth motion at any refresh rate.

Latest release Licence: MIT Platforms

Play · Download · Trailer · Status · Controls · Report a bug

Virtua Fighter 2 Recomp at 3x: fights on five stages and the widescreen player select

Watch the trailer
The online trailer (click to watch on YouTube)

Important

No game files are included: no ROMs and nothing made from them. You need your own dump of the game as MAME's vf2 set (vf2.zip, Version 2.1). It is read on your computer, and the game's program is recompiled there each time it starts. An unofficial fan project, not made, approved or supported by SEGA, and not affiliated with it.

About

Virtua Fighter 2 Recomp runs the game's own program, for the board's Intel i960 CPU, recompiled to native code (ARM64 or x86-64) from your ROM each time it starts, and checked instruction for instruction, cycle for cycle against MAME's i960 interpreter. Only the i960 program is recompiled: the rest of the Model 2A board (the TGP geometry processor, the geometrizer and polygon renderer, the System 24 tile layers, and the sound board's 68000 and SCSP) runs on code from MAME, inside an SDL 3 host. At 1x you get the arcade's frames and sound as MAME makes them (pixel for pixel on Apple silicon; on x86-64 a few texels a frame round differently, the renderer's multiply-adds not fused); above it, render scales up to 6x, widescreen and ultrawide, and smooth motion at your screen's refresh rate.

Status

AreaState
The i960 program, recompiled to native codeWorking
TGP, geometrizer and renderer, tile layers, sound boardWorking: they run on MAME's code
Render scale up to 6x, widescreen and ultrawide, smooth motionWorking
Menu, keyboard and gamepads, two players, the arcade's settingsWorking
macOS, Windows, Linux / Steam DeckWorking
Android (arm64)Experimental: see android/README.md
The 3D drawn on the GPU (Display > Quality > 3D renderer: Auto, GPU or CPU)Working on macOS (Metal), Windows (Direct3D 12 or Vulkan) and Linux / Steam Deck (Vulkan): the same picture as the CPU's, checked when the game starts; Auto uses the GPU unless it's clearly slower, and any difference or error falls back to the CPU
Stereo reverb (the sound board's DSP)Working: wide stereo, as on the cabinet (fixed in v0.1.2)
Portable mode, your own ROM folderWorking
Random fighters (Menu > Cheats): three of the cast made one, for a player or every computer opponentWorking (new), online too (Online > Settings > Your fighter)
Secret characters (Menu > Cheats): Dural, MUE and KOJACWorking
Fight switches for practice (Menu > Cheats > Fight switches): infinite energy, one-hit KO, no time limit, a tiny or huge ringWorking (new), offline only
The arcade's debug mode (Menu > Arcade settings > Debug mode): CPU load, polygon count, hits, and its debug menuWorking (new), offline only
A stage select for a versus (Menu > Arcade settings > Stage select): the stage two players' first fight is on, the arcade's order on from itWorking (new), offline only
Online playExperimental: rollback netplay, a random opponent or a friend by room code, no setup (see Online play)

Random fighters

vf2random

Menu > Cheats > Player 1 fighter (and Player 2 fighter):

  • Random: a new fighter every game, made of three of the cast: its head, body and limbs from the three, and its moves dealt from them a move group at a time (its Punch moves one's, its Kick moves another's, its throws a third's, and so on), so it plays like a mix of them, at the game's own timings. Its stance is the first's and its voice one of theirs, and it gets a name made of theirs on the energy bar (JACPAIWOLF, LIJACPAI).
  • Textures: every part is drawn in its own fighter's textures and their colours, as on that fighter: Jacky's vest, Kage's wraps, Pai's and Lau's patterns, belts, boots and bare feet beside its head's face and hair.
  • Colours: new every game (not part of a seed). A random fighter wears its head's colours, so its face, hair and skin are right and its skin is one tone all over; its clothes' main colour is turned round the colour wheel, or given a theme: cool, warm, two opposite colours, neon, pastel, black and white, black and gold. Its hair (and headband, hood) is given a hue of its own, as in VF1 Recomp, in the fight and on its select portrait; Shun's white hair and Dural's chrome stay as they are. Belts and shoes keep their colours (VF2 shares those between its fighters).
  • Seed: type a fighter's name, as seen on an energy bar, to get that fighter again: the same build and the same moves on any machine. A name is the same fighter in every game that has it: VF1 Recomp's 337 names are here with their recipes (the same three, head, voice and moves by group), then VF2's own with Lion or Shun, 678 in all (docs/SEEDS.md; Random draws from the whole book). VF3 Recomp carries this book on in turn (docs/random_book.txt, vf2random --recipes).

Anything but Normal is picked for you at the select, as in VF1 Recomp: playing alone, or with both players random (offline or online), the select is skipped (who you got is a surprise as the fight comes in); beside a player on Normal, it shows, the Normal player picks as ever and the random one is picked at once: its portrait is its head's, and no name is shown under it. A challenger's select doesn't pick again for a player already in, whose portrait is their random fighter's own head and hair in its colours. The attract shows random fighters too: each side whose player has one (Random: new ones each time the demo fight comes round; a Seed: that fighter), or every side with Random opponents, in the intro's scenes and the demo fights (with Random opponents, a new one as each scene brings in another fighter). A random fighter's time in the ranking shows its name (kept in ranking_names.txt beside the backup). As a match's first round comes in, each random fighter is built on screen during the camera's sweep: its parts from the feet up, polygon by polygon, each a white flash as it lands, grey until all are on, then its colours sweep up the same way before READY (drawing only: online, both screens show the same). Random opponents makes every computer opponent a random fighter, made afresh for each match (not your own fighter's mirror match). Changing them restarts the game.

Online, your fighter is Online > Settings > Your fighter (Normal, Random or Seed, as here), whichever side you play: your opponent sees it as the match starts (RANDOM, or the seed's name), and both machines make the same fighters from the match's own seed (Random's draws and the colours), in step through every rollback. Random opponents stay offline (online, no one plays the computer). Your fighter no longer splits players: Random, room codes and addresses meet everyone on this version or later, each player with their own choice (Normal against Random is fine). Against an older version, the match plays as that version would: one with a random fighter plays its random fighters' match, one on Normal plays Normal fighters on both sides (said as the match starts), so players of v0.1.16 still play you.

How it works. VF2 loads a fighter by its number from tables: its record (its body's 16 parts, skeleton, sizes, textures), its faces, its commands, its voices. A random fighter is a record of its own, its parts taken from the three fighters' records, and the tables pointed at the three's entries: player 1's is made in MUE's place (fighter 11) and player 2's in KOJAC's (12), which the select never gives, and the player's pick is changed to it as the VS screen comes up. The commands are a dispatch on the buttons pressed, each to a program of checks ending in a move; moves are numbered for the whole game, so a random fighter's dispatch can send each button to a different fighter's program. A side's colours are loaded by the fighter's number: one instruction of the game's now reads them from the fighter's record, each of the cast's records naming its own, and the colour tables are moved to tables of their own, an entry a number, so a random fighter has colours of its own: its head's, recoloured. A side's textures are one fighter's set, every fighter's in the same places on the side's texture sheet, so a random fighter's sheet is put together a 32 x 32 tile at a time: each tile from the fighter whose texture is there (its head's where no other's is), a texture that would land on another's moved to a free place with its models' texture headers, and its rows of detail colours put in rows its head doesn't use. The sets' blocks are decoded by the game's own decompressor, run on an i960 of its own, and written to texture RAM as the side's set finishes loading, so nothing more is loaded than for any fighter. The game's code is otherwise untouched, and every byte changed is put back when they're off.

Android

An experimental arm64 Android port lives in android/. It builds with Gradle and the NDK, needs Android 8.0 or newer and your own vf2.zip (no game files are included), and is not part of the desktop build. Random fighters and Online's Play by address work; the lobby and room codes work too, through the port's own libcurl (pinned in tools/android/deps.sh), with the lobby's address given at build time as on the desktop (.lobby-url/VF_LOBBY_URL, none by default: a build without one plays by address). It asks for the INTERNET permission (no prompt) for that. See android/README.md for build, install and controls.

Secret characters

Menu > Cheats > Secret character puts a fighter the arcade never let you pick in Akira's spot on the player select, for either player: Dural, the final boss, or MUE and KOJAC, two unused fighters still in the game's code. Changing it restarts the game.

How it works. VF2's fighters are numbered in its code: Akira 0 to Shun 8, Dural 9, Lion 10, and, after him, MUE 11 and KOJAC 12, which the arcade's select never offers. The player select turns a slot into a fighter from a table (Akira's slot is fighter 0); the reads that set the fighter now take Akira's slot from a copy of that table with the secret character in it, while the reads that draw the name and profile keep the original. So the game loads the secret character exactly as it loads anyone else: their own model, moves, voice and health bar name, for either player, in any mode.

The secret characters in action at 2x: Dural, MUE and KOJAC on five stages, and Dural's portrait on the player select

The cast's select portraits, and Dural, MUE and KOJAC below

CharacterSelect screenHealth barNotes
DuralHer own portrait (the game's own); Akira's name and profileDURALComplete: the final boss's model and moves, the chrome body, a darker one on player 2's side
MUELion's portrait; Akira's name and profileAKIRALion's body in a black vest, with Akira's moves and voice but Lion's stance and walk
KOJACLion's portrait; Akira's name and profileJACKYLion's body in a white vest, with Akira's moves and voice but Lion's stance and walk

They take Akira's place, so Akira can't be picked while one is on; the computer's own fighters, Dural at the end of arcade mode included, are unchanged. MUE and KOJAC are off while a player's fighter is Random or Seed (those are made in their places).

The arcade's own Dural code works too, the arcade way (Menu > Game > Play style): on Version 2.1 (the default), hold Start while you pick any fighter. The PC way, Start is a tap, so a pick confirmed or a menu closed with Start never turns into Dural by accident; Cheats > Secret character gives him there. Holding Up while you pick gives that fighter's other costume, the one player 2 wears in a mirror match.

Who they are
  • Dural: the final boss of Virtua Fighter and Virtua Fighter 2, a silver cyborg who fights with a mix of the cast's moves. The arcade never let you choose her outright; the select's table even has an eleventh, hidden slot for her, and the game carries a select portrait for her too.
  • MUE and KOJAC: two fighters numbered after Lion, named MUE and KOJAC in the game's fighter lists (KOJACKY in its test menu). The Cutting Room Floor found them in the game's debug mode: Lion's first costume with a different vest (black for MUE, white for KOJAC), Akira's moves and voice, and Lion's idle and walking animations. They may have been debug test characters, or placeholders for fighters that were planned and never made.

Play

From the latest release, or the site:

SystemDownload
macOS 11+ (Apple silicon and Intel)VirtuaFighter2Recomp-mac.zip
Windows 10 or 11 (64-bit)VirtuaFighter2Recomp-windows.zip
Linux / Steam Deck (x86-64)VirtuaFighter2Recomp-deck.tar.gz
Linux on ARM (ARM64: a Raspberry Pi 5; Ubuntu 22.04, Debian 12, Raspberry Pi OS bookworm or newer), unpacked and run as the x86-64 Linux oneVirtuaFighter2Recomp-linux-arm64.tar.gz

Mac and Windows

  1. Unzip it (Mac: move Virtua Fighter 2 Recomp to Applications; Windows: the VirtuaFighter2 folder anywhere, not inside Program Files).
  2. Open it (Windows: VirtuaFighter2.exe).
  3. Choose your vf2.zip when it asks. A copy is kept, so you only do this once.

Steam Deck

  1. Copy the download to the Deck (e.g. Downloads) and unpack it there: in Desktop Mode, right-click it in the file manager > Extract > Extract archive here. (Unpacking on Windows, or copying the folder through a USB stick, can lose the files' permissions, and then nothing launches.)
  2. Put your vf2.zip in the VirtuaFighter2/roms folder.
  3. Desktop Mode: Steam > Games > Add a Non-Steam Game to My Library > Browse, set the file type filter to "All files", pick the vf2 file in the VirtuaFighter2 folder, Add Selected Programs. In its Properties, set Start In to the VirtuaFighter2 folder (e.g. /home/deck/Downloads/VirtuaFighter2/), and under Compatibility leave "Force the use of a specific Steam Play compatibility tool" off: it's a native Linux game, and Proton stops it launching.
  4. Back in Game Mode, launch it from your Library with the default Gamepad layout.

The Windows download also runs on the Deck under Proton (add VirtuaFighter2.exe instead, with Proton forced on), but the native Linux build above is the one to use.

On another x86-64 Linux PC: unpack it anywhere, put vf2.zip in its roms folder and run VirtuaFighter2.sh.

Portable mode: put a file named portable.txt next to the program (Windows: beside VirtuaFighter2.exe; Mac: beside the app, in the same folder) and the game keeps everything in that folder: settings, saves, screenshots, log.txt and the copy of your vf2.zip (in its roms folder), with nothing in your user data folder (%APPDATA%, ~/Library/Application Support). The Linux / Steam Deck build keeps everything in its folder already.

Your own ROM folder (e.g. Batocera's /userdata/roms/ports/vf2, or any folder an update won't touch): start the game with --roms <folder> (or --roms=<folder>), set the environment variable VF2_ROMS, or add roms_folder = <folder> to settings.ini; the command line wins, then VF2_ROMS, then settings.ini. ~ is your home folder, and a relative path in settings.ini is from its folder. The game looks there first for vf2.zip and only reads it (no copy is kept anywhere else); log.txt names the folder it used. If the zip isn't there, the log says where it looked and the game carries on as without the option; a zip you then choose with the file picker is copied into your ROM folder, so the next start finds it there. Examples: Windows VirtuaFighter2.exe --roms "D:\ROMs\vf2"; Mac open "Virtua Fighter 2 Recomp.app" --args --roms ~/ROMs/vf2; Linux / Batocera ./VirtuaFighter2.sh --roms /userdata/roms/ports/vf2.

Note

The Mac and Windows builds aren't signed. On macOS, open it once, close the message, then System Settings > Privacy & Security > Open Anyway. On Windows, if SmartScreen warns, choose More info > Run anyway.

Controls

Change them in the menu (Esc, or View / Select on a pad).

KeyDoes
↑ ↓ ← →Player 1: move
Z X CPlayer 1: guard, punch, kick
1Player 1: start
I J K LPlayer 2: move
B N MPlayer 2: guard, punch, kick
2Player 2: start
5 6Coins (Arcade play style)
EscMenu (see Menu): display, sound, game, arcade settings, online, controls, cheats, quit
PPause
F3Reset (not in an online match)
F4Free camera (see below)
F5 / F6Render scale / picture shape
F9Frame timings
F11, F or Alt+EnterFullscreen
F12Screenshot
Tab (held)As fast as it goes
F2 / 9The arcade's test and service buttons (in its test menu, Down and Start do too)

Gamepad (Xbox layout): d-pad or stick to move, X guard, A punch, B kick, Y guard + punch (throws), RB punch + kick, LB guard + kick, RT all three, Start to start. View (tap), L3 + R3 or the touchpad click opens the menu (Menu can be moved in Controls); View + LB / RB change the render scale / picture shape, View + R3 is the free camera. In Arcade mode, set Coin in Controls (View works) for a coin button.

Arcade sticks the game doesn't know (DirectInput sticks such as HORI's Virtua Stick High Grade or the Astro City Mini) get a fighting s