shithub: rc

Download patch

ref: 5fda4466e7d111c4cdf478242b30d4ad5d596381
parent: 093b984a9683f10c82c69c3fd6e1feb750e0ff8d
author: qwx <qwx@sciops.net>
date: Wed May 26 04:14:06 EDT 2021

add imfdec: wrapper for imf decoding

u6dec </sys/games/lib/ultima6/ultima.m | u6mopl | opl2 -r 60 | norm 1.5 >/dev/audio
u6dec </sys/games/lib/ultima6/ultima.m | u6mopl | imfdec -n -r 60 -f 1.5 >/dev/audio
imfdec -n -r 560 <lib/imf/keen.unused.bullfrog.imf >/dev/audio
imfdec -r 560 <lib/imf/keen5.just.snoopin.around.imf >/dev/audio

--- /dev/null
+++ b/imfdec
@@ -1,0 +1,27 @@
+#!/bin/rc
+rate=49716
+norm=()
+bareimf=()
+while(~ $1 -?){
+	switch($1){
+	case -r
+		rate=$2
+		shift
+	case -f
+		norm=$2
+		shift
+	case -n
+		bareimf=1
+	case *
+		echo usage: $0 '[-n] [-r rate] [-f norm]'
+		exit usage
+	}
+	shift
+}
+cmd=(opl2 -r $rate)
+if(~ $#bareimf 0)
+	cmd=(imf '|' $cmd)
+if(! ~ $#norm 0)
+	cmd=($cmd '|' norm $norm)
+echo $cmd
+eval $cmd