The International Simutrans Forum

Development => Bug Reports => Topic started by: YoG on September 19, 2009, 06:09:39 PM

Title: simutans for linux pocket pc (arm architecture)
Post by: YoG on September 19, 2009, 06:09:39 PM
Hi,
I really like simutrans and I would like to run it on my Zaurus machine (which runs ubuntu). I tried the simutrans package from the ubuntu repositories (version 101) as well as a package from the debian repositories (version 102) both ended with segmentation fault when I started simutrans.

here's what I got in the terminal:
Quote
Reading low level config data ...
parse_simuconf() at config/simuconf.tabReading simuconf.tab successful!
Preparing display ...
Screen Flags: requested=10, actual=10
Loading font 'font/prop.fnt'
font/prop.fnt sucessfully loaded as old format prop font!
Init done.
parse_simuconf() at pak/config/simuconf.tabconfig/simuconf.tabReading simuconf.tab successful!
Loading BDF font 'font/Prop-Latin1.bdf'
Unexpected character (255) for 255 character font!
Loading BDF font font/Prop-Latin1.bdf with 255 characters
Reading city configuration ...
Reading speedbonus configuration ...
Reading forest configuration ...
Reading object data from pak/...
Segmentation fault

Can anyone help me setting up simutrans properly (is it possible?)

Thanks,

YoG
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: prissi on September 19, 2009, 07:54:25 PM
You should probably try to compile it yourself. You could also try to disable midi (-nomidi) as SDL_mixer support on ARM might be broken (it has also only 50% chance on x86 ... )

Other than that I was not even aware that there is an ARM-port ... waht kind of byte order are you using? Maybe that is set wrong in the compiling files.

(And starting with "simutrans -debug 3" will give more detailed error messages.)
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: YoG on September 19, 2009, 09:52:25 PM
Thanks for the quick reply, I tried -nomidi and -nosound to no avail, simutrans -debug 3 did not give me any new information (the simu.log file was empty). I don't know the byte order used (how can I check it?).
I installed binaries from the official repositories, currently I'm using the one from the debian squeeze version (http://packages.debian.org/squeeze/simutrans (http://packages.debian.org/squeeze/simutrans)) if it is of any help...

YoG
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: prissi on September 19, 2009, 10:40:54 PM
Well, if compiled with the wrong byteorder, simutrans will still run but will choke on the first pak files. Thus I suspect the byteorder is wrong. Unfourtunately ARM can have both byte orders. To compile yourself I suggest checking out the repository directly, and then compile once with a default.config derived nearly completely from the template and one with the line FLAGS += -DBIG_ENDIAN
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: helifino on September 20, 2009, 01:24:09 AM
Prissi - there's a working .deb of simutrans 100.0 in maemo extras-dev repository - maemo (linux OS for Nokia tablets) runs on arm hardware, too.

(It's barely usable due to the small font size, though)
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: prissi on September 20, 2009, 07:11:53 AM
Well, but ARM can have both byteorders. It depends on the actual achitecture, whether it is switchable or not. Compiled with wrong byteorder, it will still run perfectly, but then crashes upon ready anything none-ASCII from the datafiles. Since this is the position where it crashes, this is my best guess.
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: YoG on September 20, 2009, 07:13:31 AM
prissi: Compiling it is a bit too technical form me, maybe I'll try to contact the maintainers...

helifino: Thanks for the pointer, but the maemo 100.0 (i found it in the diablo repository) also segfaults on my machine (zaurus)

YoG
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: wernieman on September 22, 2009, 10:02:26 AM
Do you have a kontackt to the maintainers?

I could try to make a version for you, but I need time ... and it could be that we try different versions ...
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: YoG on September 22, 2009, 04:01:33 PM
I haven't contacted the maintainers yet...
It would be great I if you could compile one for me, I'm willing to test as much versions as it takes...
How do you do the cross-compilation? I'd like to set such a system too (If it's not too complicated...)

Thanks,

YoG
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: wernieman on September 22, 2009, 04:11:38 PM
OT:
Dou you use Gentoo? Then you can look at "crossdev"

(But it donĀ“t create a apple cross-environment)

I could make .. but not this week .....
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: YoG on September 22, 2009, 05:45:19 PM
I'm more of ubuntu guy, but I'm keen on learning new stuff... I'll try setting up a gentoo enviroment and check out this "crossdev" thingy...
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: YoG on September 23, 2009, 08:39:34 AM
I've tried to compile simutrans natively, I added "FLAGS += -DBIG_ENDIAN" to my config.default, as prissi suggested, I also used sdl and mixer_sdl backends, I unchecked the SDL_CONFIG line and I used OSTYPE = linux.

After a long time the compilation failed with:
QuoteCXX simgraph16.cc
simgraph16.cc: In function 'void rezoom_img(unsigned int)':
simgraph16.cc:1029: warning: cast from 'uint8*' to 'PIXVAL*' increases required alignment of target type
simgraph16.cc: In function 'void display_scroll_band(KOORD_VAL, KOORD_VAL, KOORD_VAL)':
simgraph16.cc:1507: error: impossible constraint in 'asm'
make: *** [simgraph16.o] Error 1

How can I solved this?

Thanks,
YoG
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: VS on September 23, 2009, 08:59:24 AM
There is some flag to disable assembly code (which is for x86 only). I think you'll need -DUSE_C
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: wernieman on September 23, 2009, 09:00:11 AM
Please use this Flag too:
-DUSE_C

P.S. VS write it too...
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: YoG on September 23, 2009, 09:29:23 AM
Okay, it works :award:...

