Sonic.exe 3.0 Source Code

0 views
Skip to first unread message

Prisc Chandola

unread,
Aug 3, 2024, 4:30:46 PM8/3/24
to cenfillroro

In several of the cases listed here, the game's developers released the source code expressly to prevent their work from becoming lost. Such source code is often released under varying (free and non-free, commercial and non-commercial) software licenses to the games' communities or the public; artwork and data are often released under a different license than the source code, as the copyright situation is different or more complicated. The source code may be pushed by the developers to public repositories (e.g. SourceForge or GitHub), or given to selected game community members, or sold with the game, or become available by other means. The game may be written in an interpreted language such as BASIC or Python, and distributed as raw source code without being compiled; early software was often distributed in text form, as in the book BASIC Computer Games. In some cases when a game's source code is not available by other means, the game's community "reconstructs" source code from compiled binary files through time-demanding reverse engineering techniques.

The table below with available source code resulted not from official releases by companies or IP holders but from unclear release situations, like lost and found games, and leaks of unclear legality (e.g. by an individual developer on end-of-product-life) or undeleted content.[75]

Once games, or software in general, become an obsolete product for a company, the tools and source code required to re-create the game are often lost or even actively destroyed and deleted.[265][266][267][268][269][270][271] For instance, with the closure of Atari in Sunnyvale, California, in 1996, the original source codes of several milestones of video game history such as Asteroids and Centipede were all thrown out as trash.[272][273]

When much time and manual work is invested, it is still possible to recover or restore a source code variant which replicates the program's functions accurately from the binary program. Techniques used to accomplish this are decompiling, disassembling, and reverse engineering the binary executable. This approach typically does not result in the exact original source code but rather a divergent version, as a binary program does not contain all of the information originally carried in the source code. For example, comments and function names cannot be restored if the program was compiled without additional debug information.

Using the techniques listed above within a "bottom-up" development methodology process, the re-created source-code of a game is able to replicate the behavior of the original game exactly, often being "clock-cycle accurate", and/or "pixel-per-pixel accurate". This approach is in contrast to that used by game engine recreations, which are often made using a "top-down" development methodology, and which can result in duplicating the general features provided by a game engine, but not necessarily an accurate representation of the original game.

As user Rotem replied, there is no known way to retrieve the "source code" as I thought it could. This is due to complications with decompiling UE4 source code.This is due to the fact that Unreal tends to hide source to most who use it, and is therefor up to the creators to distribute source code (which is all the files creating the .exe file).
Since the source was never distributed public, there is officially no possible way to modify this engine as the creators meant it to be.

Welcome to the source code compiling tutorial. This tutorial teaches you how to compile SRB2's source code to create an executable you can launch. The compiling process is necessary for creating custom source code modifications. This tutorial won't teach you how to modify the source code, it will only explain the process of compiling for several platforms.

For this method you have to install MinGW and various dependencies for it. The MinGW Installer can be downloaded from here. Note: Do NOT install MinGW into a pathname with spaces! This will not allow the compiler to function properly. The sufficient packages needed to compile SRB2 should all be under the "Basic Setup" category in the installer. The packages may take a while to download. As soon as the downloads are complete, move onto the next step.

SRB2 relies on two separate dependencies for compiling on Windows: The Netwide Assembler (or NASM for short) and DirectX 8. The first dependency, NASM, can be downloaded here. After the installation is complete, you need to download the next dependency: the DirectX 8 devpack for SRB2, which can be found here. Extract directx8.zip into the folder where you installed MinGW (C:\MinGW by default). Merge all folders prompted and replace all files that conflict. Place dxguid.lib in the same folder after the merge and replace operations are complete.

Now you will have to change your system's environment variables. To do this, click on the start button, right-click on "Computer" and then on "Properties". From there, go to "Advanced System Settings" and press the button called "Environment Variables". Under "System Variables", search for a variable called "Path" and double-click on it. Now add ;C:\MinGW\bin;C:\Users\(Username)\AppData\Local\nasm;C:\MinGW\msys\1.0\bin to the end of the variable's value. Substitute (Username) with the name of your Windows account. If you changed the path where you installed either MinGW or NASM, you have to specify those paths instead of the default ones given here. After changing the value, click OK until you closed all the windows.

