

UPDATE: see the new thread for a superior version.
Requires -frameskip 1 or 2 for most games, later gen archos units may run full-speed with no frameskip. Audio doesn't work (yet). (For the later gen units the screen initialisation method is probably different, and I'm not sure how you would do key input). I may try to speed it up if I get time.
(Probably needs screen rotated for easier keys, I might also look at that)
For those not interested in building SDL apps just download the install pack fceu.zip. Then assuming you have the GFT3 hack installed, unzip and copy the fceu directory to the top directory of the archos via usb or wifi file server (/mnt/data/fceu is created), and copy the new hack.sh (which is in the fceu directory) over old one in /mnt/data/hack.sh
UPDATE: see this post later in the thread for improved controls and a fix for the battery power off problem.
The code added to hack.sh is just after the part that renames jsplugins back to jspluginsx, you can run this from your own script if you're not using GFT3:
Code: Select all
...
# rename the jsplugins directory so hack can survive a reboot
if [ -d /mnt/data/jsplugins ]; then mv /mnt/data/jsplugins /mnt/data/jspluginsx; fi
# if NES emulator fce ultra is present, run that instead of restarting avos
if [ -d /mnt/data/fceu ]; then
killall -SIGSTOP avos
export LD_LIBRARY_PATH=/mnt/data/fceu
export SDL_NOMOUSE=1
export HOME=/mnt/data/fceu
cp /mnt/data/fceu/transparency77 /dev/fb2
/mnt/data/fceu/stopstart.sh &
/mnt/data/fceu/fceu -sound 0 -fs 1 -bpp 16 -xres 800 -yres 480 -nofs 1 -frameskip 2 /mnt/data/fceu/game.nes >/dev/null 2>&1
killall -SIGCONT avos
exit 0
fi
...
Now run the emulator by activating GFT3 (rename jspluginsx to jsplugins and open 'dohack.html' (or content portal)). By default it runs super_mario_bros. To run any other game instead, put it in the fceu directory and rename it to 'game.nes' (rename the existing 'game.nes' file first), it can even be a zip file (but must be renamed to 'game.nes')
Keys are: up/down, left/right, X=quit, OK=enter (pause during gameplay), leftmenu=B, menu=A, leftvol=?, rightvol=tab (menu screen selection)
To run GFT3 as normal (so you can restart avos) just rename the directory to fceux.
To rerun the GFT3 hack afterwards you will need to change to another directory and back in the file browser to see the renamed jspluginsx (this is because avos is not restarted and the filebrowser is not refreshed)
NB: You really need to run this connected to usb power (or minidock power) since on battery power the unit shuts down after a few minutes (I think that's because avos is stopped, I'll have to look at it)
Get games using google search, eg http://www.nesfiles.com/, read about some cool ones at http://uk.ign.com/top-100-nes-games/3.html
============================================================================
More exciting for hobbyists and hackers is exploring SDL app porting (I originally planned to look at this ~2 years ago see here ). I provided a basic development environment (including SDL) on the GFT3 hack thread (read the relevant section in post #1 there for more info)
http://www.jbg.f2s.com/archos605/armx.ext3.gz http://www.jbg.f2s.com/archos605/setpaths.sh
UPDATE: see this post for details on how to do all this using the archos supplied cross-compiler toolchain
The fceu ultra sources compile with just two small tweaks to the configure script:
Assuming you have unzipped and copied /mnt/data/armx.ext3 and /mnt/data/setpaths.sh then from a linux box do 'ssh ip.of.archos -l root' (blank password)
then in archos ssh session type:
Code: Select all
. /mnt/data/setpaths.sh (there is a space after the dot!)
cd /mnt/system/
wget http://fceu.googlecode.com/files/fceu-0.98.13-pre.src.tar.bz2
tar xvf fceu-0.98.13-pre.src.tar.bz2
cd fceu
Code: Select all
vi configure
Code: Select all
if :; then
on line 5592 add '!' to the test so it becomes:
Code: Select all
if test ! -z "${C80x86_TRUE}" && ...
Then run configure:
Code: Select all
./configure
Code: Select all
wget http://www.jbg.f2s.com/archos605/input.c
cp input.c src/drivers/pc/
Then run make:
Code: Select all
make
Code: Select all
strip src/fceu
To run from the ssh session you need to initialise the screen first, make sure the backlight is on and stop the main avos process (you don't want screen inteference from avos)
Code: Select all
kill -SIGSTOP `pidof -s avos`
if you completely kill avos rather than stopping it you won't get any key events in /dev/tty0. Note that the wifi connection will be permanent while avos is stopped - so nice alternative to keeping the file server or browser open for example.
then initialise the screen using transparency77:
Code: Select all
cp /mnt/data/fceu/transparency77 /dev/fb2
now run the emulator with something like:
Code: Select all
src/fceu -sound 0 -fs 1 -bpp 16 -xres 800 -yres 480 -frameskip 2 /mnt/data/fceu/zelda.nes
to end a game hit CTRL-C (or 'X' button on the archos)
============================================================================
There are several SDL examples in the development pack directory /mnt/system/armx/SDLtest, you run them the same way:
Code: Select all
cd /mnt/system/armx/SDLtest/
./testwin
all these should work: testoverlay, testoverlay2, testalpha, testpalette, testbitmap, testsprite and for info try testvidinfo, testblitspeed and testplatform. (note that testsprite moves ~100 sprites at over 100fps, so with proper coding decent apps would definitely be possible)
If you kill avos then you can access the audio device via /dev/dsp, I created a python script to set volume (it's in the setpaths.sh file)
Code: Select all
kill `pidof avos_helper.sh`
volume 60
./loopwave sample.wav
Code: Select all
playwave /mnt/system/armx/SDltest/sample.wav
I included the SDL_mixer library in the development pack, you can build others if required (eg SDL_Image (use ./configure --prefix=/mnt/system/armx/usr, make, make install)
There are many SDL examples on the web, as long as they don't use opengl or advanced SDL features they should compile and run on the archos eg a nice parallax scrolling demo http://olofson.net/download/parallax-2.tar.gz
(NB must have environment variable SDL_NOMOUSE=1 set, this is done for you if you run the setpaths.sh script from the development pack)
I noticed that ldd doesn't properly trace the libraries on these SDL apps, instead you can use the alternative 'LD_TRACE_LOADED_OBJECTS=1 sdlappname' to list the dynamic link libraries.
I probably should put all this in a wiki, but I'm not sure if there is a maintained and active one for the 605 devices, last time I looked it was spammed to oblivion.
There is an older version of the fce emulator v0.75, which is supposed to be faster, but I couldn't get it to run without segfaulting, http://hultinedutainment.se/~noname/fil ... rce.tar.gz . However, it's clear that this device could run some very nice SDL based apps with a little more tweaking, if there were more of a developer community I'm sure some cool stuff would have emerged, as it is, this is probably 2 years late now

TODO:
1. Screen rotate 90 degrees DONE
2. Speed up DONE
3. Audio ? (can only get crackles atm, may not be feasible)
4. usb gamepad (PSX1 type) via libusb see this old thread DONE
5. Fix issue with power off on battery power. DONE