GUN BALL RECOMP
===============

A native PC port of Data East's 1992 arcade game Gun Ball (the Japanese version of Nitro Ball). The arcade board's
own 68000 program, decompiled into C ahead of time and run on a model of the board: the same game as the arcade,
frame for frame, its slowdown, picture and sound included. Not an emulator, not a remake.

This package contains no game data. You need your own copy of the arcade ROM set, as MAME has it:
gunball.zip and its parent set nitrobal.zip.

https://github.com/alexgbor/GunBall-Recomp


FIRST RUN
---------

Windows: unzip the package somewhere you can write to (not inside Program Files) and run gunball.exe. Windows may
say "Windows protected your PC" because the program is not signed: More info, then Run anyway.

Linux (x86-64, glibc 2.35 or newer: Ubuntu 22.04, Debian 12, Fedora 36, SteamOS 3 and later): unpack the .tar.gz
somewhere you can write to and run ./gunball from its folder. It bundles its own SDL2 (libSDL2-2.0.so.0 beside it)
and works on X11 or Wayland, with PulseAudio, PipeWire or ALSA. MP4 recording uses ffmpeg if installed.

The first time, a window asks for the ROM set: drag gunball.zip and nitrobal.zip onto it (both at once, or one after
the other). The game copies them into a "rom" folder beside it and finds them there from then on. Merged and split
MAME sets both work, and a folder of the set's loose files too; the files are known by their contents (CRC-32),
not their names.


CONTROLS
--------

                    Keyboard                        Gamepad
  Move (P1)         Arrows                          Left stick or D-pad (pad 1)
  Shot (P1)         Z or Left Ctrl                  A or X
  Ball (P1)         X or Left Alt                   B or Y
  Coin 1            5                               Back
  Start 1           1                               Start

  Player 2          R F D G, A (Shot), S (Ball)     Second gamepad
                    6 (Coin 2), 2 (Start 2)
  Player 3          I K J L, U (Shot), O (Ball)     Third gamepad (enable 3 PLAYERS in DIPs)
                    7 (Coin 3)

  Menu              Esc or F1                       Right stick pressed, or Guide
  Pause             P or Pause
  Save state        F5          Load state   F7     Next slot   F6
  Reset the board   F3
  Full screen       F11 or Alt+Enter
  Record a video    F12

Every control can be changed in the menu (CONTROLS) or in gunball.ini.


THE MENU
--------

Esc pauses the game and opens the menu:

  SAVE STATE, LOAD STATE   the whole board in one of 8 slots (Left, Right: choose slot)
  PRACTICE                 jump directly to any of the 5 stages (Combat Field, Strange Football, Ghost Town,
                           Aliens World, Space Station) with custom starting lives and balls
  REPLAYS                  the games you kept, played again frame for frame (Delete, then Enter: delete one)
  GAME OPTIONS             the board's DIP switches (lives, difficulty, 2 or 3 players, coinage, demo sounds,
                           flip screen), speedrun timer, high scores, replays, and automatic update checks
  PICTURE AND SOUND        3:4 vertical monitor or square pixels, scaling, sharp or smooth, TATE CRT look
                           (SCANLINES, ARCADE, PVM), full screen, side panels, F12 recording mode, volume
  CONTROLS                 keyboard and gamepad bindings for up to 3 players
  ACCURACY                 "MAME 1:1" (the board as MAME 0.289 models it) or "BOARD" (real PCB mode)

On a wide window or screen, side panels beside the vertical picture show the live score, hi-score, credits, P1/P2/P3
lives and bombs, speedrun timer, input visualizer, slowdown meter and hotkeys; the right panel explains the menu's
options while it is open.

The speedrun timer (left panel) starts when a game begins and counts the board's exact 58 Hz frames, so slowdown is
included just like on the arcade PCB while pauses and the menu are not.

At each game over the game asks whether to keep its replay (KEEP REPLAY, DROP REPLAY).


UPDATES
-------

As it starts, the game checks GitHub for a newer release (only the release check is sent). If there is one, the
menu offers it first (UPDATE V...): it downloads, verifies, installs the new files in place and restarts, keeping
your settings, high scores, save states, replays and ROM set. GAME OPTIONS > AUTO UPDATES turns the check off (or
check_updates in gunball.ini). The version you have is in the window title and at the top of the menu.


FILES THE GAME KEEPS (beside the program)
-----------------------------------------

  gunball.ini     settings, each with a comment (deleting it restores defaults)
  gunball.hi      high score persistence between sessions
  rom/            your ROM set, as dropped onto the window
  states/         save states (slot1.state .. slot8.state)
  replays/        replays you chose to keep (.inp)
  *.mp4, *.avi    videos recorded with F12


VIDEOS (F12)
------------

F12 starts and stops a recording, named by date and time, beside the program. By default it records a shareable
H.264 + stereo AAC MP4 of what the window shows, including the TATE CRT look and the side panels (16:9 at 1080p or
1440p; or vertical picture alone when panels are off), at the board's 58 frames a second in board time (pauses and
the menu leave nothing in the file).

PICTURE AND SOUND > RECORDING chooses: 1080P, 1440P (sharper pixels on YouTube) or BOARD AVI (lossless uncompressed
240 x 320 RGB24 + 55,937 Hz stereo PCM directly from the board).

Windows encodes MP4 natively via Media Foundation (nothing extra to install). Linux uses ffmpeg if installed.


CREDITS
-------

Gun Ball / Nitro Ball is (c) 1992 Data East Corporation. This is an unofficial fan project, not connected with or
endorsed by the rights holders.

The board model follows MAME's dataeast/rohga.cpp (Bryan McPhail) and its devices (deco146.cpp, deco16ic.cpp,
decospr.cpp, decocrpt.cpp, h6280, okim6295: Nicola Salmoria, David Haywood, Bryan McPhail and the MAME team);
the YM2151 sound chip follows Aaron Giles's ymfm. SDL2 provides the window, audio and controller support. Their
licenses are in the licenses folder.
