shithub: rc

ref: 6213abf8bc893f3d18fa701c248c6316bd473cc6
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...