Compiling TTDPatch on Linux
Moderator: TTDPatch Moderators
Compiling TTDPatch on Linux
In my recent quest of GROSS (Get Rid Of Slimy windowS; spaceman-spiff will know where I got this from), precipitated by Windows becoming even less stable than it used to be, I've decided to compile as much of the patch natively under Linux, and run it through wine or vmware.
So I've made a quickie page with instruction for building a gcc cross compiler to do just that, see http://wiki.ttdpatch.net/tiki-index.php ... tchOnLinux
It'll probably be possible to extend this to the DOS version by running the OpenWatcom compilers through wine, but so far at least the Windows version seems to compile. It crashes when running, I think it probably used the wrong zlib or something. I'll fix this tomorrow, now I go sleep.
So I've made a quickie page with instruction for building a gcc cross compiler to do just that, see http://wiki.ttdpatch.net/tiki-index.php ... tchOnLinux
It'll probably be possible to extend this to the DOS version by running the OpenWatcom compilers through wine, but so far at least the Windows version seems to compile. It crashes when running, I think it probably used the wrong zlib or something. I'll fix this tomorrow, now I go sleep.
- spaceman-spiff
- Retired Moderator
- Posts: 20634
- Joined: 28 Jul 2002 07:08
- Location: Belgium
- Contact:
Re: Compiling TTDPatch on Linux
I sure doPatchman wrote:In my recent quest of GROSS (Get Rid Of Slimy windowS; spaceman-spiff will know where I got this from),
Well, back to work, lot's of it in the near future
Re: Compiling TTDPatch on Linux
I did that more then 2 years ago, and now I'm using eComstation.Patchman wrote:In my recent quest of GROSS (Get Rid Of Slimy windowS;..........
Wie zich gelukkig voelt met het geluk van anderen, bezit een rijkdom zonder grenzen. (F.Daels)

Still the best OS around
Still the best OS around
Well,I've re-installed Windows XP on my Desktop for learning the Patch, but given the opportunity, I'd much rather use Linux on that computer aswell. I spend most of my time on my Linux laptop, and I always feel so dirty every time I boot my desktop into Windows for poking around in TTD's internals.
I'd love to see where you can take this, Im sure there are heaps of Linuxers who are a tad irked by having to 'wrestle' with Wine when using TTDPatch. Like me
.
I'd love to see where you can take this, Im sure there are heaps of Linuxers who are a tad irked by having to 'wrestle' with Wine when using TTDPatch. Like me

