Windows Mobile Port for OTTD r18674 (03jan2010)

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

rwt33
Engineer
Engineer
Posts: 3
Joined: 30 Jul 2009 01:58

Windows Mobile Port for OTTD r18674 (03jan2010)

Post by rwt33 »

Hi all,
I have successfully ported 0.7.2-RC2 to Windows Mobile. I have tested it in both the WM5.0 emulator at 320x240 (tiny) and on my WM6.5 HTC HD at 800x480.

Background
I started by getting the source provided by esoftinteractive working (0.6.0-beta) and then patched the changes and a few others to 0.7.2-RC2. The port uses the usual SDL, zlib, libpng and freetype libs. I built the SDL lib myself and found suitable zlib, libpng and freetype dlls.

Patch
Ok guys, the patch is attached. It was generated against 0.7.2-RC2 svn checkout. Simply use tortoisesvn or similar to apply patch.
eThe project is for Vis Studio 2008 with the WM5.0 SDK. After opening check the "Compiler|Proprocessor|Defines" and "Linker|Additional Dependencies" for the required dependencies. Either get/compile the libs yourself or use the "usefuls_wm"
I compiled SDL myself using the sources from libsdl.org, and zlib and libpng from http://www.tenik.co.jp/~adachi/wince/
A working install cab is also attached. The original ttd files are also obviously still needed.

Tips
- If you get "Error 0x8007007e" you need to make sure the following dlls are in the same dir as openttd.exe:
lpngce.dll
zlibce.dll
SDL.dll
msvcr90.dll - This is in "\Program Files\Microsoft Visual Studio 9.0\VC\ce\dll\armv4i" (will hopefully remove dependency of this eventually)
- If you get sound issues, try disabling the sound driver either in the cfg file (sounddriver="null") or by simply excluding win32_s.cpp from the project

Further work
Sound works but midi music doesn't. If someone wants to get this going go for it.
I was also interested in providing an OpenGL ES compatible SDL (the 1.2.x SDL uses the old GAPI API) which could make for some nice play on the new HTC devices. Please let me know if you're keen to work on or have any experience with OpenGL ES and or SDL 1.3.x on WinCE
I haven't tested actually 32-bit grf files, but I have tried setting 32-bit blitters with some success. Let me know if people are having any luck with this

If many people have a go with it and it gets perfected and cleaned up we might be able to have a go at bringing it into the main trunk!

Worth knowing about my efforts
It's worth mentioning that I'm not going to put any time into implementing features such as "making it more finger friendly" or "option to bring up input panel" etc. I'd really appreciate someone else to come in, grab the patch and give it a whirl themselves. Still, feel free to post requests etc as someone might then feel motivated to do them.

History
9\08\09: Added networking support - patch v3 and cab
6\08\09: Patch v2 with sound fix, added usefuls_wm_v1.zip
6\08\09: List of required dlls
5\08\09: Patch v1 posted
31\12\09: Lampje does a brilliant job of continuing porting development and provides new binaries. Thread title renamed to "Windows Mobile Port"

Rob
Attachments
usefuls_wm_v1.zip
(249.8 KiB) Downloaded 714 times
opentt_wm5_installer.zip
- added networking
(1.83 MiB) Downloaded 1390 times
openttd-0.7.2-RC2_wm5.0_v3.diff
(112.62 KiB) Downloaded 655 times
Last edited by rwt33 on 31 Dec 2009 23:34, edited 11 times in total.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Windows Mobile Port (0.7.x)

Post by DaleStan »

I don't speak for the devs, but I'm guessing that's not going to be particularly interesting.

A patch against trunk, however, has a decent chance of catching the interest of the developers. Especially if it's clean (no unrelated fixes) and follows the coding style, as listed in the wiki.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Windows Mobile Port (0.7.x)

Post by planetmaker »

Salut,
rwt33 wrote:Hi all,
I have successfully ported 0.7.2-RC2 to Windows Mobile. I have tested it in both the WM5.0 emulator at 320x240 (tiny) and on my WM6.5 HTC HD at 800x480.
If I get a good response I'd be more than happy to clean up the code and post patches. I am pretty confident that the existing platform ports should still work as I've made all my changes conditional but haven't tested it.
Nice! Yet another port :-) Definitely you should post your patches. But indeed they're only of real interest to the devs, if you make your patch against latest trunk of OpenTTD as that's the only place where development happens and where changes possibly might make it into the main development repository. Obeying the coding style guidelines of OpenTTD helps also tremendously.
If you can, you should test your modifications also on a, say "normal" windows platform, just to make sure you don't break compilation for existing platforms.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Windows Mobile Port (0.7.x)

