RGB2RTG 0.76-1, made from its repository's commit 674746fc98cb380e76e8725e3abf60a20e1d9a6b.

The RGB2RTG kernel is Emu68 1.1.0-beta.1 (https://github.com/michalsc/Emu68,
git 0ba3a899341dee958332a4182911861420b03bff, MPL-2.0) with
kernel/emu68-rgb2rtg.patch applied and kernel/rgb*.c/h and core/ added.


HOW TO BUILD IT, STEP BY STEP
-----------------------------
On Ubuntu 24.04 - a Linux PC, or WSL on Windows. Every line below that
starts with two spaces is typed in a terminal. There are three parts, each
built on its own; build only the ones you need (the command alone: steps 1
to 4).

  the kernel, for the Pi        kernel/build.sh
      -> build/out/Emu68-rgb2rtg.gz (Pi 4), Emu68-rgb2rtg-pi3.gz (Pi 3)
  the rgb2rtg command (Amiga)   tools/rgb2rtg/build.sh -> build/out/rgb2rtg
  the HDMI driver for AHI       tools/ahi/build.sh
      -> build/out/rgb2rtg-hdmi.audio and its mode file RGB2RTG-HDMI

1. The tools (once):

  sudo apt update
  sudo apt install build-essential git cmake ninja-build xxd device-tree-compiler python3 make wget lhasa libgmp-dev libmpfr-dev libmpc-dev flex bison gettext texinfo libncurses-dev autoconf rsync libreadline-dev gcc-14-powerpc-linux-gnu g++-14-powerpc-linux-gnu

2. The Amiga compiler: bebbo's amiga-gcc, in /opt/amiga, where the build
   scripts look for it (once; it takes 30 to 60 minutes):

  sudo mkdir -p /opt/amiga
  sudo chown $USER /opt/amiga
  git clone https://github.com/bebbo/amiga-gcc ~/amiga-gcc
  cd ~/amiga-gcc
  make update
  make all -j4
  make sdk=ahi

   (The last one adds AHI's headers - only the AHI driver needs them.)

3. This source: unzip the zip. RGB2RTG/ is where everything is built, so
   go there (here it was unzipped in the home folder):

  cd ~/RGB2RTG

4. The rgb2rtg command. build/out/rgb2rtg then goes into C: on the Amiga.

  sh tools/rgb2rtg/build.sh

5. The HDMI driver for AHI:

  sh tools/ahi/build.sh

6. The kernel.

   a) Arm's own compiler, the Arm GNU Toolchain 15.3.rel2 for big-endian
      AArch64 (once). It has to be this one: GCC 14.2 miscompiles
      big-endian vector code, and the Pi 3 kernel came out broken. On
        https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads
      find 15.3.rel2, host x86_64 Linux, target "AArch64 GNU/Linux
      big-endian", and download
        arm-gnu-toolchain-15.3.rel2-x86_64-aarch64_be-none-linux-gnu.tar.xz
      into your Downloads folder. Then unpack it where kernel/build.sh
      looks for it:

  mkdir -p ~/toolchains/armtc-15.3.rel2
  tar -xf ~/Downloads/arm-gnu-toolchain-15.3.rel2-x86_64-aarch64_be-none-linux-gnu.tar.xz -C ~/toolchains/armtc-15.3.rel2

   b) Emu68's source at the commit RGB2RTG is built on (once). In
      RGB2RTG/, where kernel/build.sh takes it from third_party/Emu68:

  git clone https://github.com/michalsc/Emu68 third_party/Emu68
  git -C third_party/Emu68 checkout 0ba3a89
  git -C third_party/Emu68 submodule update --init

      Or the Emu68 source archive instead: RGB2RTG-0.5-emu68-src.tar.gz
      (published with RGB2RTG 0.5, and again with 0.6 - the
      first one had CRLF line endings and the patch did not apply to it).
      Unpack it and put EMU68=<its folder> in front of the commands in c).

   c) The kernels. The first build needs the internet: cmake downloads the
      Raspberry Pi firmware.

  bash kernel/build.sh
  PI=3 bash kernel/build.sh

      The first is the Pi 4's kernel, the second the Pi 3's (and the Pi
      Zero 2 W's). Each ends with a "VER :" line naming RGB2RTG 0.76-1.

If something fails:
  "missing: the Arm GNU Toolchain"     6a's tar went to another folder
  "m68k-amigaos-gcc: not found"        step 2 did not finish, or it is not
                                       in /opt/amiga
  "devices/ahi.h: No such file"        step 2's make sdk=ahi is missing


MORE
----
driver/VideoCore.card/src/messages.h is VideoCore.card's message format
(Emu68-tools, MPL-2.0). The RTG driver's complete source, and how it is
built, are in the zip's VideoCore.card/ folder (its README.txt). The
package's VideoCore.card is built from it; there is no need to build it
again.

The config.txt edits are tested on the PC:
  gcc -DHOST_TEST -o setuptest tools/rgb2rtg/setup.c
  ./setuptest tools/rgb2rtg/tests/config-*.txt

tools/mkpackage.py makes the release; it is not needed for building (it
also needs package/icons and package/files from the repository).