but it is very very slow... is there some magic stuff I can make it go faster?

YoG
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: prissi on September 23, 2009, 09:49:09 AM
You can set the frame rate to ten, best in simuconf.tab. But given that the zaurus is 1 400MHz CPU, there is not much to accelerate it, apart from using small pak sets like pak HAJO or pakAbo.
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: wernieman on September 23, 2009, 10:04:41 AM
can you give me your config.default??? please ;o)
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: YoG on September 23, 2009, 10:05:06 AM
Sorry for the newbie question but... where do I find the pak HAJO or pakAbo...
If I'd compile simutrans using COLOUR_DEPTH = 8 instead of 16 will it work better?
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: Spike on September 23, 2009, 10:07:13 AM
Frank's compilation of pakHajo should be on Sourceforge.
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: YoG on September 23, 2009, 10:08:37 AM
wernieman:
I also had to add #include <stdlib.h> to bauer/../dataobj/koord.h for it to compile

this is my config.default:
Quote#
# to compile:
# copy this file to config.default and adjust the settings
#

#BACKEND = allegro
#BACKEND = gdi
BACKEND = sdl
BACKEND = mixer_sdl
#BACKEND = x11

#COLOUR_DEPTH = 8
COLOUR_DEPTH = 16

#OSTYPE = beos
#OSTYPE = cygwin
#OSTYPE = freebsd
OSTYPE = linux
#OSTYPE = mingw
#OSTYPE = mac


#DEBUG = 3    # Level 1-3, higher number means more debug-friendly, see Makefile
#OPTIMISE = 1 # Add umpteen optimisation flags
#PROFILE = 1

# Define these as empty strings, if you don't have allegro/sdl-config
#ALLEGRO_CONFIG = allegro-config
SDL_CONFIG = sdl-config

#VERBOSE = 1

# Do not determine dependencies
# Header dependencies get NOT tracked this way, so if a header changes you're
# on your own (i.e. manually run a make clean)
# Uncomment this if this stage takes exceptionally long, which happens on some
# broken filesystems
# NO_DEPS = 1

# Following flags exists
# DOUBLE_GROUNDS: Enables two height tiles
# HALF_HEIGHT: Enables half height tiles (8 pixel instead 16)
# OTTD_LIKE: Enables half height tiles and crossconnected industries; defaul folder pak.ttd/
# DESTINATION_CITYCARS: Citycars can have a destination (not recommended)
# USE_C: no assembler for copying
# BIG_ENDIAN: MUST by set for PPC/Motorola byte order! (old mac, amiga)
# STEPS16: 16 steps per tile - nicer on pak64
FLAGS =  -DSTEPS16
FLAGS += -DBIG_ENDIAN
FLAGS += -DUSE_C
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: wernieman on September 23, 2009, 10:30:15 AM
use use 2 Frontends ...
BACKEND = sdl
BACKEND = mixer_sdl


If you need no sound, then please use sdl, if you need then mixer_sdl.

You have problem with speed, so test with no sound!

And I think it would good to enable this:
#OPTIMISE = 1 # Add umpteen optimisation flags

Title: Re: simutans for linux pocket pc (arm architecture)
Post by: YoG on September 23, 2009, 10:41:39 AM
I'll try that... Do I have to do "make clean" before recompiling, or can I just do make?

YoG.
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: wernieman on September 23, 2009, 11:06:03 AM
Better is "make clean; make"

only if it need much time, then only use make .....
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: prissi on September 23, 2009, 02:05:09 PM
Depending on your device, 8 bit may speed up drawing, if you screen can be switched to 8 Bit. Otherwise very little gain is obtained. Optimizing will give of course a noteable boost for GCC compilation. You can also try to leave debug-information out, which will remove some asserts and debug printing operations, that could gain a little extra speed (and reduces program size by 100 kB or so).

I would forget about mixer_SDL; noises you should also on SDL, mixer is only needed for MIDI-support, which is usually in software on Linux and thus extremely slow on weak devices.
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: YoG on September 24, 2009, 03:09:34 PM
I removed the sdl_mixed setting, added the optimization and also tried with debug=0 and 1 (How do I disable debug?). The binary is now huge ~18MB is that normal? (the previous ones were ~2MB). Also, I didn't see any improvement in the performance.
On the bright side, I found that using pak32 the game is playable.
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: YoG on September 24, 2009, 03:27:44 PM
Oh, and another problem, I have to run simutrans from within /usr/share/games/simutrans, otherwise simutrans doesn't find the data folders and I get "No pak set found", if I point it using -objects switch I get "Unable to load any language files"... only if I put the binary inside /usr/share/games/simutrans and start it from there the games starts... Any suggestions?

Thanks,
YoG
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: prissi on September 24, 2009, 08:13:18 PM
make a script

inside the following lines

cd /usr/share/games/simutrans
/pathtoyourexe/sim -use_workdir -log 1 -debug 0 -nomidi -fps 10

This should work too. The 18MB size are the symbol tables. use "strip sim" to remove them. They are only need for profiling and debugging.

Since your need any speed you can get, I suggest DEBUG=0, PROFILING=0 and OPTIMZE=1
Title: Re: simutans for linux pocket pc (arm architecture)
Post by: wernieman on September 24, 2009, 08:43:53 PM
OT:

Sorry for writing in this Thread, but somebody how want to compile could read it ...

What is the normal used Flags? So you cold read the Bug-Threads??

DEBUG=1, PROFILING=0 and OPTIMZE=1

Ore????