ref: d2eefc38aec3bdc0c36d1b11d8906b1ce251d496
parent: c35c684b087c526622e60d5fa6ab098c30238f16
author: qwx <[email protected]>
date: Thu Jan 9 09:36:44 EST 2020
add doom: doom launcher and related scripts
--- /dev/null
+++ b/doom/dmus.mp3
@@ -1,0 +1,94 @@
+#!/bin/rc
+# this overrides music in final doom and any custom music in pwads, since the
+# labels are hardcoded in the source.
+switch($2){
+ case adrian
+ f=$home/m/doom2.adrians.asleep.mp3
+ case ampie
+ f=$home/m/doom2.bye.bye.american.pie.mp3
+ case betwee
+ f=$home/m/doom2.between.levels.mp3
+ case bunny
+ f=$home/m/doom.bunny.mp3
+ case countd count2
+ f=$home/m/doom2.countdown.to.death.mp3
+ case dead dead2
+ f=$home/m/doom2.the.demons.dead.mp3
+ case dm2ttl
+ f=$home/m/doom2.intro.mp3
+ case dm2int
+ f=$home/m/doom2.intermission.mp3
+ case doom doom2
+ f=$home/m/doom2.doom.mp3
+ case ddtblu ddtbl2 ddtbl3
+ f=$home/m/doom2.the.dave.d.taylor.blues.mp3
+ case e1m1
+ f=$home/m/doom.at.dooms.gate.mp3
+ case e1m2
+ f=$home/m/doom.the.imps.song.mp3
+ case e1m3
+ f=$home/m/doom.dark.halls.mp3
+ case e1m4
+ f=$home/m/doom.kitchen.ace.and.taking.names.mp3
+ case e1m5
+ f=$home/m/doom.suspense.mp3
+ case e1m6 e3m6
+ f=$home/m/doom.on.the.hunt.mp3
+ case e1m7 e2m5 e3m5
+ f=$home/m/doom.demons.on.the.prey.mp3
+ case e1m8 e3m4
+ f=$home/m/doom.sign.of.evil.mp3
+ case e1m9 e3m9
+ f=$home/m/doom.hiding.the.secrets.mp3
+ case e2m1
+ f=$home/m/doom.i.sawed.the.demons.mp3
+ case e2m2
+ f=$home/m/doom.the.demons.from.adrians.pen.mp3
+ case e2m3 inter
+ f=$home/m/doom.intermission.from.doom.mp3
+ case e2m4
+ f=$home/m/doom.theyre.going.to.get.you.mp3
+ case e2m6
+ f=$home/m/doom.sinister.mp3
+ case e2m7 e3m7
+ f=$home/m/doom.waltz.of.the.demons.mp3
+ case e2m8
+ f=$home/m/doom.nobody.told.me.about.id.mp3
+ case e2m9 e3m1
+ f=$home/m/doom.untitled.mp3
+ case e3m2
+ f=$home/m/doom.donna.to.the.rescue.mp3
+ case e3m3
+ f=$home/m/doom.deep.into.the.code.mp3
+ case e3m8
+ f=$home/m/doom.facing.the.spider.mp3
+ case evil
+ f=$home/m/doom2.evil.incarnate.mp3
+ case in_cit
+ f=$home/m/doom2.into.sandys.city.mp3
+ case intro
+ f=$home/m/doom.title.mp3
+ case messag messg2
+ f=$home/m/doom2.message.from.the.archvile.mp3
+ case openin
+ f=$home/m/doom2.opening.to.hell.mp3
+ case read_m
+ f=$home/m/doom2.end.mp3
+ case romero romer2
+ f=$home/m/doom2.waiting.for.romero.to.play.mp3
+ case runnin runni2
+ f=$home/m/doom2.running.from.evil.mp3
+ case shawn shawn2 shawn3
+ f=$home/m/doom2.shawns.got.the.shotgun.mp3
+ case stalks stlks2 stlks3
+ f=$home/m/doom2.the.healer.stalks.mp3
+ case tense
+ f=$home/m/doom2.getting.too.tense.mp3
+ case the_da theda2 theda3
+ f=$home/m/doom2.in.the.dark.mp3
+ case ultima
+ f=$home/m/doom2.the.ultimate.challenge.mp3
+ case victor
+ f=$home/m/doom.victor.mp3
+ }
+audio/mp3dec <$f
--- /dev/null
+++ b/doom/doom
@@ -1,0 +1,58 @@
+#!/bin/rc -e
+# set up namespace for a particular version of doom and launch it
+# default setup:
+# - $home/lib/doom: mntpt and location of config file
+# - $home/lib/doom/$game: user game directories: savegames and screenshots
+# - /sys/games/lib/doom/$game: system iwad and pwad directories
+# cwd is bound over $mntpt to allow loading stuff from there
+# example: launch doom2 with scythe.wad (both in /sys/games/lib/doom/d2)
+# ; doom d2 -file scythe.wad
+# example game version names:
+# doom.wad → /sys/games/lib/doom/d1/
+# doom2.wad → /sys/games/lib/doom/d2/
+# doom2f.wad → /sys/games/lib/doom/d2f/
+# doom1.wad → /sys/games/lib/doom/dsh/
+# plutonia.wad → /sys/games/lib/doom/plt/
+# tnt.wad → /sys/games/lib/doom/tnt/
+# doomu.wad → /sys/games/lib/doom/ud/
+
+rfork ne
+flagfmt='b,l,z,m mntpt'
+args='game [params]'
+if(! ifs=() eval `{aux/getflags $*} || ~ $#* 0){
+ aux/usage
+ exit usage
+}
+mntpt=$home/lib/doom
+if(~ $#flagm 1)
+ mntpt=$flagm
+if(! test -d $mntpt/$1)
+ mkdir -p $mntpt/$1
+bind -ac $mntpt/$1 $mntpt
+if(test -d /sys/games/lib/doom/$1)
+ bind -a /sys/games/lib/doom/$1 $mntpt
+if(! ~ $flagb 1)
+ bind -b `{pwd} $mntpt
+cd $mntpt
+
+# max scaling factor is 4 unless doom itself is patched
+if(~ $#vgasize 0 || ~ $flagz 1)
+ r=(-dx 328 -dy 208)
+if not
+ r=`{echo $vgasize |\
+ awk -Fx '{
+ a=$1/320;
+ b=$2/200;
+ c=int(b<a?b:a);
+ if(c*320 == $1 || c*200 == $2)
+ c--;
+ print "-dx", c*320+8, "-dy", c*200+8
+ }'
+ }
+if(! ~ $flagz 1)
+ echo resize $r >/dev/wctl
+
+if(! ~ $flagl 1)
+ games/doom $* >/dev/null
+if not
+ games/doom $* >/tmp/doomlog.$pid >[2=1]
--- a/launch/doom
+++ /dev/null
@@ -1,58 +1,0 @@
-#!/bin/rc -e
-# set up namespace for a particular version of doom and launch it
-# default setup:
-# - $home/lib/doom: mntpt and location of config file
-# - $home/lib/doom/$game: user game directories: savegames and screenshots
-# - /sys/games/lib/doom/$game: system iwad and pwad directories
-# cwd is bound over $mntpt to allow loading stuff from there
-# example: launch doom2 with scythe.wad (both in /sys/games/lib/doom/d2)
-# ; doom d2 -file scythe.wad
-# example game version names:
-# doom.wad → /sys/games/lib/doom/d1/
-# doom2.wad → /sys/games/lib/doom/d2/
-# doom2f.wad → /sys/games/lib/doom/d2f/
-# doom1.wad → /sys/games/lib/doom/dsh/
-# plutonia.wad → /sys/games/lib/doom/plt/
-# tnt.wad → /sys/games/lib/doom/tnt/
-# doomu.wad → /sys/games/lib/doom/ud/
-
-rfork ne
-flagfmt='b,l,z,m mntpt'
-args='game [params]'
-if(! ifs=() eval `{aux/getflags $*} || ~ $#* 0){
- aux/usage
- exit usage
-}
-mntpt=$home/lib/doom
-if(~ $#flagm 1)
- mntpt=$flagm
-if(! test -d $mntpt/$1)
- mkdir -p $mntpt/$1
-bind -ac $mntpt/$1 $mntpt
-if(test -d /sys/games/lib/doom/$1)
- bind -a /sys/games/lib/doom/$1 $mntpt
-if(! ~ $flagb 1)
- bind -b `{pwd} $mntpt
-cd $mntpt
-
-# max scaling factor is 4 unless doom itself is patched
-if(~ $#vgasize 0 || ~ $flagz 1)
- r=(-dx 328 -dy 208)
-if not
- r=`{echo $vgasize |\
- awk -Fx '{
- a=$1/320;
- b=$2/200;
- c=int(b<a?b:a);
- if(c*320 == $1 || c*200 == $2)
- c--;
- print "-dx", c*320+8, "-dy", c*200+8
- }'
- }
-if(! ~ $flagz 1)
- echo resize $r >/dev/wctl
-
-if(! ~ $flagl 1)
- games/doom $* >/dev/null
-if not
- games/doom $* >/tmp/doomlog.$pid >[2=1]