# Virtual Pro Wrestling 2: Recompiled
Virtual Pro Wrestling 2: Recompiled is a project that uses
[N64Recomp](https://github.com/N64Recomp/N64Recomp) to **statically recompile** the
Nintendo 64 game *Virtual Pro Wrestling 2 - Ōdō Keishō* (Japan) into a native PC
port, running on the
[N64ModernRuntime](https://github.com/N64Recomp/N64ModernRuntime) with
[RT64](https://github.com/rt64/rt64) as the rendering engine. It is the sixth and
final N64-era project in the AKI wrestling recompilation family, after
[WCW vs. nWo World Tour: Recompiled](https://github.com/jessetbh/WCWvsNWOWorldTourRecomp),
[WCW/nWo Revenge: Recompiled](https://github.com/jessetbh/WCWnWoRevengeRecomp),
[WWF WrestleMania 2000: Recompiled](https://github.com/jessetbh/WWFWrestleMania2000Recomp),
[Virtual Pro Wrestling 64: Recompiled](https://github.com/jessetbh/VPW64Recomp),
and [WWF No Mercy: Recompiled](https://github.com/jessetbh/WWFNoMercyRecomp),
sharing their runtime stack and conventions. VPW2 is VPW64's sequel and sits
between WrestleMania 2000 and No Mercy on the same engine, so those two projects
are this one's closest references.
### **This repository and its releases do not contain game assets. The original game is required to build or run this project.**
> **Status: beta.** The game boots, renders at high resolution, plays music and
> sound effects at full quality, takes keyboard and gamepad input (two controllers
> verified) through the menus and full matches with clean post-match transitions,
> and cartridge SRAM saves persist automatically. See
> [Known Issues](#known-issues) for what's still rough.
## Table of Contents
* [System Requirements](#system-requirements)
* [Features](#features)
* [Known Issues](#known-issues)
* [FAQ](#faq)
* [Mods and ROM Hacks](#mods-and-rom-hacks)
* [Building](#building)
* [Libraries Used and Projects Referenced](#libraries-used-and-projects-referenced)
* [Special Thanks](#special-thanks)
## System Requirements
Currently a **Windows** build is targeted; other operating systems may be supported
later.
A GPU supporting Direct3D 12.0 (Shader Model 6) or Vulkan 1.2 is required. A CPU
supporting the SSE4.1 instruction set is also required (Intel Core 2 Penryn series or
AMD Bulldozer and newer).
## Features
Live today, matching the sister projects:
* Plug and play — assets load directly from your ROM, no extraction step
* Hardware-accelerated high-resolution rendering through RT64 with the original
N64 visual effects intact
* Widescreen support
* In-game config menus with full input rebinding for keyboard and controller
* Default mappings tailored to the AKI control scheme (d-pad movement, analog taunts)
* Multiplayer with multiple controllers
* Cartridge SRAM save emulation with automatic persistence
Planned:
* High framerate support (frame interpolation) later, pending the family's
matrix-group work
* Linux support
* Mod support — the natural home for the community English translation
## Known Issues
* Rumble and Controller Pak behavior have not been through a full verification
pass yet.
* Continuous integration is still being wired up for this repository.
* The port runs the original Japanese game; there is no built-in translation
(see the FAQ).
## FAQ
#### What is static recompilation?
Static recompilation is the process of automatically translating an application from
one platform to another — here, the game's original MIPS machine code is translated
into C and compiled for modern PCs. For details, see
[N64Recomp](https://github.com/N64Recomp/N64Recomp). **This is not an emulator and not
a decompilation.**
#### How is this related to a decompilation project?
This port is an independent effort, separate from the
[AKI-Club VPW2 decompilation](https://github.com/AKI-Club/vpw2) — no code or
symbol names from that project were used in this port's development. Unlike
most recompilation ports, which borrow symbol names from a decomp, this
project generates its own symbol metadata from scratch via a
[splat](https://github.com/ethteck/splat) disassembly (see `disasm/` and
`syms/`), transferring libultra identifications from its sister projects
WWF No Mercy and WWF WrestleMania 2000 by machine-code fingerprinting.
Credit where due: the AKI-Club decomp team has done years of groundwork
mapping VPW2's internals, and we expect to draw on their documentation as
mod support for this port develops — with attribution, of course.
#### Which ROM does it use?
This project is **only** a port of Virtual Pro Wrestling 2, and it only accepts one
specific ROM: the Japanese release *Virtual Pro Wrestling 2 - Ōdō Keishō* (NA2J,
SHA1 `82DD25A044689EAB57AB362FE10C0DA6388C217A`). VPW2 was never released outside
Japan, so there is only one cartridge revision. Fan-translation patched ROMs are
**not** accepted as the game ROM (their hashes differ), but several run as patch mods on
top of the clean ROM: see [Mods and ROM Hacks](#mods-and-rom-hacks).
**It is not an emulator and it cannot run any arbitrary ROM.**
#### The game is in Japanese — will there be a translation?
The port runs the original Japanese game. Community English translations can be
installed as patch mods made from your own patched ROM: see
[Mods and ROM Hacks](#mods-and-rom-hacks).
#### Where is the savefile stored?
- Windows: `%LOCALAPPDATA%\Vpw2Recompiled\saves\`
VPW2 saves to the cartridge's battery-backed SRAM (256 Kbit, confirmed during
bring-up — the ROM contains no flash driver); the port persists the save image to
disk automatically. Configuration files and the log file live one level up in the
same app folder.
#### Can you run this project as a portable application?
Yes — place a file named `portable.txt` in the same folder as the executable and
saves, config files, and the stored ROM will be kept next to the executable instead.
## Mods and ROM Hacks
This port loads mods in the `.nrm` format used by the N64: Recompiled projects.
#### Installing a mod
Copy the `.nrm` file into the game's mods folder and start the game:
- Windows: `%LOCALAPPDATA%\Vpw2Recompiled\mods\` (or `mods\` next to the executable in portable mode)
New mods are switched on by default. Builds with the in-game **Mods** menu (Settings → Mods)
can also install mods there (**Install Mods**, or drag the file onto the window) and switch
them on and off. Mods are applied when the game starts, so restart after changing them. To
remove a mod, delete its file.
#### ROM hacks as patch mods
A ROM hack can run as a *patch mod*: a mod that holds only a patch against the stock ROM. The
game applies it to your own ROM when it starts, and any game code the hack changes is
recompiled on the fly. It works for hacks that:
- are built on the same ROM this port uses (see the ROM's SHA1 above), and
- change code only inside the game's existing functions (data changes of any size are fine).
Hacks that rebuild or move the game's code, or are made for another revision, need a full
recompile and can't run as patch mods. Only one patch mod can be on at a time; each one keeps
its own saves in `saves\\`, apart from the stock game's.
To make one from a hack ROM you have patched yourself (both ROMs must be big-endian `.z64`):
```
python tools\romhack\make_patch_mod.py --base vpw2.z64 --hack my_hack.z64 --game-id vpw2 --id my_hack --name "My Hack" --out my_hack.nrm
```
Run it from a checkout of this repository after building. It reports what the hack changes
and refuses hacks that need a full recompile; see [tools/romhack/README.md](tools/romhack/README.md).
Patch mods can contain the hack's and the original game's data, so **don't share patch mods
you don't have the rights to**: make your own from your own ROMs.
Known results for VPW2:
- Work as patch mods: *Virtual Pro Wrestling 2 - Freem Edition*, *All-Japan Pro Wrestling 64* (Beta 3), the *[English Patched]* translation, the *English Beta 3 (rey)* translation, *Virtual Pro Wrestling 2 (Unlocked)* (everything unlocked).
- Need a full recompile: the *(English Patch)* release that rewrites code across functions (the game refuses it at start with "Invalid ROM patch").
## Building
See [BUILDING.md](BUILDING.md).
## Libraries Used and Projects Referenced
* [N64Recomp](https://github.com/N64Recomp/N64Recomp) — the static recompiler this
port is built with
* [N64ModernRuntime](https://github.com/N64Recomp/N64ModernRuntime) — the modern
runtime (ultramodern + librecomp)
* [RT64](https://github.com/rt64/rt64) — the rendering engine
* [RecompFrontend](https://github.com/N64Recomp/RecompFrontend) — launcher, config
menus, and input stack
* [RmlUi](https://github.com/mikke89/RmlUi) for building the menus and launcher
* [lunasvg](https://github.com/sammycage/lunasvg) for SVG rendering, used by RmlUi
* [FreeType](https://freetype.org/) for font rendering, used by RmlUi
* [SDL2](https://www.libsdl.org/) for windowing, input, and audio
* [moodycamel::ConcurrentQueue](https://github.com/cameron314/concurrentqueue) for
semaphores and fast, lock-free MPMC queues
* [Gamepad Motion Helpers](https://github.com/JibbSmart/GamepadMotionHelpers) for
sensor fusion and calibration algorithms
* [DirectX Shader Compiler](https://github.com/microsoft/DirectXShaderCompiler),
[zstd](https://github.com/facebook/zstd),
[nativefiledialog-extended](https://github.com/btzy/nativefiledialog-extended), and
[plume](https://github.com/renderbag/plume) via RT64
* [splat](https://github.com/ethteck/splat) / spimdisasm for the disassembly that
produces this project's symbol metadata
* [Inter](https://rsms.me/inter/), [Noto Emoji](https://fonts.google.com/noto), and
[PromptFont](https://shinmera.com/promptfont) fonts (OFL; PromptFont license in
`assets/promptfont/`)
* [SDL_GameControllerDB](https://github.com/gabomdq/SDL_GameControllerDB) for
community controller mappings
* [WCW vs. nWo World Tour: Recompiled](https://github.com/jessetbh/WCWvsNWOWorldTourRecomp),
[WCW/nWo Revenge: Recompiled](https://github.com/jessetbh/WCWnWoRevengeRecomp),
[WWF WrestleMania 2000: Recompiled](https://github.com/jessetbh/WWFWrestleMania2000Recomp),
[Virtual Pro Wrestling 64: Recompiled](https://github.com/jessetbh/VPW64Recomp),
[WWF No Mercy: Recompiled](https://github.com/jessetbh/WWFNoMercyRecomp),
[Bomberman Hero: Recompiled](https://github.com/RevoSucks/BMHeroRecomp), and
[Zelda64Recomp](https://github.com/Zelda64Recomp/Zelda64Recomp) as reference
projects for structure and conventions
## Special Thanks
* [Wiseguy](https://github.com/Mr-Wiseguy) and
[DarioSamo](https://github.com/DarioSamo) for creating N64Recomp and RT64.
* [RevoSucks](https://github.com/RevoSucks) and the Bomberman Hero: Recompiled
project, the template for this port's sister projects and therefore for this one.
* The Zelda64Recomp team for establishing the conventions the whole recomp ecosystem
follows.
* ethteck and the splat/spimdisasm contributors — the disassembly tooling that made a
no-decomp recompilation possible.
* [AKI-Club](https://github.com/AKI-Club/vpw2) — for their long-running VPW2
decompilation work.