shithub: rc

Download patch

ref: 6708dc58f8de755435d6b1fb3dee6e9d44f2d025
parent: 0cfec45f3a3b91c84495ed132ac955f35fc09fb9
author: qwx <qwx@sciops.net>
date: Thu Sep 30 15:39:22 EDT 2021

emulator launchers: use emu, add gb since it has its own rom dir

--- a/bin/2600
+++ b/bin/2600
@@ -1,15 +1,2 @@
 #!/bin/rc
-echo resize `{echo $vgasize |\
-	awk -Fx '{
-		a=$1/320;
-		b=$2/222;
-		c=int(b<a?b:a);
-		if(c*320 == $1 || c*222 == $2)
-			c--;
-		print "-dx", c*320+8, "-dy", c*222+8
-	}'
-} >/dev/wctl
-if(~ $1 -j)
-	nusb/joy /dev/usb/ep^$2^.0 | joy | {games/2600 -a $*(3-) || games/2600 $*(3-)}
-if not
-	games/2600 -a $* || games/2600 $*
+emu 2600 320 222 $*
--- /dev/null
+++ b/bin/gb
@@ -1,0 +1,2 @@
+#!/bin/rc
+emu gb 160 144 $*
--- a/bin/gba
+++ b/bin/gba
@@ -1,15 +1,2 @@
 #!/bin/rc
-echo resize `{echo $vgasize |\
-	awk -Fx '{
-		a=$1/240;
-		b=$2/160;
-		c=int(b<a?b:a);
-		if(c*240 == $1 || c*160 == $2)
-			c--;
-		print "-dx", c*240+8, "-dy", c*160+8
-	}'
-} >/dev/wctl
-if(~ $1 -j)
-	nusb/joy /dev/usb/ep^$2^.0 | joy | {games/gba -a $*(3-) || games/gba $*(3-)}
-if not
-	games/gba -a $* || games/gba $*
+emu gba 240 160 $*
--- a/bin/gbc
+++ b/bin/gbc
@@ -1,15 +1,2 @@
-#!/bin/rc -e
-echo resize `{echo $vgasize |\
-	awk -Fx '{
-		a=$1/160;
-		b=$2/144;
-		c=int(b<a?b:a);
-		if(c*160 == $1 || c*144 == $2)
-			c--;
-		print "-dx", c*160+8, "-dy", c*144+8
-	}'
-} >/dev/wctl
-if(~ $1 -j)
-	nusb/joy /dev/usb/ep^$2^.0 | joy | {games/gb -a $*(3-) || games/gb $*(3-)}
-if not
-	games/gb -a $* || games/gb $*
+#!/bin/rc
+emu gbc 160 144 $*
--- a/bin/md
+++ b/bin/md
@@ -1,15 +1,2 @@
 #!/bin/rc
-echo resize `{echo $vgasize |\
-	awk -Fx '{
-		a=$1/320;
-		b=$2/224;
-		c=int(b<a?b:a);
-		if(c*320 == $1 || c*224 == $2)
-			c--;
-		print "-dx", c*320+8, "-dy", c*224+8
-	}'
-} >/dev/wctl
-if(~ $1 -j)
-	nusb/joy /dev/usb/ep^$2^.0 | joy | {games/md -a $*(3-) || games/md $*(3-)}
-if not
-	games/md -a $* || games/md $*
+emu md 320 224 $*
--- a/bin/nes
+++ b/bin/nes
@@ -1,15 +1,2 @@
 #!/bin/rc
-echo resize `{echo $vgasize |\
-	awk -Fx '{
-		a=$1/256;
-		b=$2/240;
-		c=int(b<a?b:a);
-		if(c*256 == $1 || c*240 == $2)
-			c--;
-		print "-dx", c*256+8, "-dy", c*240+8
-	}'
-} >/dev/wctl
-if(~ $1 -j)
-	nusb/joy /dev/usb/ep^$2^.0 | joy 1 | {games/nes -a $*(3-) || games/nes $*(3-)}
-if not
-	games/nes -a $* || games/nes $*
+emu nes 256 240 $*
--- a/bin/snes
+++ b/bin/snes
@@ -1,15 +1,2 @@
 #!/bin/rc
-echo resize `{echo $vgasize |\
-	awk -Fx '{
-		a=$1/256;
-		b=$2/239;
-		c=int(b<a?b:a);
-		if(c*256 == $1 || c*239 == $2)
-			c--;
-		print "-dx", c*256+8, "-dy", c*239+8
-	}'
-} >/dev/wctl
-if(~ $1 -j)
-	nusb/joy /dev/usb/ep^$2^.0 | joy | {games/snes -a $*(3-) || games/snes $*(3-)}
-if not
-	games/snes -a $* || games/snes $*
+emu snes 256 239 $*