Tuesday, June 26, 2007

Remapping the keyboard and ScummVM

I found a way to bypass the menu problem with ScummVM. The menu is originally bind to the F5 key - which does not exists on the zaurus. But I can map Fn-5 to simulate F5, just edit /etc/keymap-2.6.map, and add under,

keycode 6 = five
The following line,
altgr keycode 6 = F5
Now when I run ScummVM and press Fn-5 the menu pops up - hurrah.
So now I can update the old 0.6.1 version to the new 0.9.0 version,
removed the old version,
# ipkg-link remove scummvm-qpe
# ipkg remove scummvm-qpe
and installed the new one,
# ipkg install -d loop0 scummvm
# ipkg-link add libflac4; ipkg-link add libvorbis ; ipkg-link add scummvm
The new version supports skins, so I'll install the modern-dark theme from www.tyrannozaurus.com ScummVM section. After installing a theme the theme.ini and theme.zip filenames should be changed to modern.ini and modern.zip (in /usr/share/scummvm/themes/).
It is also suggested in tyrannozaurus to use the AdvMAME 2x filter.

Saturday, June 23, 2007

gpsp & VisualBoyAdvanced

I found a list of emulators in a post on OESF. I started with gpsp the same way as I did with snes9x, put the bios in the rom's directory, started gpsp - I got the menu, I could use the arrow keys, but couldn't use return (or ok or whatever starts a rom). Cancel did not exit the program, the only way to stop it is killall gpsp via ssh. I also tried to start a rom from command line, but then I got a nonreponsive black screen. Now I had to kill opie inorder to stop gpsp.

Then I tried VisualBoyAdvanced (VBA). Installed it (with -force-depends), I used a similar script to the one I used with snes9x...
and voilla, vba runs, a bit slow, no sound (If I enabled sound it came out statering) - but playable.
I needed to tweak a little bit with ~/VisualBoyAdvance.conf. I switched the arrow keys directions, return did not work so I changed select to Q. I tried playing with the various switches to improve performance but I had no luck there.

Friday, June 22, 2007

snes9x

I found this old ipk on my zaurus, snes9x-sdl-qpe_1.39-r1_arm tried to install it, and it complained for missing libsdl, which was already installed by libsdl-1.2, so I forced demands, and installed:

# ipkg install -d loop0 snes9x-sdl-qpe_1.39-r1_arm.ipk -force-depends
# ipkg-link add snes9x-sdl-qpe
when I tried to run it, I got a black window with sound (which was encouraging). I found this website and used the following switches, no snes9x started but it was rather slow (because of the resize):
# snes9x -hi -x2 -xs 640 -ys 480
The -x2 switch causes snes9x to double the picture so it fits the screen nicely, removing it greatly improves performance (but results in a small window). Another possibility is to use qcop commands to change resolution to 320x200 (like I did for mplayer). Now horizontal lines appeard and the picture was upside down. To solve this I added "SDL_QT_INVERT_ROTATION=0" before running snes9x. Now picture is nice, performance seems reasonable, but, the arrow keys are messed up. I couldn't fix the arrow-keys, but I found a way to redefine the controls, so I used g, l, i & m instead. To set the keys a S9XKEYS variable need to be defined (before starting snes9x):
# export S9XKEYS=27,100,99,115,120,97,122,113,32,103,108,105,109,121,98,112,13
Which translate to:
  • Quit = Cancel
  • D = Button A
  • X = Button B
  • S = Button X
  • X = Button Y
  • A = Button L
  • Z = Button R
  • Q = Start
  • Space = Select
  • The directions are:
Y
IP
G
L
B
MCR

The definition of S9XKEYS is explained here:
S9XKEYS=Quit, A, B, X, Y, L, R, START, SELECT, LEFT, RIGHT, UP, DOWN, LEFTUP, LEFTDOWN, RIGHTUP, RIGHTDOWN
The key codes maybe found in this post or here. Maybe I'll manage to fool SDL with redefining the arrow-keys with opie-keyz.

I use this script to run snes9x and set everything to my taste (almost). I also found these additional switches:
-nso = no sound
-dfr = show frame rate.

Monday, June 18, 2007

Backgammon

Installed opie-backgammon - for those boring moments...

# ipkg install -d loop0 opie-backgammon
# ipkg-link add opie-backgammon
opie-backgamon, like knights suffers from the small window problem, I wonder if there is a way to fix it...

Tuesday, June 5, 2007

FLITE (Text-To-Speech)

I am writing an application for my new GPS (see previous post). In order to have voice output from the Zaurus I have installed FLITE,

# ipkg install flite -d loop0
# ipkg-link add flite; ipkg-link add libflite-cmu-us-kal1; ipkg-link add libflite1
Install a higher quality voice,
# ipkg install libflite-cmu-us-kal16-1 -d loop0
# ipkg-link add libflite-cmu-us-kal16-1
To replace the new voice with the old one replace the following symlink (in the /usr/lib directory),
# mv libflite_cmu_us_kal.so.1 libflite_cmu_us_kal.so.1.lowfreq
# ln libflite_cmu_us_kal16.so.1 libflite_cmu_us_kal.so.1 -s
To test flite simply run,
# flite -t "Hello world"
While we are at it, opie-reader can be setup to read text using flite. First install the opie-reader flite plugin,
# ipkg install opie-reader-output-flitecmd -d loop0
# ipkg-link add opie-reader-output-flitecmd
Now, in opie-reader under "Settings", select the "Scroll" tab. Under "Scroll type" select "Send to output" and under "Output" select "flitecmd". To start reading just start scrolling (Navagation->Scroll).
A word of warning; a. It takes couple of seconds before output starts, and b. The speech cannot be interrupted (as far as I found), opie-reader sends a full paragraph to flite, if you want to stop it - stop the scroll ONCE and wait... (I highly recommend putting a button in the toolbar)