shithub: rc

ref: a21a11136bfd75f3092b04bac26dffbe567617e5
dir: /bin/nes/

View raw version
#!/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 | joygba 1 | {games/nes -a $*(3-) || games/nes $*(3-)}
if not
	games/nes -a $* || games/nes $*