Skip to content

howprice/road-fighter-msx-cpp

Repository files navigation

road-fighter-msx-cpp

A C++ and SDL transcode of the Road Fighter for the MSX (copyright Konami 1985).

alt text

Based on the disassembly at https://github.com/howprice/road-fighter-msx

Features

  • 1:1 transcode of original game logic from Z80 to C++
  • Lightweight emulation of MSX hardware (required features only):
    • Texas Instruments TMS9918A Video Display Processor
    • General Instruments AY-3-8910 Programmable Sound Generator
  • Both versions of the original game
  • Debugging windows
  • Quick save/load
  • Cheats
  • Pause and frame step

I have tried to annotate just enough of the data to make its usage clear.

Requirements

  • CMake 3.22 or higher
  • C++20 compatible compiler (MSVC, GCC, or Clang)
  • SDL3 (automatically managed via vcpkg)
  • Original MSX Road Fighter ROM (for extracting graphics)

Tested on Windows and Linux.

Linux dependencies

Install core Linux dependencies:

sudo apt-get update
sudo apt install -y build-essential curl zip unzip tar pkg-config autoconf autoconf-archive libtool ninja-build python3 python3-pip python3.12-venv libegl1-mesa-dev libxft-dev libwayland-dev

Please install all SDL3 dependencies before building for the first time. Rebuilding SDL3 later with added depenencies, may require deleting the build folder and any cached vcpkg files (see build log). e.g. "Restored N package(s) from /home/bob/.cache/vcpkg/archives"

SDL dependencies for Ubuntu 22.04 with all features:

sudo apt-get install build-essential git make \
pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev \
libaudio-dev libfribidi-dev libjack-dev libsndio-dev libx11-dev libxext-dev \
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libxtst-dev \
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev libthai-dev

Building

The repository contains two projects: asset-ripper and game.

1. Clone with submodules

The game project uses vcpkg for dependencies. Clone with:

git clone https://github.com/howprice/road-fighter-msx-cpp.git --recurse-submodules

Or, if already cloned (without submodules) run:

git submodule update --init --recursive

2. Build the projects

For convenience, build scripts (.bat and .sh) build scripts are provided in

Visual Studio users may prefer to use the accompanying gensln.bat files to generate .sln/.slnx/.vcxproj files and build and debug from within the IDE.

3. Extract graphics assets

The game requires graphics from the original game ROM. In the original game, graphics are stored compressed on the ROM and are decompressed to VRAM as required. In this remake, asset-ripper is used to decompress the data from the ROM and store as files on disk, which are loaded once at initialisation time.

To extract the graphics data:

  1. Build asset-ripper
  2. Copy your legally-owned ROM to <root>/data
  3. Extract assets by passing rom file path as first command line argument to the tool:
cd <root>/data
../asset-ripper/build/<compiler>/<config>/asset-ripper road-fighter.rom

4. Build shaders

The game uses SDL GPU for rendering, which requires locally build shaders.

  1. Clone https://github.com/howprice/SDL_shadercross_build with submodules
  2. Build SDL_shadercross_build
  3. Copy binaries:
    • Windows: Copy SDL_shadercross_build/bin/shadercross.exe to <root>/bin/Windows/
    • Linux: Copy SDL_shadercross_build/bin/shadercross and *.so to <root>/bin/Linux/
  4. Run appropriate shader build script from game/shaders/

Running

Run the game with data/ as the working directory:

cd data
../game/build/<compiler>/<config>/RoadFighter

Controls

Playing:

  • Arrow Keys / D-Pad / Left Stick: Steer
  • Space / A Button: Accelerate

Debug:

  • Tab: Toggle menu bar
  • F5: Start: Pause
  • F6: Select: Step frame (when paused)
  • S: Quick save
  • L: Quick load
  • F1: Skip stage (debug)

Access the menu bar (Tab) for game options, debug tools, display scaling, and debug windows showing emulation internals.

Legal Notice

Road Fighter is copyright 1985 Konami. This is a fan-made preservation project released for educational and preservation purposes. If Konami requests removal, this project will be immediately deleted.

This repository includes:

  • C++ transcode of game logic
  • Original game design data (level layouts, music sequences, gameplay parameters) extracted from the original ROM for preservation and educational purposes
  • Hardware emulation code (VDP/PSG)

The user must provide:

  • A legally-owned copy of the original MSX ROM, from which graphics will be extracted

This source code is provided under MIT LICENSE (see LICENSE)

Original game content remains © Konami.

About

C++ / SDL port of the MSX version of Road Fighter by Konami 1985

Resources

License

Stars

Watchers

Forks

Contributors