Forum.ArchosFans.com

Unofficial Archos Support Forum
It is currently Thu May 28, 2020 12:22 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 39 posts ]  Go to page Previous 1 2
Author Message
PostPosted: Mon Feb 22, 2010 12:13 pm 
Offline
Archos Guru
Archos Guru

Joined: Wed Nov 21, 2007 6:41 pm
Posts: 448
serag wrote:
is it the same procedure to make it work on 605's that have the moldy cheese patched firmware instead of the GTF3?


GFT3 runs on any 605wifi device, just delete the restartavos.sh script since you don't need that (it's only for unlocking plugins on 2.1.04 firmware harddisk models), GFT3 is really just a root script launcher.

Of course, ideally, if you have moldy cheese installed you should write your own script launcher, rather than use the GFT3 hack, but if you can't then use the GFT3 hack.

If angstrom/android/qtopia ever works then you could just run these emulators from a desktop icon in one of those operating systems.


Top
   
PostPosted: Mon Feb 22, 2010 7:49 pm 
Offline
Archos Guru
Archos Guru

Joined: Wed Nov 21, 2007 6:41 pm
Posts: 448
@divx118

That atari800 emulator seems to run full speed (and 1.3.3 is the latest version I could get working too)

Unfortunately I'm not sure if the games are worthwhile, but I didn't own one so might not be aware of the greats :) (eg top 100 )

for cartridge files I used:

./atari800 -fullscreen -width 800 -height 480 -xl -xlxe_rom ATARIXL.ROM -basic_rom ATARIBAS.ROM -cart Pac-Man.rom

(then ctrl-z followed by 'fg'), for program files I used:

./atari800 -fullscreen -width 800 -height 480 -xl -xlxe_rom ATARIXL.ROM -basic_rom ATARIBAS.ROM -run boulderdash.exe

(The ATARI rom files are offically released and downloadable from your original link)

Image Image

If you specify "-basic" instead of a program or cartridge it just boots to a BASIC prompt ("READY"), but you can't type anything without a keyboard.


Top
   
PostPosted: Tue Feb 23, 2010 6:41 pm 
Offline
Archos Guru
Archos Guru

Joined: Tue Dec 04, 2007 9:48 pm
Posts: 595
@sideways It was not for the games, but just for old time sake :). I want to use my remote from the dvr as a keyboard if I manage to get it working. As usual spare time is an issue.
The version 1.3.3 was a lucky guess, I just looked at when the version of fce ultra was released what you are using. Thanks for saving me the time to test the other versions.
If you use -basic it indeeds boots to the basic command prompt where you can write a simple basic program. It was nice to see that blue screen again with ready and that big cursor. The good old days :lol:

Maurice 8)


Top
   
PostPosted: Fri Feb 26, 2010 6:57 pm 
Offline
Archos Guru
Archos Guru

Joined: Wed Nov 21, 2007 6:41 pm
Posts: 448
Yeah, the nostalgia factor is important, I think we were lucky to grow up with the first generation of home computers, this generation missed the thrill ;)

Haven't done much more on the emulator front, but I was trying to get dgen-sdl sega genesis emulator working, it does compile if you set up C++ (see below) but is slow and segfaults after intro screen (I think it uses custom assembler somewhere which doesn't work on arm)

