Sonic Adventure Autodemo/Restoration: Difference between revisions
mNo edit summary |
mNo edit summary |
||
| Line 123: | Line 123: | ||
It turned out Practice 1 could load by just removing its SET File (Object Layout) because it only references 1ST_READ through that. | It turned out Practice 1 could load by just removing its SET File (Object Layout) because it only references 1ST_READ through that. | ||
Practice 2 does not load because one of the meshes is too big for the game's [[Sonic Adventure/Lantern Engine|LANTERN lighting system]] to handle. However, it boots if [[Sonic Adventure/Ninja Lights|Ninja Lights]] are used instead.<gallery mode="nolines" caption="Practice Stages with Ninja Lights (images by ''MainJP'')"> | Practice 2 does not load because one of the meshes is too big for the game's [[Sonic Adventure/Lantern Engine|LANTERN lighting system]] to handle. However, it boots if [[Sonic Adventure/Ninja Lights|Ninja Lights]] are used instead. | ||
[[File:Pinball mode practice.mp4|thumb]] | |||
<gallery mode="nolines" caption="Practice Stages with Ninja Lights (images by ''MainJP'')"> | |||
File:Practice.webp|alt= | File:Practice.webp|alt= | ||
File:Sonic Adventure Autodemo Restoration 1772203956319.png | File:Sonic Adventure Autodemo Restoration 1772203956319.png | ||
Revision as of 10:19, 28 February 2026
This page is dedicated to projects that restore content and functionality in the Autodemo prototype of Sonic Adventure (Dreamcast). For Sonic Adventure PX (PC) mods that implement Autodemo features, see this page instead.
When the Sonic Adventure Autodemo was first dumped in 2013, it was soon discovered that it was a semi-functional build of the full game. The Autodemo was quickly hacked to unlock player controls and load stages manually so that they could be explored freely. However, many stages did not load because the binaries containing them were originally compiled for an older version of the game's main executable.
The Autodemo has been researched ever since it was dumped, and the non-functional stages were eventually extracted using SA Tools and ported to the PC version. However, being able to play them in the Autodemo itself was desirable in order to see differences in the game's code, which couldn't be exported by the tools.
Initial work on restoring Autodemo functionality ingame was done back in 2015, when the user evilhamwizard posted their findings in the Autodemo discussion thread on Sonic Retro. The work focused primarily on restoring the original Windy Valley, and a number of GIFs of the level running on the emulator were posted in 2016. Some updates were posted on booting Sky Deck as well.
In 2024, based on evilhamwizard's initial research, a new restoration project was started by x-hax (primarily by Speeps), aiming to make other stages bootable, as well as improving the original Windy Valley restoration. This restoration was achieved in 2024 through a collaboration of x-hax users and symbol information acquired from the leaked Xbox 360 SADX prototype. The project is available as a GitHub repository.
Background and Method
The files included on the Autodemo disc come from different builds of the game that were at different stages of development. When the Autodemo was put together, only the stages that were meant to be shown in the demo were recompiled, and the other stages were left over from older builds (for most of these, textures and lighting files were also missing). We can tell which binaries were recompiled by looking at file dates on the Autodemo GD-ROM. Only the files dated October 15 work ingame as-is, and other files cause the game to crash. The crash happens because the functions in the game's updated main binary (1ST_READ.BIN) are at different memory addresses from those expected by the code in stage binaries which were compiled for the older version of the game.
| October 15, 1998 (working) | October 7, 1998 (broken) | September 24, 1998 (broken) |
|---|---|---|
| STG01 (Emerald Coast) | AL_GARDEN01 (Egg Carrier/Beta Windy Valley Chao Garden) | STG00 ("Practice" Stages) |
| STG04 (Speed Highway) | AL_GARDEN02 (Mystic Ruins Chao Garden) | STG02 (Windy Valley) |
| STG05 (Red Mountain) | AL_RACE (Chao Race) | STG03 (Twinkle Park) |
| STG08 (Ice Cap) | STG06 (Sky Deck) | |
| STG10 (Final Egg) | STG07 (Lost World) | |
| ADV00 (Station Square) | STG09 (Casinopolis) | |
| ADV00OBJ (Station Square objects) | ADV02 (Mystic Ruins) | |
| ADV0100 (Egg Carrier Outside) | ADV02OBJ (Mystic Ruins objects) | |
| ADV0130 (Egg Carries Inside) | SHOOTING (Sky Chase) | |
| ADV01OBJ (Egg Carrier objects) | MINICART (Twinkle Circuit) | |
| AL_GARDEN00 (Station Square Chao Garden) | B_E101_R (E-101 MK2) | |
| AL_MAIN (Chao) | B_ROBO (ZERO) | |
| B_CHAOS2 (Chaos 2) | B_EGM1 (Egg Hornet) | |
| B_EGM3 (Egg Viper) | ||
| SBOARD (Sand Hill) | ||
| B_CHAOS0 (Chaos 0) | ||
| B_CHAOS4 (Chaos 4) | ||
| B_CHAOS6 (Chaos 6) | ||
| B_CHAOS7 (Perfect Chaos) |
However, as originally demonstrated by evilhamwizard, it’s possible to find the functions and data they were meant to point to by comparing the pointers to known functions and data between these files and the files that boot. In 2024, Speeps started putting together a new spreadsheet of known broken pointers and their correct counterparts. As the pointer list grew, more levels became functional when known pointers were replaced.
Early hacks by Speeps were using simple patches to the executables applied through a hex editor. To facilitate mass pointer replacement and game testing, PkR reworked his SA1-DC-HD tool (originally meant to build GDIs of the final version of SA1 with enhancements) and created the Dreamcast Image Builder. The image builder uses a "mods" system that makes it easier to replace pointers, do all sorts of patching of game binaries and build a modified game image containing all of the selected hacks. In addition, some other tools on the SA Tools Research repository were repurposed to find missing textures in the Autodemo by matching the names in the Autodemo’s texture lists against textures in the final version, the E3 build, the Autodemo Windy Valley mod for the PC version, where missing textures were recreated by its developers, and Dreamcast SDKs, which surprisingly have some early SA1 textures.
Apart from making stages bootable, the mods include various experiments with controls, framerate, lighting, skipping the intro movie, adding textures that are missing on the disc, restoring debug functionality etc.
The exact pointer matching procedure involved in stage restoration is as follows:
- Get the address of all pointers that read the stage's file from 1ST_READ. These are the Round Manager, Background Manager, Object List and Path List.
- Using IDA's graph view, gather all pointers to 1ST_READ (8Cxxxxxx).
- Using Ghidra, identify an object (using its name string) and check if the same code exists in SADX, where its symbol information can be taken from the 360 symbols.
- For all references to broken pointers in the object, attempt to find a working reference in a functional AutoDemo stage, such as Speed Highway.
- Replace the broken pointer with the working one.
All pointers were added to a spreadsheet along with their fixed version.
For any code that didn't have a matching reference in the PC version or a functional Autodemo stage file, such as code for objects that didn't exist in the final game, the original byte difference method was used instead. Using Ghidra, the resulting pointer was checked to ensure it led to an appropriate address (The beginning of a function etc.). Any pointers "fixed" with this method were marked in the table as unsure.
Stages that were similar enough to their final counterparts to share a lot of code (Twinkle Park, Lost World) were repaired first to build the database of known pointers, as stages with larger changes (Windy Valley) consisted almost entirely of code that didn't exist in the final game.
The restoration was primarily discussed in a series of threads on x-hax Discord. An archive of the discussion will be available for download at a later date.
Restoration Details
Stage Select
Debug Functionality
Ninja Lights
Practice Stages
It turned out Practice 1 could load by just removing its SET File (Object Layout) because it only references 1ST_READ through that.
Practice 2 does not load because one of the meshes is too big for the game's LANTERN lighting system to handle. However, it boots if Ninja Lights are used instead.
- Practice Stages with Ninja Lights (images by MainJP)