Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Dec 18, 2017 4:38 pm

All times are UTC




Post new topic  Reply to topic  [ 166 posts ]  Go to page Previous 15 6 7 8 9 Next
Author Message
PostPosted: Wed Jul 17, 2013 3:08 pm 
Offline
Moderator
Moderator
User avatar

Joined: Sat Apr 02, 2005 7:01 am
Posts: 3671
Location: Sydney NSW Antipodea
planetmaker wrote:
And even for other palettes, you can simply tell grfcodec which palette to use, read from external palette files:
Code:
Built-in palettes: use -p <number>, where <number> is one of the following:
   1  DOS TTD
   2  Windows TTD
   3  DOS TTD, Candyland
   4  Windows TTD, Candyland
   5  TT Original
   6  TT Original, Mars landscape

External palette files: use -p [type:]filename.
[type:] can be bcp, psp, or gpl.  (Other formats may become available later.)
If the type is omitted, bcp is assumed.

bcp   binary coded palette with the same format as the palette in a PCX
   file: 256 triples of red, green and blue encoded in bytes.
psp   the palette format output by Paintshop Pro
gpl   the palette format output by The GIMP.




Than you OzTrans and planetmaker for the extra info. Will have a go at seeing if I can find the crash date in the exe in a hex editor and try to change that tomorrow.

_________________
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/


Top
   
PostPosted: Wed Jul 17, 2013 5:10 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Sep 28, 2009 5:15 pm
Posts: 5884
Location: Eastern KY
Gurluas2000 wrote:
Unfortunately, my knowledge of coding is VERY meager, and my knowledge of DOS coding is non-existant.
If you asked me to mod World of Warcraft I could do it, which I have but... Decoding a DOS game, I have absolutely no idea how. We have a lot of people who reverse engineered the TTD client, and a lot of people who rewrote the game into OpenTTD, one of them may have an idea?

If I could have done it myself, I would have a long time ago.
I am not asking for help because I am lazy, but because we could unlock a fully playable pre-release version of TTO, a true treasure in the development process of our lovable Transport Tycoon.