Anyway, in case anyone wants to compile C++ apps on the a605, you need to add the g++ compiler and headers to the C development pack I provided (see post #1)

Assuming you are in an ssh session in the development environment (so you have run '. /mnt/data/setpaths.sh') then download bin_cplus.tjz and include_cplus.tjz and unpack them in /mnt/system/armx/usr/

Code:
. /mnt/data/setpaths.sh
cd /mnt/system
wget http://www.jbg.f2s.com/archos605/bin_cplus.tjz
wget http://www.jbg.f2s.com/archos605/include_cplus.tjz
cd /mnt/system/armx/usr
tar xvf /mnt/system/bin_cplus.tjz
tar xvf /mnt/system/include_cplus.tjz


you also need to set the CPLUS_INCLUDE_PATH environment variable, I suggest adding it to the setpaths.sh script so it gets added automatically in future:

Code:
export CPLUS_INCLUDE_PATH=/mnt/system/armx/usr/include:/mnt/system/armx/usr/include/arm-linux-uclibc


then check a simple Hello World c++ program compiles with 'g++ -o testcpp test.cpp'

Code:
#include <iostream>

int main()
{
std::cout << "Hello World!" << std::endl;
return 0;
}


The compiler version is gcc 3.4.3, I checked it against all the c++ standard library examples from http://www.josuttis.com/libbook/examples.html ("make all"), it passes everything except two rare examples, which he mentions in the notes, and are not a significant issue (they also fail on gcc 4.4.3 on fedora 12)


Top
   
PostPosted: Sun Feb 28, 2010 11:19 am 
Offline
Archos Guru
Archos Guru

Joined: Tue Dec 04, 2007 9:48 pm
Posts: 595
Thanks again sideways for the g++ compiler I need it to compile the atari 2600 emulator. Unfortunately I am now working on my sons little laptop made in china. When he saw me working with the games on the 605, he kindly [-X reminded me that I promised to do the same for his little laptop windows ce 5.0 based and that was 2 months ago :oops: . I have already the 2600 emulator running on that and am now working on a snes emulator when that is done I am going back to my 605. It shouldn't take to long :) .

Maurice 8)


Top
   
PostPosted: Mon Mar 01, 2010 11:12 pm 
Offline
Archos Guru
Archos Guru

Joined: Wed Nov 21, 2007 6:41 pm
Posts: 448
I really liked the look of stella (the atari 2600 emulator divx118 mentions above), but compiling it on the archos 605 seems not possible, we finally found a project which requires a proper pc based arm cross-compiler.

Luckily that's not too difficult since Archos provide a toolchain, see this post for step-by-step instructions on how to set it up

viewtopic.php?t=11426&start=4

Just apply the edits to makedevs.c and checkdevs.c as described (be careful to leave the right lines uncommented), copy the defconfig and run 'make sconfig' and 'make', after half an hour or so you'll get a toolchain and staging_dir in your home directory ~/ (DO NOT BUILD ANYTHING AS ROOT)

Now, using the toolchain is not trivial, and can be difficult to configure for some projects, but for standard gnu type projects it's fairly straightforward:

eg suppose we want to cross-compile the full version of grep-2.5.4

Code:
tar xvf ~/Download/grep-2.5.4.tar.gz
cd grep-2.5.4/
export PATH=~/staging_dir/bin:~/toolchain_build_arm_nofpu/bin:/bin:/sbin:/usr/bin:/usr/sbin
CFLAGS="-Os -pipe " ./configure  --host=arm-linux
make


and the grep arm binary is created in directory src/ (check with 'file src/grep'), which you can copy to the archos and execute from a shell. (The CFLAGS define is optional, but seems to be a common choice)

Stella is more complicated:

For stella we need first to cross-compile the SDL library, I suggest installing new libs in ~/staging_dir, and for the ./configure command below we must specify a full path:

Code:
tar xvf ~/Download/SDL-1.2.14.tar.gz
cd SDL-1.2.14/
export PATH=~/staging_dir/bin:~/toolchain_build_arm_nofpu/bin:/bin:/sbin:/usr/bin:/usr/sbin
CFLAGS="-Os -pipe " ./configure --host=arm-linux --disable-esd --prefix=/home/$USER/staging_dir
make -j2
make install


(the '--disable-esd' option seems necessary on 32bit linux otherwise you get SDL_dmaaudio.c:166: error: impossible constraint in `asm')

Now we need to unpack the stella sources, but the config is nonstandard so this time we first just configure normally (not for a cross-compile)

Code:
tar xvf Download/stella-3.0-src.tar.gz 
cd stella-3.0/
./configure --disable-gl --disable-debugger --disable-windowed


Now the fiddly bit, to enable a cross-compile we have to manually edit config.mak (or copy over it) with this:

Code:
# -------- Generated by configure -----------

PATH := ~/staging_dir/bin:~/toolchain_build_arm_nofpu/bin:/bin:/sbin:/usr/bin:/usr/sbin
CXX := arm-linux-g++
CXXFLAGS :=   
LD := arm-linux-g++
LIBS +=  -lSDL -lpthread -lz
RANLIB := arm-linux-ranlib
INSTALL := install
AR := arm-linux-ar cru
MKDIR := mkdir -p
ECHO := printf
CAT := cat
RM := rm -f
RM_REC := rm -f -r
ZIP := zip -q
CP := cp
WIN32PATH=
STRIP := arm-linux-strip
WINDRES := windres

MODULES +=  src/unix  src/cheat
MODULE_DIRS +=
EXEEXT :=

PREFIX := /usr/local
BINDIR := /usr/local/bin
DOCDIR := /usr/local/share/doc/stella
DATADIR := /usr/local/share
PROFILE :=

HAVE_GCC3 = 1

INCLUDES += -I ~/staging_dir/include/c++/3.4.3/ -I ~/staging_dir/include/c++/3.4.3/arm-linux-uclibc/ -Isrc/emucore -Isrc/emucore/m6502/src -Isrc/emucore/m6502/src/bspf/src -Isrc/common -Isrc/gui -I ~/staging_dir/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -Isrc/unix -Isrc/cheat
OBJS +=
DEFINES +=  -DUNIX -DBSPF_UNIX -DHAVE_GETTIMEOFDAY -DHAVE_INTTYPES -DSOUND_SUPPORT -DSNAPSHOT_SUPPORT -DJOYSTICK_SUPPORT -DCHEATCODE_SUPPORT
LDFLAGS += -L ~/staging_dir/lib


and you see why it is sometimes tricky to configure a project for the cross-compile toolchain. Note that I had to manually add some include paths and lib paths as well as specifying the arm toolchain commands.

Now we can run make as normal (-j2 runs two jobs at a time)

Code:
make -j2


But in fact, with the windowed mode disabled there is an error in the source code, you'll get an error about myFullScreenCheckbox at line 335 in src/gui/VideoDialog.cxx, just edit that line and comment it out, then rerun make.

then finally, strip the binary of unnecessary symbols (it's quite large already)

Code:
~/staging_dir/bin/arm-linux-strip stella


stella can be copied to the archos and executed like the sdl apps above. Unfortunately I haven't been able to test it yet, and I have my doubts that it will run at good speed. (UPDATE: see next post below)

The gen6 toolchain should be similar, anyone want to try and reply? :)

(Of course, problem with a cross-compiler is making sure the cross-compiled app is installed properly on the target device, with all dependencies, in this case we already have SDL installed and there aren't any extra dependencies so it's not difficult, but for large projects it can be)

UPDATE:

some more examples:

1. The simple "hello world" test.cpp example posted earlier in the thread can be cross-compiled with:

Code:
 export PATH=~/staging_dir/bin:~/toolchain_build_arm_nofpu/bin:/bin:/sbin:/usr/bin:/usr/sbin
arm-linux-g++ -o cpptest test.cpp


2. The fceu NES emulator from post #1 is pretty simple too, assuming the SDL libs are installed as for the stella example above, you just do:

Code:
tar xvf fceu-0.98.13-pre.src.tar.bz2
cd fceu


then make the edit to line 5592 of the ./configure script described in post #1 (the other edit isn't necessary)

Code:
export PATH=~/staging_dir/bin:~/toolchain_build_arm_nofpu/bin:/bin:/sbin:/usr/bin:/usr/sbin
make distclean
./configure --host=arm-linux
make -j2
arm-linux-strip src/fceu


UPDATE: you may get an error about SDL_config-arm.h unless you run 'make distclean' first, so I added that above.

3. The atari800 emulator mentioned previously in the thread, version 2.1.0 compiles ok:

Code:
tar xvf atari800-2.1.0.tar.gz
cd atari800-2.1.0/src/
export PATH=~/staging_dir/bin:~/toolchain_build_arm_nofpu/bin:/bin:/sbin:/usr/bin:/usr/sbin
./configure  --host=arm-linux --target=sdl
make -j2
arm-linux-strip atari800


but version 1.3.3 (which actually runs on the A605, 2.1.0 segfaults) fails to compile with error: undefined reference to `rpl_malloc', I haven't worked out why, it compiles fine in ~8mins on the archos itself.

The cross-compiler will be much faster on a modern computer than native compiling on the archos, the cpu's faster, you have more ram and you can run 'make -j2' to run multiple jobs (especially good on a dual-core cpu), but there are projects (like dgen-sdl) which have nonstandard configure scripts, and are a real pain to cross-compile, I couldn't configure it, so I don't mind the 20mins compilation time on the archos itself for the odd nonstandard project like that, and you'll see a lot of this in the world of emulators and other less "professional" software.

NB: remember to reset your $PATH (just close the terminal window and open a new one) when you have finished cross-compiling


Last edited by sideways on Tue Mar 16, 2010 1:41 pm, edited 6 times in total.

Top
   
PostPosted: Tue Mar 02, 2010 12:23 am 
Offline
Archos Guru
Archos Guru

Joined: Wed Nov 21, 2007 6:41 pm
Posts: 448
A download link for the compiled archos605 stella binary http://www.jbg.f2s.com/archos605/stella.zip

It does actually run, I'll try tweaking and post a screenshot later (and key controls need adding of course)

chmod +x stella
./stella spcinvad.bin

(then ctrl-z and 'fg' as usual for these sdl apps)

UPDATE: ok, it actually runs with sound (if you kill avos first), but is a little too slow :(. Someone should really port these to gen6 since all the emulators should run at full speed.

Image Image

the second image is from the smurfres.bin rom and has audio on the intro, you need to edit /mnt/system/armx/.stella/stellarc and make these changes:

...
fullres = 800x480
...
freq = 44100
tiafreq = 44100
...
launcherres = 800x480
...

If you just type './stella' without any rom image it will display the launcher window, which shows how a reasonable gui interface can be created with SDL (the touchscreen input needs to be translated to mouse input)


Last edited by sideways on Tue Mar 02, 2010 4:42 pm, edited 1 time in total.

Top
   
PostPosted: Tue Mar 02, 2010 3:44 pm 
Offline
Archos Guru
Archos Guru

Joined: Fri Aug 15, 2008 12:14 pm
Posts: 274
sideways wrote:
Someone should really port these to gen6 since all the emulators should run at full speed.

You are a good portion of the way there. You already know what configure commands need to be run. It should be fairly simple to create an OE recipe. This can then be included in the openAOS build and a package created for easy installation.


Top
   
PostPosted: Tue Mar 02, 2010 4:21 pm 
Offline
Archos Guru
Archos Guru

Joined: Wed Nov 21, 2007 6:41 pm
Posts: 448
CheBuzz wrote:
sideways wrote:
Someone should really port these to gen6 since all the emulators should run at full speed.

You are a good portion of the way there. You already know what configure commands need to be run. It should be fairly simple to create an OE recipe. This can then be included in the openAOS build and a package created for easy installation.


I edited the post above and added configure info for the other emulators, so it should be easy enough to build these using the gen6 toolchain.

But someone will have to write code to provide input in the emulators, and for gen6 it will have to be via touchscreen buttons or a usb device. This isn't too hard, but it requires someone with a gen6 device who is willing and has the time.


Top
   
PostPosted: Tue Mar 02, 2010 6:39 pm 
Offline
Archos Guru
Archos Guru

Joined: Wed Nov 21, 2007 6:41 pm
Posts: 448
In fact, for the later gen devices without buttons you could copy what has been done for emulators on the ipod, eg this NES emulator has touchscreen buttons either side of the display (watch the bit after he changes to landscape mode), similar to what I was suggesting above (I just made the whole touchscreen into two buttons - top and bottom, since the A605 has keys for direction control)

http://www.youtube.com/watch?v=FdcP316e96c


Top
   
PostPosted: Wed Mar 03, 2010 5:57 am 
Offline
Archos Guru
Archos Guru

Joined: Sun Feb 03, 2008 6:07 pm
Posts: 427
Location: Bangalore, India
But with the gen6 and gen7 the problem whould be that you would be able to only use a key at a time, like only up/down/left/right at a time. Say you want to jump and move right at the same time, this would not be possible from gen6 as no hardware keys. Are you guys on gen5 able to use 2 keys (hardware) simultaneously?
If someone could make the joystick/joypad useable on devices on gen6/7 it would be really a great thing.
Anyways cant thank you enough sideways and divx118 for your work on this!!!! You guys rock!!! I am not complaining about not being able to play on gen6/7 just saying. I know the hard work needed for these things, time, etc.
Anyways great work guys!!!

_________________
openAOS ROCKS!!


Top
   
PostPosted: Wed Mar 03, 2010 6:14 am 
Offline
Archos Guru
Archos Guru

Joined: Thu Dec 10, 2009 12:10 pm
Posts: 6598
It's true that the lack of hardware buttons on the A5A really limit it as a gaming device at present. To really make this work, you'd either need to access the USB host controller via a dock and use a USB gamepad or keyboard, or use the on-board BT for a BT gamepad or KB and both those things are pretty non-trivial to implement.

I'd love to see it though!

Michael


Top
   
PostPosted: Wed Mar 03, 2010 3:26 pm 
Offline
Archos Guru
Archos Guru

Joined: Thu Nov 23, 2006 10:37 pm
Posts: 627
Location: Berlin
nokiae50 wrote:
But with the gen6 and gen7 the problem whould be that you would be able to only use a key at a time


Not necessarily. I understand that the touchscreen will output coordinates x=(x1 + x2)/2 and y = (y1 + y2)/2 if you touch it on two places (x1, y1) and (x2, y2). Thus, you could also identify some combined presses. The problem is that the same coordinates would result from (x1, y1) and (x2, y2) as when you press (x1, y2) and (x2, y1).

_________________
openAOS


Top
   
PostPosted: Wed Mar 03, 2010 8:03 pm 
Offline
Archos Guru
Archos Guru

Joined: Tue Dec 04, 2007 9:48 pm
Posts: 595
sideways wrote:
ok, it actually runs with sound (if you kill avos first), but is a little too slow :(.


Hmm that is strange, I have it running on my chinese "netbook" with a samsung arm 920 processor with wince 5.0. I use the GAPI for handheld PCÔÇÖs in emulation mode, because the device is not supported.
The emulation mode is very heavy on the resources, but it still runs full speed on it with sound.
The only problem I still have is that the rom itself only runs with a resolution 400x300 on my 800x600 display. I used an available binary. I want to compile it myself for wince, but I will have to wait for the weekend to have some time for that. I will then also checkout the build for the archos. Sideways have you tried rotating the screen. On my windows ce build it is possible to do this in the config file or with the commandline argument "wince_orientation". I use version stella 2.3.5

BTW it is fun to play some old classics like space invaders, missile command etc. I showed it to my little boy and he couldn't believe that the "first" computer games looked like that :lol: .

Maurice 8)

EDIT: Forgot to mention here you can download atari 2600 roms http://www.atarimania.com/rom_collectio ... _roms.html


Top
   
PostPosted: Thu Mar 04, 2010 12:29 pm 
Offline
Archos Guru
Archos Guru

Joined: Wed Nov 21, 2007 6:41 pm
Posts: 448
I was disappointed that stella didn't run at full speed, since otherwise it runs perfectly, I think the emulator aims at full accuracy and the atari 2600 has weird hardware and very unusual display technology, so we'd probably need to hack it to disable full accuracy to get more speed.

An emulator I found that does run full speed is the Commodore 64 emulator Frodo, but it needs hacking to display properly fullscreen on the archos, since it uses 8bit graphics and the archos display has 16bit pixels.

If I get some time I think I can patch it, here's how to compile it with the cross-compiler, assuming you have set the cross-compiler up to compile stella as described above and installed the SDL libs:

Code:
tar xvf FrodoV4_1b.Src.tar.gz
cd Frodo-4.1b/Src
export PATH=~/staging_dir/bin:~/toolchain_build_arm_nofpu/bin:/bin:/sbin:/usr/bin:/usr/sbin
./configure --host=arm-linux --x-libraries=. --x-includes=.


Now you must edit Makefile and add this line near the top (just above 'CXX = arm-linux-g++'):

Code:
CC     = arm-linux-gcc


then run make:

Code:
make -j2


It creates 3 executables, Frodo, FrodoPC and FrodoSC which do different levels of emulation (see the docs in the doc/ directory for explanation), it creates 2 copies in the Src/ directory and in the directory above it ../, you should execute './Frodo' from the directory above since the ROM files are stored there.

(To compile on the native compiler on the archos605 itself, just run './configure --x-libraries=. --x-includes=.')

To run a .d64 game downloadable from eg http://www.64apocalypse.com/bestever5.htm you need to set it as the the first disk in Drive8 in ~/.frodorc

DriveType8 = D64
DrivePath8 = ./bubbob.d64

Then when you launch the emulator hit 'shift + esc' on a pc (I need to map this to a key on the archos), hit f10 to exit the emulator.

(When recompiling for the pc run 'make distclean' first, and then run './configure', 'make')

A tip for transferring files between the archos and pc:

Code:
python -m SimpleHTTPServer


will share the current directory over http via port 8000, so assuming port 8000 is not blocked by your firewall, then from an archos ssh session you can just type:

Code:
rm Frodo
wget http://ip.of.your.pc:8000/Frodo
chmod +x Frodo


each time you want to transfer the executable after a new compile. (You can also share files from the archos like this, in fact you just have to type 'share' since I defined a function for it in setpaths.sh)

edit. for Frodo to display properly on the archos we need to edit Src/Display_SDL.i , eg changing

screen = SDL_SetVideoMode(DISPLAY_X, DISPLAY_Y + 17, 8, SDL_DOUBLEBUF);

to

screen = SDL_SetVideoMode(640, 480, 16, SDL_FULLSCREEN);

but we also need to edit the actual display algorithms to use 16bit pixels, which I'll look into sometime.


Top
   
PostPosted: Fri Mar 05, 2010 4:53 am 
Offline
Archos User
Archos User

Joined: Mon Nov 19, 2007 5:51 pm
Posts: 53
I hadn't dropped in here for a little while and now you got this going! Great work, sideways, seems to work quite well. Never had an NES but galaga was always one of my favourite arcade games...


Top
   
PostPosted: Sun Mar 07, 2010 12:26 am 
Offline
Archos Guru
Archos Guru

Joined: Wed Nov 21, 2007 6:41 pm
Posts: 448
mr_nobody wrote:
I hadn't dropped in here for a little while and now you got this going! Great work, sideways, seems to work quite well. Never had an NES but galaga was always one of my favourite arcade games...


thanks, needs a little more speed, but not bad for now.

btw For easier controls see this post above where I posted an updated binary that reads the touchscreen for A & B buttons (fire & jump etc), you can still use the keys for direction control (and A & B if you want), and in fact the touchscreen and keys can be pressed simultaneously.

I also worked out how to stop it shutting down when on battery power, edit /mnt/data/hack.sh and change line

killall -SIGSTOP avos
to
kill -SIGSTOP `pidof -s avos`

and change line

killall -SIGCONT avos
to
kill -SIGCONT `pidof -s avos`

(those are backticks, not single quotes)

edit: remember to set battery power to "never" off otherwise it may suspend as soon as you exit a game (the "never off" setting is available in 2.1.04 firmware, not sure about earlier)

I think it will be easier to launch the emulator from a pdf file NES.pdf rather than GFT3 each time, and will make it easy to install for people with the moldy cheese hack (since you just have to edit the script /opt/usr/bin/pdf) , so I'll post a guide soon, along with some other stuff which will be of use to hobbyists & hackers.


Last edited by sideways on Sun Mar 07, 2010 2:30 am, edited 2 times in total.

Top
   
PostPosted: Sun Mar 07, 2010 1:40 am 
Offline
Archos User
Archos User

Joined: Mon Nov 19, 2007 5:51 pm
Posts: 53
Yep, I'm using the updated version with touchscreen controls. I'll check out those hack.sh changes re: battery. I agree that launching via pdf is preferable so will look forward to updated instructions. Cheers!


Top
   
PostPosted: Thu Mar 18, 2010 3:01 pm 
Offline
Archos Guru
Archos Guru

Joined: Wed Nov 21, 2007 6:41 pm
Posts: 448
I made major improvements to the emulator and redesigned the installer to facilitate general "homebrew" app installs, so I've started a new thread:

viewtopic.php?f=34&t=31786

Still post here if there are specific questions/observations about anything posted in this thread.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 39 posts ]  Go to page Previous 1 2

All times are UTC+01:00


Who is online

Users browsing this forum: Google [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited