Go to file
Justin Gottula 625337bb69 Cleanup loco.exe file (#6)
Amend loco.exe to reduce the size by removing all unnecessary data from it.
This is a squashed merge from the following 3 commits:

* Remove SecuROM section headers and zero the sections' contents
  ec5c8c4713 

The .lbceac and .bxfkm sections in the retail CD version of Loco.exe
exclusively contain code and data (respectively) for the SecuROM copy
protection scheme, used by Locomotion.

This EXE has already had the SecuROM copy protection mechanisms
circumvented, so these sections of the file are completely superfluous.

But beyond that, these sections contain components of the SecuROM copy
protection system that can only reasonably be described as malware (e.g.
covertly installed kernel drivers that interfere with CDROM access). As
such, it's probably for the best that we remove this garbage.

The section header information was changed, and the section contents
were zeroed; but all other sections have been left completely unmoved
and untouched, so that previously determined offsets will remain valid.

Additional minor modification: remove a few extra strings inserted into
the EXE file by the no-CD patch.

* Remove .idata and move .rsrc forward: size reduced to < 1.2 MiB
  dc774bd5c3

All traces of SecuROM are now completely gone, and the chasm of zeros
where its sections used to live has been removed. The vestigial .idata
section was removed, as it wasn't actually being used; and the .rsrc
section was moved from its former location at RA 2F2000 / VA F10000 to
its new location at RA 125000 / VA D43000.

The PE header data directory offsets were updated; the offsets in the
import table for openloco.dll were adjusted; the offsets in the resource
table were adjusted; and the jump at the beginning of WinMain to the
StartOpenLoco import was adjusted.

This has been verified and tested, and appears to work entirely
correctly.

* Invent new .idata section for the page containing the import directory
  68b488833b

This change simply shortens .rsrc by one page and then adds a
one-page-sized section called .idata in its place, so that there's no
longer import stuff in .rsrc, where it doesn't really belong.

Characteristics on .rsrc were modified so it's no longer writable;
writability was maintained for .rdata and .idata, as they both contain
import data.
2018-01-21 13:18:43 +00:00
data/language Add en-US language file 2018-01-10 19:16:15 +00:00
distribution Add clang 2018-01-21 00:18:57 +01:00
src/openloco Mark spots where std::strcpy should be replaced once buf size is known 2018-01-20 17:35:51 -08:00
.gitignore Add appveyor CI 2018-01-20 14:14:07 +00:00
.travis.yml Add clang 2018-01-21 00:18:57 +01:00
CHANGELOG.md Allow shift+click track / road construction 2018-01-16 15:27:32 +00:00
CMakeLists.txt Fix building in paths with spaces or apostrophes (#16) 2018-01-20 23:42:16 +00:00
LICENSE Initial commit 2018-01-06 23:35:23 +00:00
README.md Add Gitter Links to Readme (#7) 2018-01-20 13:46:05 +00:00
appveyor.yml Add appveyor CI 2018-01-20 14:14:07 +00:00
loco.exe Cleanup loco.exe file (#6) 2018-01-21 13:18:43 +00:00
openloco.common.props Disable link-time code generation for MSVC Debug builds (#18) 2018-01-21 03:10:19 +00:00
openloco.sln Add initial working wrapper 2018-01-07 03:18:38 +00:00

README.md

OpenLoco

An open source re-implementation of Chris Sawyer's Locomotion. A construction and management simulation video game that simulates running a transport company.


Contents


Build Status

Windows Linux / Mac Download
master GitHub release

Chat

You only need a GitHub or Twitter account to access these channels.

If you want to help make the game, join the developer channel.

If you need help, want to talk to the developers, or just want to stay up to date then join the non-developer channel for your language.

Language Non Developer Developer
English Gitter Gitter

1 Introduction

OpenLoco is an open-source re-implementation of Chris Sawyer's Locomotion (CSL). CSL is the spiritual successor to Transport Tycoon and OpenLoco aims to improve the game similar to how OpenTTD improved Transport Tycoon and OpenRCT2 improved RollerCoaster Tycoon.

Chris Sawyer's Locomotion was written by Chris Sawyer in x86 assembly building on top of his RollerCoaster Tycoon 2 engine. Much of the code is 1:1 with RollerCoaster Tycoon 2. This means that only select areas of the game such as the update logic should be written. The engine code such as audio, drawing and the window system should be left alone as it would only repeat the work that has already been done for OpenRCT2. It is more beneficial to share as much code as possible between OpenRCT2 and OpenLoco.


2 Downloading the game (pre-built)

OpenLoco requires original files of Chris Sawyer's Locomotion to play. It can be bought at either Steam or GOG.com.

The latest release can be found on GitHub.


3 Building the game

3.1 Building prerequisites

OpenLoco requires original files of Chris Sawyer's Locomotion to play. It can be bought at either Steam or GOG.com.

Windows:

  • 7 / 8 / 10
  • Visual Studio 2017 update 5.5+
    • Desktop development with C++
    • Windows 10 SDK (10.0.14393.0)
  • SDL2
    • Development Libraries

Linux:

OpenLoco can not currently be built on Linux without a cross compiler. Pull requests are welcome to fix building for Linux. There are many function calls still to Win32 APIs. These require 'hooking' so that they can be replaced with cross-platform implementations. Scripts for linking in the loco.exe binary sections and remapping the address space can be found in the OpenRCT2 code base.

macOS:

See Linux.


3.2 Compiling and running

Windows:

  1. Check out the repository. This can be done using GitHub Desktop or other tools.
  2. Copy SDL2 into a sub directory called lib under the root, alternatively use vcpkg.
  3. Open a new Developer Command Prompt for VS 2017, then navigate to the repository (e.g. cd C:\GitHub\OpenRCT2).
  4. Run msbuild openloco.sln.
  5. Run the game, bin\openloco

Linux:

The standard CMake build procedure is to install the required libraries, then:

mkdir build
cd build
cmake ../
make

4 Licence

OpenLoco is licensed under the MIT License.


5 More information