SA1 analog drift fix, release of Dreamcast Image Builder, Autodemo research and more

It’s been an eventful couple of months, so there are several things I’d like to talk about today.

New version of the SA1 analog fix

You may have heard of the analog deadzone fix for SA2 DC by OnVar. I was looking at input code in SA1 and found many similarities, so I made a request to woofmute, who successfully ported OnVar’s fix to SA1. The fix is available for the US version (1.005) and the Autodemo. I’m not sure whether the issue is addressed completely or if the fix has any side effects, but it appears to work and it’s definitely better than my old hack, so I suggest you give it a try.

The fix injects custom code into 1ST_READ.BIN. The patched bytes for the US version are as follows. With some patience you could turn it into a very long CodeBreaker code…

;Input function hijack

;Input Patch block 1

;Input Patch Orig code reposition

;float for block 1

There are two ways to get the patch:

  1. If you have the TOSEC GDI of SA1 US 1.005, you can apply an xdelta patch to track03.bin. It works the same way as the SA2 patch in the description of the video linked at the top of this post, so you can use the video for reference.
  2. To apply this fix and more, you can use the new Dreamcast Image Builder that I will talk about in the next section. The Autodemo version of the fix is also available for Dreamcast Image Builder.

Release of Dreamcast Image Builder

This is an update to SA1-DC-HD, a project that originally started as a helper tool to add various enhancements to SA1 DC for playing on the flycast emulator. The project has grown to become a universal patcher for Dreamcast games.

As you can see, it’s heavily inspired by the SADX Mod Loader/Mod Manager and uses the same concept of “mods” to add hacks to games. Of course it’s a lot more limited than the actual Mod Loader, but you can do neat things with it. For example, to test its capabilities I made a mod that replaces Deer with Sheep from SA2:

(Chao body parts not implemented yet)

You can check it out here. All mods from SA1-DC-HD are built-in, so you can use it right away. The wiki explains how to use the tool and develop mods for it.

New Autodemo research

You may have seen new videos uploaded by Speeps and woofmute which demonstrate various debug features of the Autodemo and levels that didn’t work before, such as Casinopolis. This was made possible thanks to the research done by Speeps, woofmute and other members of x-hax, as well as previous research by evilhamwizard, ItsEasyActually, supercoolsonic and others.

As you may know, parts of the Autodemo come from different builds of the game that were at different stages of development. When the Autodemo was put together, only the levels that were meant to be shown in the demo were recompiled, and the other levels 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:

15.10.1998 - binaries that boot without hacking

STG01 (Emerald Coast)
STG04 (Speed Highway)
STG05 (Red Mountain)
STG08 (Ice Cap)
STG10 (Final Egg)
ADV00 (Station Square)
ADV00OBJ (Station Square objects)
ADV0100 (Egg Carrier Outside)
ADV0130 (Egg Carries Inside)
ADV01OBJ (Egg Carrier objects)
AL_GARDEN00 (Station Square Chao Garden)
AL_MAIN (Chao)
B_CHAOS2 (Chaos 2)

07.10.1998 - binaries that don't boot without hacking

AL_GARDEN01 (Egg Carrier/Beta Windy Valley Chao Garden)
AL_GARDEN02 (Mystic Ruins Chao Garden)
AL_RACE (Chao Race)

24.09.1998 - binaries that don't boot without hacking

STG00 (Test stages)
STG02 (Windy Valley)
STG03 (Twinkle Park)
STG06 (Sky Deck)
STG07 (Lost World)
STG09 (Casinopolis)
ADV02 (Mystic Ruins)
ADV02OBJ (Mystic Ruins objects)
SHOOTING (Sky Chase)
MINICART (Twinkle Circuit)
B_E101_R (E-101 MK2)
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)

You can see that there are three “sets” of files sorted by last modified date. The files that don’t boot were compiled against an earlier version of the game’s main binary (1ST_READ.BIN), so the pointers to functions and data in the main binary are all invalid in these files. However, 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.

Earlier work on this, which demonstrated partially functional Windy Valley and Sky Deck, was posted by evilhamwizard on Sonic Retro. More recently this was picked up by Speeps, who started putting together a list of known broken pointers and their correct counterparts. As the pointer list grew, more levels became functional when known pointers were replaced. To facilitate mass pointer replacement and game testing, I added Autodemo support to my SA1-DC-HD project (now Dreamcast Image Builder). As we were experimenting with the Autodemo, I adjusted the image builder’s mods system to be more flexible and easier to use and converted (together with woofmute) Speeps’ modifications into mods for it. I also repurposed some of my previous work to find missing textures 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).

As a result of this combined effort, we got the game to show stuff that was never seen before. For example, here’s a preview of the old version of Chao Race restored by Exant:

Or a very early version of the Mystic Ruins:

Or woofmute’s restoration of the debug object placement editor:

Or a super early version of Twinkle Circuit:

Of course, you also have Speeps’ near-complete restorations of Twinkle Park, Lost World and Sky Deck. The biggest restoration so far is the early Windy Valley, the holy grail of the Autodemo for many SA1 fans. It’s based on Speeps’ and evilhamwizard’s pointer fixes and uses textures from the 2018 PC mod by supercoolsonic & ItsEasyActually.

There’s a lot more stuff released and in progress. We now have a public repository with some Autodemo mods, which you can apply with Dreamcast Image Builder to get the restored functionality and content ingame.

Note: Not all of the mods work on hardware at the moment. flycast is recommended.