There are now two ways you can compile SRB2. The first is via the Command Line. If you're on Windows XP, click the "Start" button in the bottom left corner, then click "Run..." and enter cmd. On Windows Vista/7, click the "Start" button, then type cmd into the search bar and press "enter" when a result appears. This will open up the command line. Navigate to the folder where your SRB2 source is located by entering cd . Now enter cd src to change to the "src" subfolder. From here, use the following command syntax to compile the source:

If you'd prefer not to put MSYS in your path to compile, you must launch the MSYS bash terminal instead. Navigate to the directory you installed MinGW into (usually C:\MinGW), and navigate through to msys/1.0. From here, launch msys.bat to bring up MSYS bash. You'll be greeted with a Unix-style command prompt upon opening it. The next step is similar to the command line, navigate to the source folder with the cd command, but you don't need to navigate into the "src" folder. From here, you can compile the game using the same command syntax as shown above.

The process for compiling SRB2 with SDL2 is somewhat different from compiling normally. You'll first need two more dependencies, the SDL2 Development Library, and the SDL2_mixer Development Library. After these are downloaded, navigate to the first directory inside. From here, you should see a folder titled "i686-w64-mingw32". Enter the folder, extract all of its contents into your MinGW directory, and merge all folders that prompt you to. Do this for both SDL2 and SDL2_mixer. As of the stable release of SDL2 version 2.0.3, compiling on Windows will only function properly on Windows 8 due to a bug with one of the library files. A patch for this bug can be found here. Extract the contents to your MinGW directory, merge all folders prompted, and replace all files prompted.

If you installed MinGW in a directory other than C:\MinGW, you must edit MinGW\bin\sdl2-config to correspond to your directory. Open the file in any text editor of your choice. You should see a line reading prefix=/C/MinGW on line 3 of the file. Change the directory listed by this to correspond to your MinGW directory and save the file.

If either method worked, you can find the compiled executable (srb2win.exe normally, srb2sdl.exe for SDL2) and, if you didn't compile with SDL2, r_opengl.dll in the bin/Mingw/Release subfolder of your source folder. If not, check to make sure your path is configured properly and that you have all of the necessary dependencies. If the problem is still not solved, then please contact Alam or Logan via SRB2Fun. Remember, even if you get errors, the game may have still compiled. A good practice is to check bin/Mingw/Release anyways just in case the compile was successful even with the errors.

It is possible to build SRB2 for Windows by using the MinGW toolchain on Linux. In order to set this up, you will need to install your OS's MinGW package and install the development libraries manually. The compiling process should be the same as MSYS. When cross-compiling, it is not necessary to use the CC=gcc flag and you should not use the WINDOWSHELL=1 or NOUPX=1 flags, since they will cause compile failures.

Visual C++ (MSVC) is Microsoft's C/C++ compiler and IDE (a tool that allows an easy and integrated development of software). While there exist projects for compiling SRB2 with MSVC, Windows builds with MSVC cannot play multiplayer games with gcc builds due to differences in each compiler's struct packing schemes. As such, it is usually advised to use MinGW instead as the official builds are compiled under gcc.

For compiling SDL2 builds, you'll also need the SDL2 Development Library for MSVC and the SDL2_mixer Development Library for MSVC. As SRB2's SDL2 port is not configured to compile with MSVC by default, you will need to manually include the libraries in the project.

Simply open the project file and press a little green arrow in the toolbar, and the compiled EXE and r_opengl.dll (if you didn't use SDL2) will be placed in bin/VC/Release or bin/VC/Debug. If this failed, please contact Alam in SRB2Fun.

To compile on Linux, you need to have the development libraries for SDL at minimum, as well as the gcc toolchain (make, gcc, etc), but it is recommended to have NASM and SDL_mixer as well. Navigate to the source folder, then run this command:

Keep in mind that LINUX=1 is the flag for compiling on an i686 machine and will not compile on an x86_64 machine. x86_64 machines must use the LINUX64=1 flag instead. This syntax also relies on NASM and SDL_mixer. To compile without them, refer to the compilation flags below.

c80f0f1006
Reply all
Reply to author
Forward
0 new messages