VideoCore.card as shipped with RGB2RTG
======================================

VideoCore.card is the Raspberry Pi RTG (Picasso96) driver from Emu68-tools
by Michal Schulz - https://github.com/michalsc/VideoCore.card - under the
Mozilla Public License 2.0 (see ..\..\Licenses\MPL-2.0.txt).

RGB2RTG ships VideoCore 1.9 with changes by Astair86. This folder holds its
complete source, as built. The base is upstream VideoCore.card at git
e49193a with its submodules; what was changed or added is marked NOT
UPSTREAM in the source:

  - the version string comes from a generated header (as a -D define it
    does not survive cmd.exe)
  - a hardware NV12 video overlay plane for VideoCore VI (Picasso96's video
    window feature, VCMD_SET_OVERLAY) and an 8-bit CLUT overlay
    (VCMD_SET_CLUT_OVERLAY), from the PiStorm HEVC project
  - VCMD_GET_CAPS, so a program can ask what this build does
  - a write to $DFF1F2 when the display switches between RTG and native
    screens, for AGA-PISTORM (harmless everywhere else)
  - scanlines over the RGB2RTG picture: src/scanlines.c and
    VCMD_SET_SCANLINES
  - native screens switch to HDMI through unicam (CSI) only when the
    RGB2RTG kernel draws that picture (the /emu68 node's rgb2rtg-shadow
    property); with it, CSI and not inverted, whatever the monitor's
    VC4_SWITCH_METHOD and VC4_SWITCH_INVERT tooltypes say
  - with that kernel, it names its unicam display list to it (two
    command words at $DFF1E8) whenever it builds one: the kernel shows
    that list itself when a program takes the display over without
    telling the system
  - a TV border (VCMD_SET_BORDER, VC4CAP_BORDER): every plane - the
    RTG screen, the pointer, the overlays, the unicam picture (fitted
    again after unicam.resource builds it) and its scanlines - fitted
    into the display less that many percent across and down, centred,
    keeping its shape; 0 by default,
    which changes nothing. With it, SetSprite places the pointer as
    SetSpritePosition does (panning and offset), and integer scaling
    no longer divides by zero when a screen is shrunk
  - even pixels across the unicam picture with the Sharp look: where the
    horizontal scale is not a whole number, the HVS's horizontal filter
    is an area kernel (each HDMI pixel takes the Amiga pixels it covers,
    in proportion) instead of unicam.resource's nearest-neighbour one,
    so no Amiga pixel comes out a column wider than the next
    (src/scanlines.c, even_pixels and area_kernel)
  - even rows: the same down, where an Amiga line is no whole number of
    HDMI rows (4:3, Fill screen); the list keeps room for both kernels
    behind nearest's, and tells the RGB2RTG kernel so (a word at
    $DFF1E8), which computes them again where it changes the scale
    (its Crop: Auto, its interlace weave)
  - 1.6: the scanlines' shape (VCMD_SET_SCANLINES' third byte,
    VC4CAP_SCANLINE_SHAPE): Even, where an Amiga line is no whole
    number of HDMI rows, each row as dark as the part of the line's gap
    it covers, so every line gets the same darkness; or Crisp, a whole
    dark row at the end of each line, as 1.5 drew them (src/scanlines.c,
    write_mask)
  - 1.7: a CRT mask (VCMD_SET_SCANLINES' fourth byte, VC4CAP_MASK): an
    aperture grille's dark columns, a second plane next to the
    scanlines', unscaled over the whole display with a pitch of 0, so
    that one row of memory makes every line (src/scanlines.c,
    write_grille, append_planes)
  - 1.8: the scanlines, their shape and the CRT mask on the VideoCore IV
    (Pi 3) too, in its own plane layout: 13 words for the scanlines'
    plane, 7 for the mask's, behind unicam.resource's 16; and with the
    mask alone, unicam.resource's scaling kernel is moved behind the new
    END from its end, so it no longer overwrites itself (src/scanlines.c,
    append_planes, BuildUnicamDL)
  - 1.9: a third scanline shape, Whole lines (VCMD_SET_SCANLINES' shape
    2, VC4CAP_SCANLINE_WHOLE): the picture's height a whole number of
    HDMI rows for each Amiga line, its shape kept - the picture a little
    smaller, clean scanlines at low resolutions such as 800x600

The VideoCore.card in this package is 35572 bytes, CRC32 928cdcb9,
MD5 39e606391417acc6c868329b09fd5f64. Its version string reads
"VideoCore 1.9 (14.10.2026) git:b8bcc1d" - b8bcc1d is the RGB2RTG commit
that holds this source.

What is here besides the source:

  version_gen.h   the version header of this build (CMake writes today's
                  date and git state into its own copy; this one gives the
                  identical binary)

To build: with bebbo's amiga-gcc (m68k-amigaos-gcc 6.5.0b), CMake and Ninja
on the PATH, in Git Bash (Git for Windows: .buildtools\sfdc.bat runs
amiga-gcc's sfdc, a Perl script, with Git's perl), and .buildtools on the
PATH too:

  cmake -B build -S . -G Ninja -DCMAKE_SYSTEM_NAME=Generic
        -DCMAKE_C_COMPILER=<path>/m68k-amigaos-gcc -DCMAKE_BUILD_TYPE=Release
  copy version_gen.h over build\version_gen.h
  cmake --build build

build\VideoCore.card is then byte for byte the one in this package (checked
on 14 October 2026: two builds from a clean export of the source, both
identical to it).
