A rough estimate based on number of functions in the original game and number of functions now in C tells us that the project is approximately 25% complete of its target goal of having the game run on 100% C code. peep generation, awards, cash out) and almost half of the windows. More drawing functions have now been decompiled but still remain cryptic C, much of the game management have been decompiled (e.g. SDL2 has been used as a replacement for the operating system calls, allowing for cross-platform support after the dependency on the original game's executable has been removed.Īs of 16th August 2014, various UI improvements have already been made, settings are now stored in a local INI file. Decompiling all of the game's procedures is a convenient way of identifying the game's memory structure. 1.3 ProgressĬurrently, the windowing system, graphics rendering and basic game loop are being decompiled. Until all procedures of the original game are re-written in C, the project must remain a DLL which is called from the patched rct2.exe.
ROLLERCOASTER TYCOON DELUXE WINDOWED PATCH PATCH
The project therefore acts as a patch to RollerCoaster Tycoon 2, allowing each procedure to be gradually implemented while simultaneously adding new features where possible.
ROLLERCOASTER TYCOON DELUXE WINDOWED PATCH CODE
With this system implemented, starting rct2.exe calls the new DLL as part of its initialization the DLL can then run all the decompiled code whilst still being able to read / write to the rct2.exe memory model and run rct2.exe procedures. The original executable rct2.exe has been patched so that openrct2.dll and WinMain are in the DLL import table and the WinMain export procedure in openrct2.dll is called at the start of the WinMain procedure in rct2.exe before returning. To test the accuracy of the re-written procedures, the decompiled C procedures are compiled into a DLL ( openrct2.dll) which exports an entry procedure mimicking the WinMain function in RollerCoaster Tycoon 2. In order to decompile the game gradually without introducing new bugs, each procedure in RollerCoaster Tycoon 2 is to be re-written in C on an individual basis.
While the version of the engine used in Chris Sawyer's Locomotion is newer, OpenRCT2 is currently targeting the RollerCoaster Tycoon 2 engine to ease the decompilation process. This is reflected in the usage of OpenTTD 0.1 code such as the windowing system and graphics rendering. RollerCoaster Tycoon 2 uses the third version of Chris Sawyer's engine, which shares some code with Transport Tycoon. For an example of this method, OpenTTD was formed through a similar procedure the original game, Transport Tycoon Deluxe, was decompiled into C which allowed for the addition of thousands of features to the game. RollerCoaster Tycoon 2 was originally written in MASM and Visual C++ where functions related to interfacing with the operating system were written in C (supposedly 1%), with the rest of the game being written in pure x86 assembly. OpenRCT2 is an attempt to decompile RollerCoaster Tycoon 2 into C.