Post by Yexo »

rwt33 wrote:Hi all,
I have successfully ported 0.7.2-RC2 to Windows Mobile. I have tested it in both the WM5.0 emulator at 320x240 (tiny) and on my WM6.5 HTC HD at 800x480.
Nice work.
If I get a good response I'd be more than happy to clean up the code and post patches.
There is a bit of a problem, how will you get good response without posting the patches? Mind that as soon as you post a binary you have to post the source too.
Last edited by Yexo on 30 Jul 2009 07:53, edited 1 time in total.
deepblue2k8
Engineer
Engineer
Posts: 44
Joined: 06 Sep 2008 12:41
Location: Hamburg, Germany

Re: Windows Mobile Port (0.7.x)

Post by deepblue2k8 »

hi,

I am as a windows mobile user also interested in this patch. Maybe you could post links for the nessessary dlls and libraries to get openttd compiled for wm.

thanks
User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: Windows Mobile Port (0.7.x)

Post by CommanderZ »

rwt33 wrote:Hi all,
I have successfully ported 0.7.2-RC2 to Windows Mobile. I have tested it in both the WM5.0 emulator at 320x240 (tiny) and on my WM6.5 HTC HD at 800x480.

I started by getting the source provided by esoftinteractive working (0.6.0-beta) and then patched the changes and a few others to 0.7.2-RC2. The port uses the usual SDL, zlib, libpng and freetype libs. I built the SDL lib myself and found suitable zlib, libpng and freetype dlls.

If I get a good response I'd be more than happy to clean up the code and post patches. I am pretty confident that the existing platform ports should still work as I've made all my changes conditional but haven't tested it.

Rob
Gooood, It felt really bad to play the 0.6.0 beta 4 in the age of 0.7.2.

I tried to create a new port myself once, but failed.

And welcome to the forums, congrats for a great entree :)

PS: Does multiplayer work?
Tvel
Engineer
Engineer
Posts: 77
Joined: 29 Mar 2008 22:42
Skype: tvel___
Location: Bulgaria

Re: Windows Mobile Port (0.7.x)

Post by Tvel »

Good work, waiting for the binary now :P

The 0.6.0-beta one worked on WinCE too, does this one?
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Re: Windows Mobile Port (0.7.x)

Post by TrueBrain »

esoftinteractive did not the best job in creating clean, readable and usable code. I hope you can top that. I once spent some time on WinCE port myself .. failed mostly, because it kept on crashing for reasons I couldn't figure out ;) So I hope you can supply us with clean working patches, if possible against trunk ;)
The only thing necessary for the triumph of evil is for good men to do nothing.
acabin
Engineer
Engineer
Posts: 27
Joined: 05 Mar 2009 18:40

Re: Windows Mobile Port (0.7.x)

Post by acabin »

I'm lovin' it!!!
I speak Chinglish...
Crazy Photon
Engineer
Engineer
Posts: 19
Joined: 27 Apr 2009 23:49
Location: Montevideo, Uruguay
Contact:

Re: Windows Mobile Port (0.7.x)

Post by Crazy Photon »

If I get a good response I'd be more than happy to clean up the code and post patches.
Please do, if you can also provide a .cab file, even better :)
Resistance is NEVER futile...
kenny_23
Engineer
Engineer
Posts: 5
Joined: 05 Aug 2009 08:26

Re: Windows Mobile Port (0.7.x)

Post by kenny_23 »

Hi, I really would apriciate a WM Port of 0.7.x .
If you could make this happend you will be my hero !

:bow:

Thanks in advance, Kenny_23
acabin
Engineer
Engineer
Posts: 27
Joined: 05 Mar 2009 18:40

Re: Windows Mobile Port (0.7.x)

Post by acabin »

I compiled it, but it cannot run.
error 0x8007007e
I speak Chinglish...
kenny_23
Engineer
Engineer
Posts: 5
Joined: 05 Aug 2009 08:26

Re: Windows Mobile Port (0.7.x)

Post by kenny_23 »

Hi,
I installed the CAP file you kindly provided on my SE Xperia with WM 6.1 .
Seems that everything is running, except that the game won't recognize the phone buttons anymore.
( D-Pad for scrolling, Center for rightclick emulation )
This was working with the 6-beta version from Esoft.
I opend the config-file as txt, but the only thing I could find that semed related was "right click emulation"
wich i set to "true", but that diden't solve the problem. :cry:
There is a way to fix this ?

Many thanks in advance Kenny_23

PS: Please excuse my english... :oops:
rwt33
Engineer
Engineer
Posts: 3
Joined: 30 Jul 2009 01:58

Re: Windows Mobile Port (0.7.x)

Post by rwt33 »

Re: keys on phone issue.
Unfortunately the phone I have (HTC Touch HD) doesn't have any keys on it any way so I have no way of testing this. If someone's interested in having a look and make some headground, let me know

Cheers,
Rob
Antimus
Engineer
Engineer
Posts: 1
Joined: 07 Aug 2009 12:56

Re: Windows Mobile Port (0.7.x)

Post by Antimus »

Same problem with mine (HTC Touch Diamond) no hardware keys work. I also can't press any of the menu buttons on the top right, only buttons from Company Info onwards.

Shame :(
acabin
Engineer
Engineer
Posts: 27
Joined: 05 Mar 2009 18:40

Re: Windows Mobile Port (0.7.x)

Post by acabin »

It can run now, but at 320x240 it can't show everything on the screen.
I think I must buy a new phone now....
I speak Chinglish...
jezza333
Engineer
Engineer
Posts: 4
Joined: 03 Jun 2007 01:47

Re: Windows Mobile Port (0.7.x)

Post by jezza333 »

Mate, this is awesome. First I would like to say a big thank you for this release [and to others that have worked on it]. Would it be possible to compile it with network support please? [or am I doing something wrong? :P]

Quick question, how do I pan the screen with a purely touch phone? I have just bought a smart phone for the first time [Omnia i8000, only has Call, End Call, volume control, back and camera buttons] and unfortunately even with pan on edge of screen enabled, it isn't really smooth and panning the map in the map window is not possible with edge pan.... maybe the option to map a phone key as right click? In any case, still VERY cool.

Cheers !
Last edited by jezza333 on 08 Aug 2009 15:02, edited 1 time in total.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Windows Mobile Port (0.7.x)

Post by Yexo »

jezza333 wrote:Mate, this is awesome. First I would like to say a big thank you for this release [and to others that have worked on it]. Would it be possible to compile it with network support please? [or am I doing something wrong? :P]

Quick question, how do I pan the screen with a purely touch phone? I have just bought a smart phone for the first time and having this available for WinMo is just brilliant!
Did you try to enable the option "Advanced Settings->Interface->Interaction->Pan window when mouse is at the edge"?
Crazy Photon
Engineer
Engineer
Posts: 19
Joined: 27 Apr 2009 23:49
Location: Montevideo, Uruguay
Contact:

Re: Windows Mobile Port (0.7.x)

Post by Crazy Photon »

how do I pan the screen with a purely touch phone?
Hi, I faced the same issue (I have an Omnia i900), solved it by enabling left click scrolling. Go to Advanced Settings, Interface, Interaction, Left Click Scrolling: On.

I have not been able to discover how to do a right click though, if someone can enlighten me, it would be great :wink: (tried enabling right click emulation but it didn't work)

EDIT: BTW, thank you Rob for the cab!! :)
Resistance is NEVER futile...
jezza333
Engineer
Engineer
Posts: 4
Joined: 03 Jun 2007 01:47

Re: Windows Mobile Port (0.7.x)

Post by jezza333 »

Yexo wrote:
jezza333 wrote:Mate, this is awesome. First I would like to say a big thank you for this release [and to others that have worked on it]. Would it be possible to compile it with network support please? [or am I doing something wrong? :P]

Quick question, how do I pan the screen with a purely touch phone? I have just bought a smart phone for the first time and having this available for WinMo is just brilliant!
Did you try to enable the option "Advanced Settings->Interface->Interaction->Pan window when mouse is at the edge"?
Yeah, that worked, so I edited my post after I found it :P

It'd be great to have an option to map a phone key [maybe the camera key, useless most of the time] as a right click when the game is running.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 44 guests