MCCP — Moddable Console Capture Platform (Linux)
================================================

A low-latency viewer for a USB capture card (video + audio passthrough), with a
Steam-style overlay and a Lua modding system.

This is the FIRST Linux build. It is the same code as the Windows one, and it
has been verified this far: it builds, starts, opens its window, talks to
dasmaffin.com over HTTPS, writes its log, and unpacks mods. What could NOT be
tested is the one thing the program is for -- capture itself -- because the
machine that built it has no Linux capture device attached. If video is wrong,
that is the first place to look, and log.txt beside the binary is the thing to
send.

Requirements
------------
  - x86-64 Linux with glibc 2.38 or newer and libstdc++ from GCC 13 or newer.
    Built on Ubuntu 24.04, so: Ubuntu 24.04+, Debian 13+, Fedora 39+ and their
    relatives. On something older it will refuse to start with a message about
    GLIBC_2.38 -- that is this build being too new for the system, nothing you
    can configure.
  - A USB video capture device that appears as a V4L2 camera (/dev/video*).
    Your user must be able to read it -- on most distributions that means
    being in the "video" group.
  - Runtime libraries, all of them ordinary desktop packages: libcurl, X11 (or
    Wayland), libxkbcommon, and PulseAudio or ALSA for sound. On Debian/Ubuntu:
      sudo apt install libcurl4 libx11-6 libxext6 libxkbcommon0 libpulse0

Running
-------
  chmod +x MCCP     (once, if the archive lost the bit)
  ./MCCP

  Keep the "addons" folder next to the binary -- that is where mods live, and
  where the ones you download land. On first use the app creates "screenshots"
  and "data" folders beside it. Only one copy runs at a time, since the capture
  device is exclusive anyway.

  If it picks the wrong device (e.g. a webcam), pass the number or part of the
  name:
      ./MCCP 1
      ./MCCP Elgato

Controls
--------
  Shift + Tab    Open / close the overlay
  Esc            Close the overlay (or quit when the overlay is closed)

  That is the whole list, because everything else is a mod. Screenshots, for
  instance, are the "Screenshot keys" mod: install it from Workshop ->
  Download mods (no account needed) and P saves the picture while O saves it
  with the overlays drawn in.

In the overlay
--------------
  Options        Window mode (Windowed / Fullscreen / Borderless with a display
                 picker; changes auto-revert after 15s unless you keep them),
                 plus a Developer console toggle.
  Workshop       Everything dasmaffin.com, as its own screen: your Account,
                 Upload a mod, My mods (what is installed here), and Download
                 mods (everything published that you do not have yet -- no
                 account needed to browse or download).
  Cartridges     Mods that register games appear as cartridges along the bottom.
                 Only the selected game's mods run; click the selected one again
                 to pop it out and run none of them.

Modding
-------
  Addons live in the "addons" folder, one per subfolder:
  addons/<name>/lua/autorun/*.lua. See docs/api.html for the full Lua reference,
  including the worker API for running mod code on other cores.

  Mods downloaded from the site arrive as a single .ccmod file and are read
  from it in place -- a folder is yours, a package came from the site. To get
  the raw files out of one:
      ./ccmod-extract mymod.ccmod

Known Linux differences
-----------------------
  - Your dasmaffin.com session token is stored UNENCRYPTED in settings.json.
    On Windows it is sealed with DPAPI, which has no portable equivalent yet,
    so the file is instead created readable by your user only (chmod 600).
    Sign out if you would rather it were not on disk at all.
  - Capture goes through V4L2. A card that only ships a proprietary Windows
    driver will not appear.
