sean-gugler / u4remasteredA2

Ultima IV Remastered for the Apple II
58 stars 7 forks source link

Ultima IV for Apple II, Remastered

Greetings, traveler! Here you will find the most bug-free edition of Ultima IV for the Apple II ever known. May you enjoy the experience such as it was always meant to be.

This is meant as a "transparent" mod, meaning that any deviations beyond bug fixes are optional. You will not see any "enhancements" unless you deliberately invoke them; you can play the game exactly as originally designed.

Download from: https://github.com/sean-gugler/u4remasteredA2/releases

For more information: https://github.com/sean-gugler/u4remasteredA2/wiki

Hidden Features

If you are running the pre-built disk images, or have built your own from the fixed branch of the source repository, the following options are available to you.

Trainers

Slide shows

Two extra disk images have been included for fun. They are both bootable and contain ready-to-view artwork from within the game.

FIXES MADE

KEY:

Critical Bugs

Other Errors

Cosmetic Mistakes

Enhancements

Source Code

https://github.com/sean-gugler/u4remasteredA2

This source code has been reconstructed by disassembling and symbolicating the 1985 binary code released for Apple II series computers. It likely bears little resemblance to the original source, but it can be used by modern tools to build the same playable binaries.

All code has been symbolicated. Data layouts and values may be inferred from the header definitions, but the data itself is not included in this repository. It must be obtained from existing disk images.

Branches

The branch "fixed" includes numerous bug fixes and spelling/grammar corrections, as well as some non-intrusive improvements upon the original game. New features are silent unless invoked, so players may choose to ignore them and experience the game as originally designed.

The branch "documented" can re-create binary code identical to the original. Some original bugs are noted in the source, but not fixed, in this branch. A curious visitor may diff the two branches to review exactly what was changed.

Building with Docker

If you have Docker installed, checkout or download the fixed branch and run the following commands:

docker compose run u4remastera2 && docker compose rm -f && docker rmi u4remastereda2_u4remastera2:latest

Building without Docker

To build the source you need this software:

My development environment is Windows Subsystem for Linux, Ubuntu flavor ... although any Linux should do.

You also need disk images of Ultima IV for Apple II to import the graphics, maps, and other data that are not included in this git repository. I recommend using the de-protected images published by 4am.

Rename those disk images and place them in the following locations:

files/original/u4britannia.do
files/original/u4program.do
files/original/u4towne.do
files/original/u4underworld.do

Type make all to produce rebuilt versions of those disk images in the root folder.

Reconstruction

If you're interested in following my footsteps and reconstructing source from the binaries, you'll also need:

Regenerator is a light-weight, portable Windows application. Install or copy it into the regenerator folder.

Extract the DOS 3.3 files from the original disks with the command make extract. This runs tools/extract_files.py to populate the files/extracted folder.

| Tech Note: Extracted files match the byte streams as stored in DOS 3.3, including the "load address" value (byte offsets 0 and 1) but minus the "file length" value (byte offsets 2 and 3) which is instead implicit in the file size. This is so the resulting .prg files are natively parseable by Regenerator. |

For each binary program file, I performed the following steps:

  1. tools/regen_config.py --labels regenerator/Config/ultima4_labels.txt files/extracted/{DISK}/{FILE}.prg regenerator/Config This step is not strictly necessary, but it saves a lot of work. This script parses the binary file and creates a Config script for Regenerator. It is the same file Regenerator will create from scratch when you choose "Save", but pre-populated with known address symbols and auto-detected inline text regions.
  2. Many of the program files embed an incorrect load address, ignored by the game because it specifies an explicit address with the BLOAD FILE,A$nnnn command. Presumably these addresses are an artifact of the original development process. For these files, use the --addr option; for example, tools/regen_config.py --addr 8800 files/extracted/towne/USE.prg [...]
  3. Run the Regenerator app. Choose "Load" and open the .prg file. It will automatically load the config file you just created.
  4. Review the program, using Regenerator features to assign sensible names to addresses.
  5. Choose "Save" to both write the Config file and generate a .tas file. This is a text file usable as source code for the "TASS" assembler.
  6. tools/tass_to_c65.py files/extracted/{DISK}{FILE}.tas src/patchedgame/{DISK}/{FILE}.tas.s src/include/{FILE}.tas.i This converts the source from TASS format into CC65 format.
  7. Copy those files to {FILE}.s and {FILE}.i, or diff them with existing versions of those files. The reason I don't specify these files directly as script outputs for tass_to_c65.py is because there are always some manual edits I end up needing to make. Generating to separate files and diffing allows me to make further adjustments inside Regenerator without losing my manual edits. Alternatively, if you have a good git difftool, you could generate them directly and use git history to preserve post-Regenerator edits.

Planned Future Work

This project was inspired by the C64 Remaster done by MagerValp. Some of those enhancements have not yet made it to Apple II, but I'd like to get it all here eventually.

Other personal goals include:

Credits and License

MagerValp/u4remastered for Commodore 64 was the starting point for much of the symbolication and the project layout.

Additional work by Sean Gugler, including portions taken from his C64 fork of u4remastered, is © 2021 and licensed under CC BY-SA 4.0

The original Ultima IV game is © 1985 Origin Systems, Inc.

This project is made in the interest of preservation and education with the generous consent of Richard Garriott, original author and creator of the Ultima series of games including Ultima IV.