Currently working under the name 'reldred' on Github, and Discord.
NFO/NML coder, part-time patch writer for JGRPP, and all round belligerent.
14:40 <orudge> I can't say I discriminate against any particular user
14:41 <Aegir> orudge: I can!
NFO/NML coder, part-time patch writer for JGRPP, and all round belligerent.
14:40 <orudge> I can't say I discriminate against any particular user
14:41 <Aegir> orudge: I can!
Well, just because you could compile TTD Patch under Linux, doesn't mean you could run it and TTD directly under Linux without an emulator like Wine, does it?
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
Wine Is Not an Emulator. But no, you still need wine or vmware to run TTD. Or DOSBox or dosemu or something.
While it might be possible to take the DirectX wrapper around TTD/Win and modify it into a Linux wrapper, I doubt anyone feels like doing that. It runs well enough in wine for most people, and even better in vmware.
While it might be possible to take the DirectX wrapper around TTD/Win and modify it into a Linux wrapper, I doubt anyone feels like doing that. It runs well enough in wine for most people, and even better in vmware.
VMWare was alright, but I found that Wine out-performed it by miles, the mouse scrolling wasnt so hyper-sensitive, and overall performance was better.
Use what works I suppose.
Edited due to silly typo. I hate 5am starts...
Use what works I suppose.
Edited due to silly typo. I hate 5am starts...
Currently working under the name 'reldred' on Github, and Discord.
NFO/NML coder, part-time patch writer for JGRPP, and all round belligerent.
14:40 <orudge> I can't say I discriminate against any particular user
14:41 <Aegir> orudge: I can!
NFO/NML coder, part-time patch writer for JGRPP, and all round belligerent.
14:40 <orudge> I can't say I discriminate against any particular user
14:41 <Aegir> orudge: I can!
I've now succeeded in compiling OpenWatcom on Linux and it builds the DOS version of the patch. It goes fine up to the point where TTD is supposed to start running (i.e. the cfg parsing and writing etc. all works fine). But I'll get that fixed too. For instructions on compiling OpenWatcom see the wiki (linked in the first post).
Stability and speed. Plus, somone in the end might be crazy enough to make a loader for TTD under Linux.Saskia wrote:What is the advantage of an native Linux Patch, if the game itself still needs WINE?
Currently working under the name 'reldred' on Github, and Discord.
NFO/NML coder, part-time patch writer for JGRPP, and all round belligerent.
14:40 <orudge> I can't say I discriminate against any particular user
14:41 <Aegir> orudge: I can!
NFO/NML coder, part-time patch writer for JGRPP, and all round belligerent.
14:40 <orudge> I can't say I discriminate against any particular user
14:41 <Aegir> orudge: I can!
One such loader exists already, using the DOS version and GGI for the graphics. It hasn't been maintained in ages though, so it doesn't work with anything more recent than TTDPatch 1.6 or 1.7. But now that I'm all Linux I might find it useful to work on it again. I believe I still have the old sources...
- orudge
- Administrator
- Posts: 25218
- Joined: 26 Jan 2001 20:18
- Skype: orudge
- Location: Banchory, UK
- Contact:
Hmm, a message on the 27th September 2003 which I now notice is from Pasky of OpenTTD fame:
The files still seem to be there...pasky wrote: Hi,
I'm working on Daniel Mantione's TTD Linux loader (I'm doing just
cleanups mostly yet, 90% of the work is Daniel's so far). It is a gadget
which allows you to run TTD on Linux *native* - it does not need dosemu
or wine or anything like that, just TTD itself (DOS version) and working
framebuffer. My latest release was loadtycoon-0.4, which works quite
fine already - you can get it at
http://pasky.ji.cz/~pasky/dev/ttd/loadt ... .4.tar.bz2. Basically
everything should work (event network or UNIX-style filesystem in file
selector), except sounds (I'm in the middle of disassembling the TSRs to
decypher how could it work) and... ttdpatch.
Okay, there is some ttdpatch integrated to the original loadtycoon
(Daniel said Josef Drexler himself did the port, and there is still some
residual LINTTDX support in stock ttdpatch. However it is really
ancient and I wasn't even able to place presignals there - frustrating.
So I tried to port ttdpatch 2.0beta6 to loadtycoon, and I think I got
quite far. However, I got stuck now and I really have no idea how to
progress. So I would like to ask at least for a hint what could be
wrong or how could I debug it.
The latest loadtycoon which makes use of the new ttdpatch is at
http://pasky.ji.cz/~pasky/dev/ttd/loadt ... p1.tar.bz2. Please see
README regarding how to get it working and HACKING regarding how to
integrate ttdpatch to it.
My LINTTDX fork of ttdpatch (sources) is at
http://pasky.ji.cz/~pasky/dev/ttd/ttdpa ... x1.tar.bz2. It is
2.0beta6, but I would rather first get it working and then port my
changes to 2.0 final (and possibly get them integrated?). I tried to
keep all the changes LINTTDX-wrapped. The only thing which isn't are two
Makefile modifications - USEPROTBIN is changed to zero, LINUX is set to
1 (you would want that as zero by default, I assume) and make all now
creates ttdprotl instead of ttdprotd/ttdprotw.
I decided that it is too complicated to have the ttdpatch loader copy
in loadtycoon/ttdpatch as it was before, it seemed way too complicated.
So I kept everything in ttdpatch, but instead of ttdpatch.c we build
ttdpatcl.c (l like linux + hidden registers punand we don't produce
an executable, but libttdpatch.a. Then we link loadtycoon against that.
I agree that ttdpatcl.c looks a little bit hackish, I wanted to get away
with minimal changes to the old ttdpatch port - I'd like to first get it
working then integrate the fancy things like auxfiles.
I've eliminated usage of ttdpatch.dat for LINTTDX, we memcpy() the
stuff directly at where it is excepted, so IMHO it should be
unneccessary. Then I had to disable initialization of fake_bss, it
caused mysterious segfaults and I didn't manage to find out why. So
I just get away with memset()ing it in loadtycoon. However, then...
SIGILL. Illegal instruction, I have no idea where or why or even how to
debug it. Any help or advice welcomed.
Thanks,
--
Petr "Pasky" Baudis
.
To get something done, a committee should consist of no more than three
persons, two of them absent.
.
Stuff: http://pasky.ji.cz/
There's another thread around here somewhere discussing Patchman's recent work in this area - he now develops and tests the Patch entirely on Linux.
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
Um... I think you broke my sarcasm meter. Good thing I buy them by the gross.krtaylor wrote:There's another thread around here somewhere discussing Patchman's recent work in this area.
Points at OP
"somewhere" indeed!
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Well, it came up this week, so it's fairly recent.
I know what you mean, I can't find it either...

Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there

Does nobody read the title of this topic anymore

Wie zich gelukkig voelt met het geluk van anderen, bezit een rijkdom zonder grenzen. (F.Daels)

Still the best OS around
Still the best OS around
- SuperTycoon
- Chief Executive
- Posts: 733
- Joined: 24 Jun 2004 20:05
OK, time to stop the sarcasm and get back on topic. 

Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
Who is online
Users browsing this forum: No registered users and 10 guests