[Scummvm-git-logs] scummvm-tools master -> 6bcda04463f0946b5b2155b1f48c448dcc939985

eriktorbjorn noreply at scummvm.org
Wed Mar 16 16:07:00 UTC 2022


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-tools' repo located at https://github.com/scummvm/scummvm-tools .

Summary:
6bcda04463 SCUMM: Add PC Engine Loom extraction shell script


Commit: 6bcda04463f0946b5b2155b1f48c448dcc939985
    https://github.com/scummvm/scummvm-tools/commit/6bcda04463f0946b5b2155b1f48c448dcc939985
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2022-03-16T17:04:08+01:00

Commit Message:
SCUMM: Add PC Engine Loom extraction shell script

The purpose is to eliminate the need for non-standard tools.

Changed paths:
  A engines/scumm/extract_loom_tg16.sh
    README


diff --git a/README b/README
index 0d232bc..a5c887f 100644
--- a/README
+++ b/README
@@ -133,8 +133,8 @@ Extraction Tools:
                 Example of usage:
                 ./scummvm-tools-cli --tool extract_loom_tg16 [-o outputdir] <infile>
 
-                NOTE: Use the dumpcd utility at http://www.zeograd.com/misc_download.php
-                to dump the code tracks on the CD.
+                NOTE: See https://wiki.scummvm.org/index.php?title=HOWTO-LoomTG16
+                for instructions on how to dump the code tracks on the CD.
 
         extract_mm_apple
                 Extracts data files from the Apple II version of Maniac
@@ -459,6 +459,14 @@ Encoder Tools:
                 It uses FFmpeg to extract Smacker videos.
 
 Other Tools:
+        extract_loom_tg16.sh
+                UNIX shell script used to extract the game data and audio from
+                the PC-Engine Loom CD.
+
+                It uses cdrdao, bchunk and - optionally - flac to extract the
+                data needed for the final extraction by scumm-tools-cli. Use
+                The --help parameter for a list of options.
+
         pack_bladerunner
                 Used to combine Blade Runner CDFRAMES.DAT files into HDFRAMES.DAT.
 
diff --git a/engines/scumm/extract_loom_tg16.sh b/engines/scumm/extract_loom_tg16.sh
new file mode 100755
index 0000000..fabda0a
--- /dev/null
+++ b/engines/scumm/extract_loom_tg16.sh
@@ -0,0 +1,119 @@
+#! /bin/sh -e
+
+dest=loom-pce
+cleanup=1
+compress=0
+ext=wav
+
+# This is a proof-of-concept script. I'm at best a bumbling amateur
+# when it comes to shell scripting. # Use this script from an empty
+# directory. Required packages (Debian):
+#
+# - cdrdao
+# - bchunk
+# - flac (optional)
+
+while [ $# -gt 0 ] ; do
+    case $1 in
+	--help)
+	    echo "Usage: $0 [OPTION] [DEST]"
+	    echo "    --help      This text"
+	    echo "    --keep      Do not remove temporary files"
+	    echo "    --compress  Compress audio tracks to FLAC"
+	    exit 0
+	    ;;
+	--keep)
+	    cleanup=0
+	    ;;
+	--compress)
+	    compress=1
+	    ;;
+	--)
+	    shift
+	    break
+	    ;;
+	-*)
+	    echo $0: $1: unrecognized option >&2
+	    exit 1
+	    ;;
+	*)
+	    break
+	    ;;
+    esac
+
+    shift
+done
+
+if [ $# -gt 0 ] ; then
+    dest=$1
+fi
+
+# Create an new directory for the final game. Make sure that it's empty
+
+mkdir -p "$dest"
+
+if [ -n "`ls -A \"$dest\"`" ] ; then
+    echo "$0: Destination directory is not empty: $dest"
+    exit 1
+fi
+
+# Rip the CD to hard disk. The cdrdao command has a bewildering number
+# of options, but apparently none for extracting single tracks. Oh
+# well, most of the tracks are interesting in some way.
+#
+# After some experimenting I came up with pretty much the same
+# parameters as in the DOSBox documentation, at which point I decided
+# to just follow their lead. The most interesting bit is probably the
+# 0x20000 option, which ensures the correct byte order for the
+# extracted audio. This allows the resulting BIN/CUE files to be run
+# in the Mednafen emulator, which is useful for testing.
+#
+# It's also possible to do this byte swapping in the bchunk step, by
+# adding the -s option there.
+#
+# This step is time-consuming, so only do it if there isn't already an
+# extracted loom.bin file there. It may be possible to generate a CUE
+# file instead of a TOC file here, but I didn't manage to.
+
+if [ ! -e loom.bin ] ; then
+    cdrdao read-cd --datafile loom.bin --driver generic-mmc:0x20000 --device /dev/cdrom --read-raw loom.toc
+fi
+
+# If there isn't a CUE file, convert the TOC file into something other
+# programs can work with.
+
+if [ ! -e loom.cue ] ; then
+    toc2cue loom.toc loom.cue
+fi
+
+# Split the BIN/CUE files into individual tracks.
+
+bchunk -w loom.bin loom.cue track
+
+# Compress the audio tracks. Note that there is a gap in the numbering
+# because of the data track.
+
+if [ $compress != 0 ] ; then
+    flac -8 *.wav
+    ext=flac
+fi
+ 
+mv track01.$ext "$dest"
+
+prevnr=02
+
+for nr in `seq -w 3 22` ; do
+    mv "track$nr.$ext" "$dest/track$prevnr.$ext"
+    prevnr=$nr
+done
+
+# Finally, use scummvm-tools-cli to extract the oh-so-juicy data files.
+
+scummvm-tools-cli --tool extract_loom_tg16 -o "$dest" track02.iso
+
+# Cleanup
+
+if [ $cleanup != 0 ] ; then
+    rm -f loom.toc track02.iso track23.iso track??.wav
+fi
+




More information about the Scummvm-git-logs mailing list