The International Simutrans Forum

 

Author Topic: simutans for linux pocket pc (arm architecture)  (Read 10855 times)

0 Members and 1 Guest are viewing this topic.

YoG

  • Guest
simutans for linux pocket pc (arm architecture)
« 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

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9353
  • Languages: De,EN,JP
Re: simutans for linux pocket pc (arm architecture)
« Reply #1 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.)

YoG

  • Guest
Re: simutans for linux pocket pc (arm architecture)
« Reply #2 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) if it is of any help...

YoG

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9353
  • Languages: De,EN,JP
Re: simutans for linux pocket pc (arm architecture)
« Reply #3 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

Offline helifino

  • *
  • Posts: 28
Re: simutans for linux pocket pc (arm architecture)
« Reply #4 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)

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9353
  • Languages: De,EN,JP
Re: simutans for linux pocket pc (arm architecture)
« Reply #5 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.

YoG

  • Guest
Re: simutans for linux pocket pc (arm architecture)
« Reply #6 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

Offline wernieman

  • Devotees (Inactive)
  • *
  • Posts: 713
    • Werniemans-Webside (only German)
Re: simutans for linux pocket pc (arm architecture)
« Reply #7 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 ...

YoG

  • Guest
Re: simutans for linux pocket pc (arm architecture)
« Reply #8 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

Offline wernieman

  • Devotees (Inactive)
  • *
  • Posts: 713
    • Werniemans-Webside (only German)
Re: simutans for linux pocket pc (arm architecture)
« Reply #9 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 .....

YoG

  • Guest
Re: simutans for linux pocket pc (arm architecture)
« Reply #10 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...

YoG

  • Guest
Re: simutans for linux pocket pc (arm architecture)
« Reply #11 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:
Quote
CXX 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

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: simutans for linux pocket pc (arm architecture)
« Reply #12 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

Offline wernieman

  • Devotees (Inactive)
  • *
  • Posts: 713
    • Werniemans-Webside (only German)
Re: simutans for linux pocket pc (arm architecture)
« Reply #13 on: September 23, 2009, 09:00:11 AM »
Please use this Flag too:
-DUSE_C

P.S. VS write it too...

YoG

  • Guest
Re: simutans for linux pocket pc (arm architecture)
« Reply #14 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

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9353
  • Languages: De,EN,JP
Re: simutans for linux pocket pc (arm architecture)
« Reply #15 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.

Offline wernieman

  • Devotees (Inactive)
  • *
  • Posts: 713
    • Werniemans-Webside (only German)
Re: simutans for linux pocket pc (arm architecture)
« Reply #16 on: September 23, 2009, 10:04:41 AM »
can you give me your config.default??? please ;o)

YoG

  • Guest
Re: simutans for linux pocket pc (arm architecture)
« Reply #17 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?

Offline Spike

  • *
  • Posts: 1361
  • First Simutrans Developer and Graphics Artist
Re: simutans for linux pocket pc (arm architecture)
« Reply #18 on: September 23, 2009, 10:07:13 AM »
Frank's compilation of pakHajo should be on Sourceforge.

YoG

  • Guest
Re: simutans for linux pocket pc (arm architecture)
« Reply #19 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

Offline wernieman

  • Devotees (Inactive)
  • *
  • Posts: 713
    • Werniemans-Webside (only German)
Re: simutans for linux pocket pc (arm architecture)
« Reply #20 on: September 23, 2009, 10:30:15 AM »
use use 2 Frontends ...
Code: [Select]
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:
Code: [Select]
#OPTIMISE = 1 # Add umpteen optimisation flags

YoG

  • Guest
Re: simutans for linux pocket pc (arm architecture)
« Reply #21 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.

Offline wernieman

  • Devotees (Inactive)
  • *
  • Posts: 713
    • Werniemans-Webside (only German)
Re: simutans for linux pocket pc (arm architecture)
« Reply #22 on: September 23, 2009, 11:06:03 AM »
Better is "make clean; make"

only if it need much time, then only use make .....

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9353
  • Languages: De,EN,JP
Re: simutans for linux pocket pc (arm architecture)
« Reply #23 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.

YoG

  • Guest
Re: simutans for linux pocket pc (arm architecture)
« Reply #24 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.

YoG

  • Guest
Re: simutans for linux pocket pc (arm architecture)
« Reply #25 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

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9353
  • Languages: De,EN,JP
Re: simutans for linux pocket pc (arm architecture)
« Reply #26 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

Offline wernieman

  • Devotees (Inactive)
  • *
  • Posts: 713
    • Werniemans-Webside (only German)
Re: simutans for linux pocket pc (arm architecture)
« Reply #27 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????