View Single Post
Old 12-07-2012, 10:24 PM   #198
jackhulk
Connoisseur
jackhulk has memorized the entire works of Homer, Shakespeare, and Jane Austenjackhulk has memorized the entire works of Homer, Shakespeare, and Jane Austenjackhulk has memorized the entire works of Homer, Shakespeare, and Jane Austenjackhulk has memorized the entire works of Homer, Shakespeare, and Jane Austenjackhulk has memorized the entire works of Homer, Shakespeare, and Jane Austenjackhulk has memorized the entire works of Homer, Shakespeare, and Jane Austenjackhulk has memorized the entire works of Homer, Shakespeare, and Jane Austenjackhulk has memorized the entire works of Homer, Shakespeare, and Jane Austenjackhulk has memorized the entire works of Homer, Shakespeare, and Jane Austenjackhulk has memorized the entire works of Homer, Shakespeare, and Jane Austenjackhulk has memorized the entire works of Homer, Shakespeare, and Jane Austen
 
Posts: 52
Karma: 23642
Join Date: Oct 2011
Device: K3 3G
Quote:
#!/bin/sh
#================================================= ==
# getkb - get translated ascii keys from K3 keyboard
# v1.2 by geekmaster
# STDOUT: pressed keys, until Enter key pressed.
#---------------------------------------------------
getkb() {
eips -z 2 38 # scroll
XP=0
YP=39
DN=/dev/null
KN="1234567890____qwertyuiop____asdfghjkl_____zxc v bnm_."
KS="1234567890____QWERTYUIOP____ASDFGHJKL_____ZXC V BNM_,"
KP="1234567890____~@#$%^&*()____<>[]{}?/\_____;:'|-+=_?"
KM=$KN
ST=""
while :;do
eips $XP $YP "$ST""_ "
L="_"
set $(waitforkey); K=$1 D=$2
[[ $D -eq 0 ]]&& continue
# [[ $K -eq 28 ]]&& break # enter
[[ $K -eq 190 ]]&& break # use Aa for enter
[[ $K -eq 14 ]]&& ST="$(echo ${ST%?})" && continue # del
[[ $K -eq 42 ]]&& KM=$KS && continue # shift
[[ $K -eq 126 ]]&& KM=$KP && continue # Sym
[[ $K -eq 57 ]]&& L=" " # space
[[ $K -le 52 ]]&& L="$(echo \"$KM\"|cut -b$K-$K)"
# [[ "$L" == "_" ]]&& L="($K)"
[[ "$L" == "_" ]]&& continue
# echo -n "$L"
ST="$ST$L"
KM=$KN
done
echo "$ST"
}

putei() {
st=$1
ii=${#st}
while [ $ii -ge 0 ]
do
eips -z 2 38 # scroll
eips 0 39 "$(echo $st | cut -b-50)" # write to the bottom
st="$(echo $st | cut -b51-)"
ii=$(( ii - 50 ))
done
}


killall -stop cvm launchpad 2> /dev/null
cd /mnt/us/fbgnuboy
eips -c;
putei "fbgnuboy - Games Boy Advanced Emulator"
putei ""
putei "Available ROMS -"
putei "$(ls ./roms | sed -e 's/\.[a-zA-Z]*$//')"
putei ""
putei "Execute Which ROM?"
game="$(getkb)"
#draw picture frame
eips -g ./gb-flash.jpg
sleep 1
HOME=/tmp ./fbgnuboy ./roms/"$game".g* 2> /mnt/us/gnuboy.log
killall -cont cvm launchpad 2> /dev/null
Launchpad .ini and rungame created in notepad++

Haven't set up USBnet so unable to SSH (I always tend to do things the hard way!). I've got the wiki page bookmarked, lots to learn, just whizzing around everywhere at the moment seeing what's possible. I will of course sort out SSH access as my next task.
jackhulk is offline   Reply With Quote