The Sierra games have a number of quirks that make them incompatible with modern versions of Windows and fast CPUs.
As an example, the immediate error with Phantasmagoria 2 is due to the executable calling a Windows API while the stack-pointer is miss-aligned.
Stage 1: Disassembler
I wrote the disassembler with one key goal in mind... for the resulting output to be reassembled.
The data and resource sections are preserved without changing the layout.
The code section can be rearranged and patched at will, then reassembled.
The process allow a number of debugging tricks such as auto-patching the prologue of every function to check for a particular trigger situation.
Step 2: Patch
The makefile invokes a few utilities to patch the assembly code. Typically two types of patches are applied:
- Find-replace patches. Typically used to upgrade function calls for drawing to the screen or loading configuration files.
- Apply a patch file to apply custom patches specific to the assembly file.
Step 3: Compile and link
- Assembly patched assembly file (GNU as).
- Compile helper code (GNU gcc).
Step 4: Build installer
Invoke Advanced Installer to create the final installer.