Compiling TTDPatch on Linux

Get help, info, news and advice about the Transport Tycoon Deluxe patch.

Moderator: TTDPatch Moderators

Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Compiling TTDPatch on Linux

Post by Patchman »

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.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
spaceman-spiff
Retired Moderator
Retired Moderator
Posts: 20634
Joined: 28 Jul 2002 07:08
Location: Belgium
Contact:

Re: Compiling TTDPatch on Linux

Post by spaceman-spiff »

Patchman wrote:In my recent quest of GROSS (Get Rid Of Slimy windowS; spaceman-spiff will know where I got this from),
I sure do
Well, back to work, lot's of it in the near future
User avatar
Rob
Tycoon
Tycoon
Posts: 4355
Joined: 31 Dec 2002 16:52
Location: Ven-Zelderheide, The Netherlands

Re: Compiling TTDPatch on Linux

Post by Rob »

Patchman wrote:In my recent quest of GROSS (Get Rid Of Slimy windowS;..........
I did that more then 2 years ago, and now I'm using eComstation.
Wie zich gelukkig voelt met het geluk van anderen, bezit een rijkdom zonder grenzen. (F.Daels)
Image
Still the best OS around
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

So did I, except for the patch development.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
Aegir
Tycoon
Tycoon
Posts: 2884
Joined: 09 Feb 2004 10:02
Contact:

Post by Aegir »

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 ;).
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!
User avatar
krtaylor
Tycoon
Tycoon
Posts: 11784
Joined: 07 Feb 2003 01:58
Location: Texas, USA
Contact:

Post by krtaylor »

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
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

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.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
Aegir
Tycoon
Tycoon
Posts: 2884
Joined: 09 Feb 2004 10:02
Contact:

Post by Aegir »

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...
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!
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

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).
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
Saskia
Director
Director
Posts: 523
Joined: 22 Feb 2004 14:23
Location: Cologne, Germany
Contact:

Post by Saskia »

What is the advantage of an native Linux Patch, if the game itself still needs WINE? :oops:
User avatar
Aegir
Tycoon
Tycoon
Posts: 2884
Joined: 09 Feb 2004 10:02
Contact:

Post by Aegir »

Saskia wrote:What is the advantage of an native Linux Patch, if the game itself still needs WINE? :oops:
Stability and speed. Plus, somone in the end might be crazy enough to make a loader for TTD under Linux.
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!
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

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...
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
orudge
Administrator
Administrator
Posts: 25138
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Post by orudge »

Hmm, a message on the 27th September 2003 which I now notice is from Pasky of OpenTTD fame:
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 pun ;) and 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/
The files still seem to be there...
User avatar
Saskia
Director
Director
Posts: 523
Joined: 22 Feb 2004 14:23
Location: Cologne, Germany
Contact:

Post by Saskia »

Now would be a good time to continue this project, because WINE + Patch doesn't work anymore for me :wink:
User avatar
krtaylor
Tycoon
Tycoon
Posts: 11784
Joined: 07 Feb 2003 01:58
Location: Texas, USA
Contact:

Post by krtaylor »

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
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

krtaylor wrote:There's another thread around here somewhere discussing Patchman's recent work in this area.
Um... I think you broke my sarcasm meter. Good thing I buy them by the gross.
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
User avatar
krtaylor
Tycoon
Tycoon
Posts: 11784
Joined: 07 Feb 2003 01:58
Location: Texas, USA
Contact:

Post by krtaylor »

Well, it came up this week, so it's fairly recent. :wink: 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
User avatar
Rob
Tycoon
Tycoon
Posts: 4355
Joined: 31 Dec 2002 16:52
Location: Ven-Zelderheide, The Netherlands

Post by Rob »

:shock:
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)
Image
Still the best OS around
User avatar
SuperTycoon
Chief Executive
Chief Executive
Posts: 733
Joined: 24 Jun 2004 20:05

Post by SuperTycoon »

Rob wrote::shock:
Does nobody read the title of this topic anymore :?:
do i detect a hint of sarcasm?
Image
User avatar
krtaylor
Tycoon
Tycoon
Posts: 11784
Joined: 07 Feb 2003 01:58
Location: Texas, USA
Contact:

Post by krtaylor »

OK, time to stop the sarcasm and get back on topic. :lol:
Development Projects Site:
http://www.as-st.com/ttd
Japan, American Transition, Planeset, and Project Generic Stations available there
Post Reply

Return to “General TTDPatch”

Who is online

Users browsing this forum: No registered users and 10 guests