shithub: rc

ref: b6f2ee6071be8b989bc2ceed52e0623a56145931
dir: /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...