summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2021-10-24 15:35:04 -0400
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2021-10-29 17:07:23 +0700
commit7ae7eadf4890496619033b60115d4ca647134dfb (patch)
tree59ef821817ff2cdda9b7c137068f32094a6e1653
parent3f79fb0e0a819514b05af78680ef571168aaad32 (diff)
downloadslackbuilds-7ae7eadf4890496619033b60115d4ca647134dfb.tar.gz
games/jzintv: Fix -current build, allow ROMs in pkg.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--games/jzintv/README20
-rw-r--r--games/jzintv/README_ROMs.txt50
-rw-r--r--games/jzintv/extract_roms.sh73
-rw-r--r--games/jzintv/jzintv.SlackBuild64
-rw-r--r--games/jzintv/jzintv_rompath.patch12
-rw-r--r--games/jzintv/resolution.diff.gzbin0 -> 594 bytes
-rw-r--r--games/jzintv/rompath.diff.gzbin0 -> 318 bytes
7 files changed, 172 insertions, 47 deletions
diff --git a/games/jzintv/README b/games/jzintv/README
index 3c2e465633..6f73e37c5b 100644
--- a/games/jzintv/README
+++ b/games/jzintv/README
@@ -1,20 +1,8 @@
+jzintv (Intellivision emulator)
+
jzintv is an emulator and development environment for the Mattel
Intellivision game console.
The Intellivision console contains code in the form of ROM. jzintv
-requires images of these ROMs in order to run. This package does not
-contain the ROM images due to copyright concerns. You can use the ROMs
-from the commercially available "Intellivision Lives!" CD-ROM, dump the
-ROMs from an Intellivision console, or attempt to find the ROMs on the
-'net somewhere. These are the same ROMs used by the MESS emulator,
-usually found as "intv.zip". Contents:
-
-exec.bin, 8192 bytes, md5sum 62e761035cb657903761800f4437b8af
-grom.bin, 2048 bytes, md5sum 0cd5946c6473e42e8e4c2137785e427f
-
-Your md5sums may not match, since Mattel released several versions of
-the ROMs. The above are known to work, but other versions might also
-work. jzintv looks for the .bin files, not the .zip file.
-
-Once you have the ROM images, place them in the /usr/share/jzintv/rom
-directory.
+requires images of these ROMs in order to run. See README_ROMs.txt for
+details on the ROM images and how to include them in the package.
diff --git a/games/jzintv/README_ROMs.txt b/games/jzintv/README_ROMs.txt
new file mode 100644
index 0000000000..93edd8db9b
--- /dev/null
+++ b/games/jzintv/README_ROMs.txt
@@ -0,0 +1,50 @@
+TL;DR version: if you want the ROMs to be included in the package,
+find the file "intv.zip" (and optionally "intv_ecs.zip") somewhere on
+the internet and place it in the SlackBuild directory, before running
+the script.
+
+Long version:
+
+By default, this package does not contain the ROM images due to
+copyright concerns. You can use the ROMs from the commercially
+available "Intellivision Lives!" CD-ROM, dump the ROMs from an
+Intellivision console, or attempt to find the ROMs on the 'net
+somewhere. These are the same ROMs used by the MAME/MESS emulator.
+
+For the Intellivision console, there are 2 ROM images, usually
+found in a file called "intv.zip". Contents:
+
+exec.bin, 8192 bytes, md5sum 62e761035cb657903761800f4437b8af
+grom.bin, 2048 bytes, md5sum 0cd5946c6473e42e8e4c2137785e427f
+
+If you also want to emulate the Computer Module (aka the Entertainment
+Computer System), you'll also need its ROM, usually found in a file
+called "intv_ecs.zip". Contents:
+
+ecs.bin, 24576 bytes, md5sum 2e72a9a2b897d330a35c8b07a6146c52
+
+*or*, split into 3 files:
+
+ecs_rom.20, 8192 bytes, md5sum 52f0bbbaff9ca21e619eb0ad5d85f9fb
+ecs_rom.70, 8192 bytes, md5sum 83efe70ebb42e3ded46ac76d851838a0
+ecs_rom.e0, 8192 bytes, md5sum ee2d7856f667ed66430be88871d86c39
+
+Your md5sums may not match, since Mattel released several versions of
+the ROMs. The above are known to work, but other versions might also
+work.
+
+If you want to include the ROM images in the package, place either
+the zip file(s) (intv.zip, and intv_ecs.zip if you need it) or the
+unzipped contents in the SlackBuild directory... or if you have them
+installed already in a previous jzintv package, or if you have them in
+/usr/share/games/mame/roms, the script will find them there also. You
+can also export JZINTV_ROM_PATH in the environment, to find the ROMs
+there.
+
+If you'd rather install the ROMs manually: build the package without
+them, install it, then copy them to /usr/share/games/jzintv/rom. If
+your ECS ROM is split into 3 files, join them with a command like:
+
+cat ecs_rom.20 ecs_rom.70 ecs_rom.e0 > ecs.bin
+
+jzintv looks for the .bin files, not the .zip file(s).
diff --git a/games/jzintv/extract_roms.sh b/games/jzintv/extract_roms.sh
new file mode 100644
index 0000000000..b7931d2efc
--- /dev/null
+++ b/games/jzintv/extract_roms.sh
@@ -0,0 +1,73 @@
+#!/bin/bash
+
+# extract_roms.sh: find the Intellivision and/or ECS ROM images,
+# either as zip files (which get unzipped) or as extracted contents,
+# and copy them to the destination dir (if it exists). This script is
+# intended to be run by jzintv.SlackBuild.
+
+# First arg: the SlackBuild dir ($CWD in the caller).
+srcdir="$1"
+
+# 2nd arg: where the .bin files should go ($ROMDIR in the caller).
+destdir="$2"
+
+# Full list of dirs where we'll look for ROMs.
+alldirs="$srcdir /usr/share/jzintv/rom /usr/share/games/jzintv/rom /usr/share/games/mame/roms ${JZINTV_ROM_PATH//: }"
+
+echo "=== Will search for ROMs in: $alldirs"
+
+# nocaseglob means we can handle intv.zip, intv.ZIP, INTV.ZIP, etc.
+shopt -s nocaseglob
+
+shopt -s nullglob
+
+# First, extract any likely-looking zip files we find.
+for dir in $alldirs; do
+ [ -d $dir ] || continue
+ for zipfile in $dir/intv*.zip $dir/ecs*.zip; do
+ echo "===> Extracting $zipfile"
+ unzip -o -LL $zipfile '*.rom' '*.bin' '*.int' '*.20' '*.70' '*.e0' '*.u21'
+ done
+ cd -
+done
+
+# Handle MAME/MESS split rom.
+if [ -e ecs_rom.20 -a -e ecs_rom.70 -a -e ecs_rom.e0 ]; then
+ echo "===> found split ECS ROM, combining"
+ cat ecs_rom.20 ecs_rom.70 ecs_rom.e0 > ecs.bin
+fi
+
+# Handle the new MAME name for grom.bin.
+if [ -e "ro-3-9503-003.u21" ]; then
+ echo "===> found MAME's ro-3-9503-003.u21, renaming to grom.bin"
+ mv ro-3-9503-003.u21 grom.bin
+fi
+
+# Now look for the actual ROMs, including any we just extracted above.
+for dir in $(pwd) $alldirs; do
+ [ -d $dir ] || continue
+ echo "===> Looking for unzipped ROMs in $dir"
+ for file in $dir/{exec,grom,ecs}.{rom,bin,int}*; do
+ tmp_name="$( echo $file | tr A-Z a-z | sed 's,\.[^.]*$,.bin,' )"
+ dest_name="$( basename $tmp_name )"
+ if [ "$dest_name" = "intv_ecs.bin" ]; then
+ dest_name="ecs.bin"
+ fi
+ size="$( stat -c %s "$file" )"
+ echo "===> candidate for $dest_name: $file, size $size"
+ case "$dest_name" in
+ grom.bin)
+ [ "$size" != 2048 ] && break ;;
+ exec.bin)
+ [ "$size" != 8192 ] && break ;;
+ esc.bin)
+ [ "$size" != 24576 ] && break ;;
+ esac
+ case "$dest_name" in
+ grom.bin|exec.bin|ecs.bin)
+ echo "===> found $dest_name as $file"
+ [ -d "$destdir" ] && cp "$file" "$destdir/$dest_name"
+ ;;
+ esac
+ done
+done
diff --git a/games/jzintv/jzintv.SlackBuild b/games/jzintv/jzintv.SlackBuild
index 4fd90057c5..2bd23bf867 100644
--- a/games/jzintv/jzintv.SlackBuild
+++ b/games/jzintv/jzintv.SlackBuild
@@ -6,11 +6,18 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20211023 bkw: BUILD=2
+# - fix -current build.
+# - binaries in /usr/games.
+# - /usr/share/jzintv/ => /usr/share/game/jzintv
+# - add patch to make the default window size 1024x768.
+# - include ROM images in package, if they exist in the SlackBuild dir.
+
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=jzintv
VERSION=${VERSION:-r1025}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -22,9 +29,6 @@ if [ -z "$ARCH" ]; then
esac
fi
-# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
-# the name of the created package would be, and then exit. This information
-# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@@ -57,32 +61,54 @@ rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.?z*
cd $PRGNAM-$VERSION
chown -R root:root .
-find -L . \
- \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \; -o \
- \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
+
+# 20211024 bkw: these patches are gzipped because they contain \r\n
+# line endings, and we can't trust git to preserve them.
# Don't see a way to redefine the ROM path on the make command
# line (it's hard-coded to /usr/local/share/jzintv/rom).
-patch -p1 < $CWD/jzintv_rompath.patch
+zcat $CWD/rompath.diff.gz | patch -p1
+
+# It's 2021, make the default window size bigger than 320x240.
+# This sets it to 1024x768, and also fixes the --help output to show
+# all the available modes.
+zcat $CWD/resolution.diff.gz | patch -p1
-# Fix for gcc-4.7.x
-sed -i "s|L\.\./lib|L../lib -lm|" src/Makefile
+# Fix for gcc-4.7.x and up.
+sed -i '/^LFLAGS/s,$, -lm,' src/Makefile
-cd src
- make OPT_FLAGS="$SLKCFLAGS"
-cd -
+make -C src OPT_FLAGS="$SLKCFLAGS -fcommon"
# There's no 'make install'
rm -f bin/README* bin/*.dll
strip bin/*
-mkdir -p $PKG/usr/bin
-cp -a bin/* $PKG/usr/bin
+mkdir -p $PKG/usr/games
+cp -a bin/* $PKG/usr/games
# The rompath patch above makes jzintv look here for the
# system ROMs
-mkdir -p $PKG/usr/share/$PRGNAM/rom
+ROMDIR=$PKG/usr/share/games/$PRGNAM/rom
+mkdir -p $ROMDIR
+
+# 20211022 bkw: if the ROMs are in the slackbuild dir, include them.
+# ROM finding/extraction script is separate, as it's fairly
+# complex (or at least tedious).
+sh $CWD/extract_roms.sh $CWD $ROMDIR
+
+ROMS=""
+for romfile in exec.bin grom.bin ecs.bin; do
+ if [ -e $ROMDIR/$romfile ]; then
+ ROMS+="$romfile "
+ fi
+done
+
+if [ "$ROMS" = "" ]; then
+ ROMS="This package does NOT include ROM images."
+else
+ ROMS="This package includes ROM images: $ROMS"
+fi
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -r *.txt doc examples rom misc $PKG/usr/doc/$PRGNAM-$VERSION
@@ -90,7 +116,7 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README_SBo.txt
mkdir -p $PKG/install
-cat $CWD/slack-desc > $PKG/install/slack-desc
+sed "14s/:/: $ROMS/" $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
diff --git a/games/jzintv/jzintv_rompath.patch b/games/jzintv/jzintv_rompath.patch
deleted file mode 100644
index b5b40e566a..0000000000
--- a/games/jzintv/jzintv_rompath.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur jzintv-1.0-beta3/src/config.h jzintv-1.0-beta3.patched/src/config.h
---- jzintv-1.0-beta3/src/config.h 2006-07-06 13:52:01.000000000 -0400
-+++ jzintv-1.0-beta3.patched/src/config.h 2009-02-04 23:28:34.000000000 -0500
-@@ -166,7 +166,7 @@
-
- #ifdef linux
- # define USE_STRCASECMP
--# define DEFAULT_ROM_PATH ".:=../rom:/usr/local/share/jzintv/rom"
-+# define DEFAULT_ROM_PATH ".:/usr/share/jzintv/rom"
- # define HAS_LINK
- #endif
-
diff --git a/games/jzintv/resolution.diff.gz b/games/jzintv/resolution.diff.gz
new file mode 100644
index 0000000000..00b5b0db27
--- /dev/null
+++ b/games/jzintv/resolution.diff.gz
Binary files differ
diff --git a/games/jzintv/rompath.diff.gz b/games/jzintv/rompath.diff.gz
new file mode 100644
index 0000000000..d7f28e9e2b
--- /dev/null
+++ b/games/jzintv/rompath.diff.gz
Binary files differ