XCOTA TAG v4.1 four-player (preview) -- 2v2 tag teams for X-Men: Children of the Atom (CPS-2)
===========================================================================================

New in v4.1
-----------
- Fixed a reset after a knockout while a team had both X-Men on screen (see the two-player
  package's README; testers saw it on Genosha and Mutant Hunting).
- Keep the name xmcota4p.zip. v4's installer said to rename it, and renamed it loads as the
  two-player game, where ports 3 and 4 get nothing. The installer's closing text now says so.
- On Windows you don't need to run this installer yourself: the XCOTA TAG RetroArch download
  carries it. Put your clean xmcota.zip next to PLAY XCOTA TAG 4P.cmd and double-click it: it
  makes xmcota4p.zip, copies the core into RetroArch and starts the game with it.
Start from your clean xmcota.zip: the installer refuses a file already patched with v4.

What it is
----------
The XCOTA TAG v4.1 game (see the two-player package's README) for four people: P1 and P3
against P2 and P4, each X-Man on its own controller.
- P1 and P2 pick their side's first X-Man, P3 and P4 the second. Each fighter keeps its
  owner's controller through tags, team supers, Cross Over Fever, COMBO BREAKERs and
  knockouts.
- There are no Start or Coin buttons, so the game runs in free play: a fresh HP+HK is a
  Start for that player's side (to join, or to challenge the CPU). In a fight between
  humans HP+HK keeps its meaning (tag; with QCF or QCB at Level Max, team super or Cross
  Over Fever).
- A 1P to 4P marker sits over every human-owned X-Man.
- Six colours: the button each player confirms a pick with picks that X-Man's colours (LP
  the game's own, LK/MP/HP/MK/HK Marvel vs. Capcom 2's LK/HP/A1/HK/A2).

Where it runs
-------------
The XCOTA TAG RetroArch core (in the XCOTA TAG RetroArch download). It has the four-player
game "xmcota4p" built in, on Windows and Linux, and builds on macOS from its source folder.
RetroArch's own FinalBurn Neo and FB Alpha 2012 cores cannot run it ("Romset is unknown"). Four
pads on one computer, four people online through Parsec (the host runs RetroArch, three
guests connect), or RetroArch netplay. The core's README walks through each.
Stock emulators (MAME, stock FBNeo, Fightcade) only read two players for this game.

Supported set
-------------
  xmcota     Euro 950331 (the MAME parent), clean and unmodified; non-merged or merged,
             with or without xmcota.key. The clones are not supported by this build.

How to patch
------------
Windows:      drag your clean xmcota.zip onto xcota-tag-v4.1-4p-preview.cmd
              (or let PLAY XCOTA TAG 4P.cmd in the RetroArch download run it for you)
macOS/Linux:  python3 xcota_tag_4p_patch.py /path/to/xmcota.zip
It writes xmcota4p.zip and a receipt beside your ZIP: the name the XCOTA TAG core loads.
Keep that name. For RetroArch netplay everyone makes their own from a clean
xmcota.zip: the file comes out the same.

Controllers (the core's RetroPad layout)
----------------------------------------
  Y LP   X MP   L HP   B LK   A MK   R HK   L2 LP+MP+HP   R2 LK+MK+HK
  Ports 1 and 3 are one team, 2 and 4 the other.
The game itself reads the native CPS-2 four-controller profile of the Cross Fever
four-player builds (P1 IN0 low byte, P2 IN0 high, P3 IN1 low, P4 IN1 high; MK on the Start
lines, HK on the Coin lines), so a CPS-2 board wired for four works the same way.

What is in this package
-----------------------
  xcota-tag-v4.1-4p-preview.cmd  Windows installer (runs the embedded PowerShell script)
  xcota_tag_4p_patch.py         the same patch in Python 3.8+
  xcota_tag_v4.1_4p.spec.json   the patch itself: hashes, replacement bytes and offsets
No ROM data is included: the new code (26,419 bytes in the 05 program ROM, which was empty
there, with the two-player build's colour tables), short jumps in the 03 program ROM, and the
HUD and platform tiles of the two-player build.

How it was tested (and what was not)
------------------------------------
- The four-player build, one script in MAME (the four-controller wiring emulated at the input
  ports) and in Fightcade's FBNeo core built with the four-controller profile, on this
  installer's xmcota4p.zip: four picks, P1's Cross Over Fever, each stick moving only its own
  X-Man, P2's tag bringing P4's X-Man in. Diagnostic: the gauges are poked full.
- The XCOTA TAG RetroArch core: on Linux it loads xmcota4p.zip and every button and direction
  of all four ports reaches the game with no cross-talk. The Windows core does the same under
  Wine 9 in a small test host (not RetroArch).
- The PLAY XCOTA TAG 4P launcher, under Wine 9's cmd with a stand-in retroarch.exe.
- Installer gate: the layouts through the Python patcher and the installer's own PowerShell
  code (PowerShell 7.4.6 on Linux) give the MAME-tested build's members; every refusal case
  writes nothing. The count is in RELEASE-4P.json.
- Not tested: the Windows core and the launcher on a Windows PC, Parsec and netplay sessions
  with four people, four physical controllers on a CPS-2 cabinet, Windows PowerShell 5.1.
