shithub: rc

ref: 7314fb6b296824132c3e0adef0377b024990ecc7
dir: /bin/nesj/

View raw version
#!/bin/rc

n=`{sed -n '/ep.\.0/h;${g;s/^(ep.\.0).*/\1/p;}' /dev/usb/ctl}
while(~ $1 -?){
	switch($1){
	case -k	# just make /sys/src/9/boot/nusbrc do nothing if it sees your
		# device instead
		p=`{ps | sed -n '/ kb$/h;${g;s/^[^ ]+ +([0-9]+) .*/\1/p;}'}
		echo kill >/proc/$p/note
		wait $p
	case -n
		n=ep$2.0
		shift
	}
	shift
}

echo resize -dx 776 -dy 728 >/dev/wctl
nusb/joy /dev/usb/$n | joynes 1 | games/nes -a3 $*
# press Kdel again to kill nusb/joy...