summaryrefslogtreecommitdiffstats
path: root/system/trs80-roms/trs80-roms.SlackBuild
blob: 79a9ff003096b06a7e41aced08e41ec5123918bb (plain)
#!/bin/bash

# Slackware build script for trs80-roms

# Written by B. Watson (urchlay@slackware.uk)

# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.

# 20230516 bkw: v20230516, add NewDOS image for Model I.

cd $(dirname $0) ; CWD=$(pwd)

PRGNAM=trs80-roms
VERSION=${VERSION:-20230516}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
ARCH=noarch

if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  exit 0
fi

TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

set -e

PKGROMS=$PKG/usr/share/trs80-roms
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
rm -rf $PKG
mkdir -p $TMP $PKGROMS $PKGDOC $OUTPUT
cd $PKGROMS

# There is no "source" directory; everything is extracted directly
# to $PKG.

# Model I: level1.rom and level2.rom
unzip -q $CWD/trs_roms.zip

# Model III and 4: model3.rom and model4.rom.
# Do not use the model4p.rom from this zip file, it won't work with
# sdltrs or xtrs.
unzip -LL -q $CWD/trs80-62.zip 'model?.rom'

# Model 4P: model4p.rom. Both emulators can actually get by without this
# (they have a built-in "hack" ROM that can boot a disk), but for
# versimilitude, let's include the real deal. This is a split MAME ROM,
# we have to combine the parts for xtrs and sdltrs.
unzip -q $CWD/trs80m4p.zip 8075332.u69 8049007.u103
cat 8075332.u69 8049007.u103 > model4p.rom
rm -f 8075332.u69 8049007.u103

# LS-DOS (not a ROM, a disk image). The zip file comment goes in $PKGDOC,
# since it's useful documentation.
unzip -q $CWD/ld4-631.zip
unzip -z $CWD/ld4-631.zip > $PKGDOC/ld4-631.txt

# 2 more disk images: cpmutil.dsk and utility.dsk. These ship with both
# sdltrs and xtrs, and are identical in both source tarballs.
tar xf $CWD/xtrs-4.9d.tar.gz --strip-components=1 --wildcards '*.dsk'

# Another disk image: a bootable DOS for the Model I.
cat $CWD/NEWDOS_80sssd_jv1.DSK > newdos_80sssd_jv1.dsk

chmod 644 *
chown root:root *

# No docs, include our own README (better than nothing).
cat $CWD/README > $PKGDOC/README
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE