View Single Post
Old 10-01-2012, 04:09 PM   #101
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6021146
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
gnuboy.sh (make this file)

Code:
#!/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_____zxcvbnm_."
  KS="1234567890____QWERTYUIOP____ASDFGHJKL_____ZXCVBNM_,"
  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)"
putei ""
putei "Execute Which ROM?"
HOME=/tmp ./fbgnuboy ./roms/"$(getkb)".gb 2>gnuboy.log
killall -cont cvm launchpad 2> /dev/null
run it from the same folder as gnuboy.

I thought the kite and lanchpad runners were in the download. they are not. my apologies.

Not sure how to run from kite but that will let you choose roms. so call that script from Kite.

Hope that helps

Last edited by twobob; 12-09-2012 at 08:55 PM. Reason: $DN is a bit funny sometimes. unrolled to /dev/null - fixed to code block!!!
twobob is offline   Reply With Quote