OESF Portables Forum

Everything Else => Zaurus - Everything Development => Distros, Development, and Model Specific Forums => Archived Forums => Linux Applications => Topic started by: blakeyez on June 23, 2004, 11:24:37 am

Title: OpenTTD - attn 'josh'
Post by: blakeyez on June 23, 2004, 11:24:37 am
Since the OpenTTD topic disappeared yesterday (I assume due to the forum switch etc), I'm going to start it up again

josh: could you repost that japanese URL with all of the kernel patches and the framebuffer SDL please?  That was a great site!  Certainly the explanations are basically unintelligible from babelfish ("the screen shakes, it shakes!"), but the code is enough!

I was hoping to have my Zaurus today, but looks like those idiots at customs are holding it up for whatever reason (it should have been in Canada on Sunday, and purolator is still saying it's pending customs clearance).  As soon as it gets here I'll definately take a look at your version of OpenTTD - do you have a patch against the codebase that I could take a look at and apply?

Dave
Title: OpenTTD - attn 'josh'
Post by: _Psycho on June 23, 2004, 03:43:23 pm
Quote
Since the OpenTTD topic disappeared yesterday (I assume due to the forum switch etc), I'm going to start it up again

josh: could you repost that japanese URL with all of the kernel patches and the framebuffer SDL please?  That was a great site!  Certainly the explanations are basically unintelligible from babelfish ("the screen shakes, it shakes!"), but the code is enough!

I was hoping to have my Zaurus today, but looks like those idiots at customs are holding it up for whatever reason (it should have been in Canada on Sunday, and purolator is still saying it's pending customs clearance).  As soon as it gets here I'll definately take a look at your version of OpenTTD - do you have a patch against the codebase that I could take a look at and apply?

Dave
If you have a patch thats would be great to get for zports

If its a strait compile, should be easy then !

I saw there was 2 version of TTD
one Tycoon Transport Deluxe, like 5 megs
and Tycoon Transport Deluxe XP, for windows around 10 megs
I hope both work.
Title: OpenTTD - attn 'josh'
Post by: blakeyez on June 23, 2004, 05:24:36 pm
You need the data files from the windows version of TTD in order for OpenTTD to work...

It's not exactly a 'straight compile' as josh discovered.  Since OpenTTD is a direct port of the disassembly of the original TTD (which was originally written in pure asm by Chris Sawyer back in the day), it uses all sorts of packed data and some structs that mix bytes/shorts/longs and then are accessed by pointers.  Since on ARM processors memory access is optimized for dwords, gcc will pad these structs and data gets messed up.  There are a couple other related issues as well.

josh says that his version is running fairly stable now, but that he has probably missed some potential trouble spots.

His original post on the openttd forums is here: http://ttforums.owenrudge.net/viewtopic.php?t=8222 (http://ttforums.owenrudge.net/viewtopic.php?t=8222)
My original post is:
http://ttforums.owenrudge.net/viewtopic.php?t=8207 (http://ttforums.owenrudge.net/viewtopic.php?t=8207)

Dave
Title: OpenTTD - attn 'josh'
Post by: ngok on June 23, 2004, 08:54:13 pm
I've tried it,it works great!good speed with sound effect,only no music.
I use sharp original rom+special kernal patch
tweaked SDL 1.2.5
It needs pnglib too.
at first I can't move the map because I can't do a right click,use the direction key is somehow too slow.
I try other keys,when I push the menu key,I got the "Company League Table" window pop up,then the mouse seem like locked on right click mode,I can move the map with mouse.
when I push the address key,mouse is back to left click mode.
I had a lot fun with it.
Title: OpenTTD - attn 'josh'
Post by: ngok on June 23, 2004, 08:59:42 pm
the kernal patch url
special kernal (http://tetsu.homelinux.org/zaurus/kernel/index.html)
and the tweaked SDL
tweaked libSDL (http://www.piro.hopto.org/~piro/pukiwiki/pukiwiki.php?%5B%5Bqt%CD%D1libSDL%A4%CE%BC%D9%C6%BB%C8%C7%A4%CE%A5%EA%A5%EA%A1%BC%A5%B9%C8%C7%A4%BD%A4%CE%A3%B2%5D%5D)

they are all japanese site.
Title: OpenTTD - attn 'josh'
Post by: josh on June 24, 2004, 02:08:45 pm
Hi, everybody!

Somehow my - extended - first post has vanished. I am too tired to repeat every
detail that I described there.

So I'm just doing a short list:

The ipk link: here (http://www.piro.hopto.org/~piro/zaurus/SDL/libsdl_1.2.5-slzaurus20040609_j_arm.ipk)

The kernel link (for C760): here (http://www.piro.hopto.org/~piro/zaurus/zImage.bin_husky.gz)

(These are the versions that I can confirm to run well on my Z, don't know if
the ones that ngok points to are identical. Somebody check it out?)

After kernel update: "echo 100 >/proc/drivers/w100/fastsysclk".

One more feature of this SDL version: if KeyHelper is present the lib will load on
startup an existing ~/Settings/keyhelper_SDL.xml that you can use to map keys
in a special arrangement for SDL programs. Very handy!


to blakeyez:
I'm crosscompiling on my PC with the Qtopia SDK (2.3.2) and an Arm toolchain from here (http://handhelds.org/download/linux/arm/toolchain).
It's probably faster than working onboard the Z.

to _Psycho:
I'll try and make a patch file for the last release of OpenTTD (0.3.2.1) because
that's what I worked with. It involves creating a special Makefile which I didn't
do properly yet. At the same time I'm heavily covered with work on my job so
don't expect miracles immediately  

to ngok:
The TTD music is only available as good old General MIDI. If you want that as well
you need timidity on your Z to simulate a synth chip. I would estimate that the
game won't be running faster with it  
If you want to move on the map with the arrow keys try holding SHIFT; the step
size increases.
Title: OpenTTD - attn 'josh'
Post by: yzord on June 25, 2004, 12:42:03 pm
Thanks josh, and everyone involved for making this port to the Z.
Just wanted to report that running it with standard Cacko rom 1.21b kernel and the zports SDL version (libSDL_1.2.6-zports-5_arm.ipk) seems to work fine. I played a short (~1hour) game last night and it was very stable (never crashed, hiccuped, etc).

Miss the music, but I figured as well that since they were GM files, that they'd need a midi emulator. Thanks for confirming.

Yz
Title: OpenTTD - attn 'josh'
Post by: ikm on July 17, 2004, 09:00:25 am
Quote
Miss the music, but I figured as well that since they were GM files, that they'd need a midi emulator. Thanks for confirming.
But certainly you can digitize the GM music and compress it with mp3. It would work nice then, after tweaking openttd to make it actually playing it.

2josh: is the diff for the Zaurus OpenTTD available? I would like to compile it for the pdaXrom.
Title: OpenTTD - attn 'josh'
Post by: josh on July 19, 2004, 10:23:36 am
Quote
2josh: is the diff for the Zaurus OpenTTD available? I would like to compile it for the pdaXrom.
I'm right now working with version 3.3 and hope to get a diff ready.

Unfortunately I have to deal with too many real life issues as well ...
So I can just beg for patience  
Title: OpenTTD - attn 'josh'
Post by: _Psycho on July 19, 2004, 11:27:58 am
No rush, Myself never had time to do stuff anymore. Anyway, Thats would be great if we could put your package on zports ! Once you think its ready

For the SDL tweak i know mteira did some test a couples of day ago.
Does the "echo 100 >/proc/drivers/w100/fastsysclk", improve the speed a lots ? (with the kernel tweak) ? Does the same thing work with the cacko kernel ?
Title: OpenTTD - attn 'josh'
Post by: josh on July 23, 2004, 05:44:37 pm
Quote
Does the "echo 100 >/proc/drivers/w100/fastsysclk", improve the speed a lots ? (with the kernel tweak) ? Does the same thing work with the cacko kernel ?
It adds to the more important feature of the special kernel:
the rotation in hardware. The trouble is always the native portrait
orientation of the screen. Everything which wants to use landscape
mode must rotate every frame ...

The SDL packs that I checked out do the rotation pixel by pixel; even
Qtopia does that.

Piro claims to do the rotation via hardware; obviously that is not possible
without special access to the graphics driver; thus the special kernel.

My tests with "testsprite" gave me 28 fps with a plain vanilla SDL,
around 35 fps with Piro's SDL and kernel and 38 fps with the additional
"fastsysclk" increase. The difference is obvious if you scroll OpenTTD
in pause mode (without the load of gameplay).

I replaced the kernel  (JUST the kernel) of my cacko 1.21  with it and
did not run in any problems whatsoever.

Piro warns about incompatibility of the high "fastsysclk" setting, but I
did not find any so far. It might affect the power consumption though.

---

By the way, OpenTTD 3.3 is running fine. And this time I tried to get the
fixes right and keep i386 compatibility of the makefile and all.

Now I'm going to check out diff  
Title: OpenTTD - attn 'josh'
Post by: ikm on July 24, 2004, 06:55:30 pm
Quote
Unfortunately I have to deal with too many real life issues as well ...
So I can just beg for patience 
Sure! You're not alone with that sort of problems, you know
Title: OpenTTD - attn 'josh'
Post by: tovarish on December 21, 2004, 08:24:56 pm
Quote from: josh,Jul 23 2004, 10:44 PM
Quote from: _Psycho,Jul 19 2004, 07:27 AM

I replaced the kernel  (JUST the kernel) of my cacko 1.21  with it and
did not run in any problems whatsoever.

 
hi i did the same thing for my c860 but i can't access the overclock applet. Everytime I do that qte restarts (just qte and not a reboot).

any ideas what could be done to fix this

tovarish
Title: OpenTTD - attn 'josh'
Post by: tovarish on December 30, 2004, 09:40:56 am
hi josh

can you give me ur patches for openttd, I am trying to compile the latest version

thanks,
tovarish