;(

i know this is, old but i wanna know... did anyone had sum luck with passing 1932?


In the almost nine years that you've been waiting for somebody else to fix this for you, while bemoaning that you don't have the skills to do it yourself, you could have attended college, obtained a PhD in computer programming, reversed engineered the program and released your own patch. And probably done a bunch more awesome things, including becoming a contributor to TTO/TTD/TTDPatch/OpenTTD.

There is a point where you stop waiting for others to do for you, and you start finding your own way.

_________________
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!
Image

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | RoadTypes?


Top
   
PostPosted: Wed Jul 17, 2013 5:22 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
9 years is enough to collect money and hire somebody to do this.

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD


Top
   
PostPosted: Wed Jul 17, 2013 6:18 pm 
Offline
Chief Executive
Chief Executive
User avatar

Joined: Mon May 31, 2004 8:22 am
Posts: 650
kamnet wrote:
Gurluas2000 wrote:
Unfortunately, my knowledge of coding is VERY meager, and my knowledge of DOS coding is non-existant.
If you asked me to mod World of Warcraft I could do it, which I have but... Decoding a DOS game, I have absolutely no idea how. We have a lot of people who reverse engineered the TTD client, and a lot of people who rewrote the game into OpenTTD, one of them may have an idea?

If I could have done it myself, I would have a long time ago.
I am not asking for help because I am lazy, but because we could unlock a fully playable pre-release version of TTO, a true treasure in the development process of our lovable Transport Tycoon.


;(

i know this is, old but i wanna know... did anyone had sum luck with passing 1932?


In the almost nine years that you've been waiting for somebody else to fix this for you, while bemoaning that you don't have the skills to do it yourself, you could have attended college, obtained a PhD in computer programming, reversed engineered the program and released your own patch. And probably done a bunch more awesome things, including becoming a contributor to TTO/TTD/TTDPatch/OpenTTD.

There is a point where you stop waiting for others to do for you, and you start finding your own way.


Well I've always been horrible at Math, and my job is far away from reverse engineering DOS coding.
But really, I am amazed it's been nine years...

And thanks Roboboy ^^


Top
   
PostPosted: Wed Jul 17, 2013 7:58 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Sep 28, 2009 5:15 pm
Posts: 5884
Location: Eastern KY
Anybody can improve themselves, if they choose to do so. In 2009 I knew nothing at all about GRFCodec, sprites or building a NewGRF. Today I still don't know much at all, but in that time in-between I've managed to learn how to fix and modify a few NewGRFs from other people, and release a few of my own.

Very few people in this world have true talent. The rest of us have to fake it and keep educating ourselves until we are competent.

_________________
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!
Image

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | RoadTypes?


Top
   
PostPosted: Wed Jul 17, 2013 9:46 pm 
Offline
Chief Executive
Chief Executive
User avatar

Joined: Mon May 31, 2004 8:22 am
Posts: 650
I have tried to get Math, believe me.. It just never worked out.
Some people get it, other's don't.


Top
   
PostPosted: Thu Jul 18, 2013 5:23 am 
Offline
Moderator
Moderator
User avatar

Joined: Sat Apr 02, 2005 7:01 am
Posts: 3671
Location: Sydney NSW Antipodea
I am no good at Maths either, but I managed to learn how to program.

_________________
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/


Top
   
PostPosted: Thu Jul 18, 2013 6:18 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5014
Location: Canada
kamnet wrote:
The rest of us have to fake it and keep educating ourselves until we are competent.
After 60+ years I'm still looking for that competent part. The fake part was easy, but now that's getting harder to accomplish as well. :cry:

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016


Top
   
PostPosted: Thu Jul 18, 2013 9:55 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon May 02, 2005 11:05 am
Posts: 15415
Skype: XeryusTC
Location: localhost
Gurluas2000 wrote:
I have tried to get Math, believe me.. It just never worked out.
Some people get it, other's don't.

As with any skill you're trying to learn, at first you will suck, but after a lot of practice you will improve. For some people it is just quicker with math. As someone who is relatively math-minded it also took me a while to understand stuff (higher order differential equations, WTF) but after a lot of studying it eventually clicks :)

_________________
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image


Top
   
PostPosted: Mon Nov 23, 2015 1:40 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Sun Oct 12, 2003 5:16 pm
Posts: 305
Location: Switzerland
I came across another interesting screenshot I thought was worth sharing. It's a scan from issue 17 of a games magazine called Edge, published in February 1995. Note the different-looking small airport and bus terminals!

This means that there are at least two unknown pre-release versions of the game that were sent to press for review.


Attachments:
tto_press_version.jpg
tto_press_version.jpg [ 81.83 KiB | Viewed 16738 times ]

_________________
Image
Top
   
PostPosted: Mon May 29, 2017 11:53 pm 
Offline
Chief Executive
Chief Executive
User avatar

Joined: Mon May 31, 2004 8:22 am
Posts: 650
It's been quite a while! :o

I just remembered about this place one day.
Did anyone else try to hack the TTO demo?


Top
   
PostPosted: Wed Jun 14, 2017 3:42 pm 
Offline
Administrator
Administrator
User avatar

Joined: Fri Jan 26, 2001 8:18 pm
Posts: 23818
Skype: orudge
Location: Banchory, UK
Welcome back, it has been a while!

I'm not aware that anybody has done anything with the old TTO demos.

_________________
Owen Rudge
owenrudge.net | Owen's Transport Tycoon Station | Owen's Locomotion Depot | The Transport Tycoon Wiki


Top
   
PostPosted: Thu Jun 15, 2017 8:37 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Dec 09, 2008 4:20 pm
Posts: 2084
Skype: yes
Location: Slovakia
2004 - George W. Bush is re-elected, Facebook is launched, Taipei 101 becomes the tallest building on Earth, Gurluas2000 bumps this thread wondering if it's possible to play an old TTO demo past 1932

2005 - Angela Merkel becomes the first female Chancellor of Germany, Youtube is launched, The Deep Impact probe collides its impactor with comet 9P/Tempel, Gurluas2000 bumps this thread demanding more info about an old TTO demo

2006 - Saddam Hussein is executed, Twitter is launched, Pluto is no longer considered a planet, Gurluas2000 is here in this thread to witness more screenshots of the pre-alpha TTO demo

2007 - Global economic crisis, Brown succeeds Blair as Prime Minister of Great Britain, Apple debuts the iPhone,

2008 - Dmitry Medvedev is elected Russian president, Cyclone Nargis devastates Burma, oil prices hit record high

2009 - Barrack Obama elected 44th US president, Burj Khalifa becomes the tallest building on Earth, The mouse genome is fully sequenced

2010 - Haiti is struck by a devastating earthquake, Apple debuts the iPad, scientists trap antimatter, Gurluas2000 bumps this thread proposing hacking an old TTO demo with the sole purpose of playing it past 1932

2011 - Japan is devastated by a 9.0 magnitude earthquake and tsunami, Osama bin Laden is killed in a raid, Global population reaches 7bn, Gurluas2000 continues rallying unwilling community members to help him hack an old TTO demo and reach the ultimate goal of playing it past 1932

2012 - The Diamond Jubilee of Queen Elizabeth II, Windows 8 is released, Nintendo launches the Wii U, The Mayan calendar reaches the end of its current cycle

2013 - A meteor explodes over the Russian city of Chelyabinsk, Birth of a royal baby, The NSA documents are leaked, Launch of the PS4 and Xbox One, Gurluas2000 revisits this thread with a simple message: now is the time to hack an old TTO demo and allow him to play past 1932

2014 - The first gay marriages are held in England and Wales, Google Glass is launched to the public, The new World Trade Center is opened, Laser guns are in naval use

2015 - Queen Elizabeth II is the longest reigning monarch in British history, Windows 10 is released by Microsoft, The first self-regulating artificial heart

2016 - Donald Trump is elected 45th US president, UK referendum on withdrawal from the EU passes, Microchipping of all dogs in England, The mining industry is highly automated, Three-person babies

2017 - Women's March is the biggest single-day protest in American history, US withdraws from the Paris Climate Agreement, Gurluas2000 bumps this thread, wondering whether anyone has perchance decided to hack a 1994 TTO demo to play it past 1932

2182 - humanity has ascended to a higher plane of existence, Gurluas2000' uploaded digital personality is in this thread wondering if anyone happened to hack a centuries old alpha TTO demo and let him play past 1932

_________________
Image

Only dumb people quote themselves, and only the truest retards put such quotes in their forum signatures
-Drury


Top
   
PostPosted: Fri Jun 16, 2017 10:48 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon Sep 28, 2009 5:15 pm
Posts: 5884
Location: Eastern KY
This entire thread is a monument to human stubbornness. :)

_________________
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!
Image

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | RoadTypes?


Top
   
PostPosted: Fri Aug 11, 2017 7:57 pm 
Offline
Engineer
Engineer

Joined: Sat Jul 15, 2017 10:45 am
Posts: 11
Out of sheer curiosity, I took a brief look at this and poked at it briefly with a disassembler.

The binary is is a 32-bit Phar Lap DOS extended binary; which unfortunately the freeware version of IDA doesn't support at all. Apparently there's an older IDA Freeware 4.1 which was used for TTDPatch that knew what to do with these files, as well as the commercial version though I can't justify $600 dollars for the full version. The EXP (protected mode executable) starts at approximately 0x1711 (near the string "TNTB.EXE"), followed by the string table and a bunch of other data structures following it.

There's annoying little technical documentation on the Phar Lap executable format which makes this a much bigger pain the arse than it needs to be, since if I could just load it up in IDA, it would be relatively easy to find the bits that whacked with a brick. The game itself doesn't crash when the date hits 1/2/33, more specifically it just suddenly exits out to DOS. Internally, based off what little I could get IDA to decompile, the internal code uses the DPMI standard and not the older VCPI standard which is why it (kinda) works under more recent 32-bit Windows machines that can run DOS binaries. Based on my knowledge of DPMI, it's probably just triggering Int 21h AH=4Ch to tell the DPMI server to bugger off and die and dump back to DOS; I was hoping it *actually* crashed since I could just attach a crash debugger and see what happened.

DPMI is exceptionally weird, but in a nutshell, here's how it works. DOS PC's normally operate in 8086-compatible real-mode, and can only access up to 1 MiB of RAM. When you're running with an actual operating system like Windows 3.1/386, 95, or OS/2, the processor is already in protected mode and DOS applications run in Virtual 8086 mode. This is basically a sandbox to allow multiple DOS applications to run side-by-side (old school Windows users may remember when a DOS app died on Windows 3.1/95, it tended to report DPMI errors). For those of us who played DOOM or Duke Nukem 3D, you might remember seeing messages seeing DOS/4GW messages. That was it's DPMI server starting and stopping.

To actually use all the RAM (up to 32-bits worth on a 80386), you have to enter protected mode. This is where things get interesting. If TT-Demo is running in real DOS, it will launch the Phar Lap extender and setup it's own DPMI server to enter protected mode. However, if TT-Demo is running in DOS emulation more (aka, DOSbox, Windows 3.1, etc), it will notice that theirs a DPMI server already present and use that instead. If this is working the way its supposed to, it should be possible to trap DPMI calls in DOSBox, and get the function pointer of when the game decides quit, and then simply walk the backtrace to find the necessary code segments where the exit code is from.

This is complicated by the fact that TT was written in pure assembler, and probably doesn't use standard prologue/epilogue C declarations so most disassemblers are probably going to have a heart attack trying to figure out what's what. Annoying.

Not sure if I'll take this further but this should give some tips if someone else picks this up.

EDIT: Well I just can't leave well enough alone it seems. Right now, I've found and located 5 five different checks to cause the game to not proceed past 1932. Three of these quit immediately to DOS. The other two I found are more evil, they lock the game in a infinite loop and are fairly well hidden (at least against the tools of the time). I can now play to the end of Jan 1932 *but* the game partially hangs at this point. I can move the mouse but nothing else. Fiddling with the time in memory shows there's a check somewhere that seems to lock us in some sort of pause-like mode but I can't click.

Fiddling with the memory, I found that if I set the time back, the game unfreezes, so it's a runtime check. I have managed to set the clock further into the future, and if the game is paused when I do so it runs for a few seconds before hanging. I dunno how much I'll keep fiddling but this is interesting how much Chris went to prevent this demo from being played. I did look into the GRF. The monorail is only partially implemented; a lot of the GRF stuff is MIA.


Top
   
PostPosted: Sat Aug 12, 2017 2:06 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Tue Dec 09, 2008 4:20 pm
Posts: 2084
Skype: yes
Location: Slovakia
oh wow nice work, I didn't expect someone with knowledge like you to actually stumble upon this thread at this kind of date

what isn't all that unexpected is how the demo is missing a lot of features, I wonder how much there really is

_________________
Image

Only dumb people quote themselves, and only the truest retards put such quotes in their forum signatures
-Drury


Top
   
PostPosted: Sat Aug 12, 2017 4:30 pm 
Offline
Engineer
Engineer

Joined: Sat Jul 15, 2017 10:45 am
Posts: 11
Drury wrote:
oh wow nice work, I didn't expect someone with knowledge like you to actually stumble upon this thread at this kind of date

what isn't all that unexpected is how the demo is missing a lot of features, I wonder how much there really is


As far as I can tell, this is probably a late alpha/early beta probably about six months from shipping. Internally, it looks like most of the functionality is there; most of the ship/planes/RV/train meta data is there though the grfcodec failed to pull the vehicle stats, likely due to the offsets just being different so I got garbage in the NRO file.

There are some interesting bits in the code; there is a fair bit of code to initialize and setup networking and serial ports for multiplayer, and it looks like the GUIs exist for creating and placing roads/ship depots/etc. I'm not sure there's any airport type beyond small though, though at least some definition data exists for things like the Boeing 727.

Interesting, there are some references to OS/2 in the code. It wasn't uncommon for developers to use OS/2 even for DOS games because it was possible to run a debugger inline with executable, and it was quite a bit more stable than Windows 3.1 in this role. I've unfortunately run into a bit of a headache though because DOSBox's debugger is annoyingly limited, and the memory map is wonky. Normally, data is basically loaded in a single segment in protected mode, but there appears to be multiple data segments so I can't get cross-references to line up properly.

Internally, it looks like there are two seperate applications which get loaded and unloaded. The first entry point loads TRTITLE.GRF and displays the opening titles, and then a second segment that has all the game data. This could also just be an artifact of linking depending how Chris laid things out in the assembler since hand-written assembler code can throw out most of the rules you get used to when debugging compiled binaries. I was only able to find the loader functions by finding the DPMI interrupts and tracing backwards.

EDIT: Well I slammed into a brick wall. I need a debugger better than the DOSBox monitor which is ... lacking at best in terms of functionality. I *did* manage to get OpenWatcom's debugger to attach to TRANS.EXE, and successfully read and dump memory. Added bonus is OW at least in theory knows about Phar Lap and knows how to interact it. Unfortunately, it looks like that support bitrotted out of OW2; the trap file is present but the debugger shims are missing. I filed a bug upstream, but I'm going to have to get creative if I want to look at this things guts more in-depth. It looks like the stubs are needed even if I ran the debugger on OS/2 which is unfortunate. I might be able to force a "trap to debugger" by hexediting in the int 3 call, but that will have to wait until I get home.


Top
   
PostPosted: Sat Aug 12, 2017 8:10 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5014
Location: Canada
I've seen Ollydbg being used with ttdpatch. There are probably some references to it in these forums. DaleStan seemed to be a fan of the tool. I don't know if this would be of any help.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016


Top
   
PostPosted: Sat Aug 12, 2017 9:58 pm 
Offline
Engineer
Engineer

Joined: Sat Jul 15, 2017 10:45 am
Posts: 11
Thanks for the tip. I'll keep it in mind.

The largest problem is OllyDbg is really meant to be run on Windows applications, and not DOS ones, and it has to attach to a process, not simply act as a static disassembler. The only way I could use this is to setup a 32-bit version of Windows, and given that the original TT-Demo is kinda flakely on Windows to begin with, I rather not add additional variables to the mix. In all likelyhood, I'd probably have to dig out Windows 95/98 to use it, and then I'm stuck in the DOS penalty box which drastically complicates debugging efforts. I might be stuck going down that route though if I want to power on.

I did talk to the OpenWatcom guys, and I got the remote debugger setup, and I now got SOME useful trace info out of TT. The problem though is for full functionality, I need what's known as a trap files for the DPMI server. Without it, I can get crash reports (which is how TTD guys used OllyDbg), but not full debugging. I have the Watcom side of it, but I'm missing the Phar Lap side. Basically, in the world of old-skool DOS, you couldn't just take something like OllyDbg and plug it into any application. Instead you had to have a special shim that wedged itself between the extender (Phar Lap) and your app (TT Demo). That let's you set breakpoints and watchpoints which are stupidly useful (I'll likely need working watchpoints to re-enable non-train play).

The trap server was part of the Phar Lap 386|Extender SDK which appears to have more or less fallen off the internet. There are some newer ones floating, but I probably need a version of the DPMI trap that matches what TT Demo used. I'm not even sure if later TTD used Phar Lap or changed to something else.

That being said, I have isolated some interesting bits of code. Intentionally causing a crash MIGHT get me the magic bits I need to plug into IDA to get everything to line up. I know TTDPatch was originally developed with IDA so I'm probably going down the right path here, but reverse engineering is a black at best, and utter magic at worst. Now that I'm home, I'm going to try and shoehorn in a crash and see if I can grab it with WDC, that should let me get a better idea of the memory layout.

Well. Partial success. Popping an 'int 3' shell into the demo did crash it and I got a trace dump to screen as Phar Lap went belly up. wdw didn't see it though. I might be stuck with the DOSbox debugger but that makes me less than happy :/


Top
   
PostPosted: Mon Aug 14, 2017 12:04 pm 
Offline
Engineer
Engineer

Joined: Thu Jun 04, 2009 10:59 am
Posts: 51
Location: NSW, Australia
Wow, you're a boss :D I hope this does amount to something, not because I'm gonna start playing the TTO demo but because I love seeing someone work on a really difficult problem, explain their thought process in an interesting way as they work through it, and finally solve it!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 166 posts ]  Go to page Previous 15 6 7 8 9 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2017 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2017.
Hosted by Zernebok Hosting.