Git Product home page Git Product logo

u4-decompiled's Introduction

Lots of information/tools/remakes about "Ultima IV - Quest Of The Avatar" have been made, but so far, no one really gave an insight of the binary itself. To be more precise, of the executables of the PC version of the game (ported by James Van Artsdalen). There are two of them: AVATAR.EXE and TITLE.EXE

Basically, what I did is reverse engineer them to obtain a list of source files, that, when compiled and linked, produce new executables very close to the original ones (there are maybe 10 bytes difference for each executable).

Some of the source files are in assembly code. The biggest chunk is in C language, which means that it should be easier to read it. Of course, since this is a reverse-engineered from binary, files|variables|functions names were lost and I had to come up with new naming. I hope you like it.

Concerning the compiler, I used "Microsoft C Compiler 4.00". Which is certainly the version that was used to build the original game.

Very good remakes of the game exist already; this project is not intended to compete with them at all. Instead, interested people can take a look at the code to understand some algorithms, coding technics from another age, ...

I hope you enjoy browsing the code ! ergonomy_joe

Steps to compile with "Microsoft C Compiler 4.00"

  1. Download dosbox https://www.dosbox.com
  2. Launch dosbox
  3. Use Ctrl+F12 to speed up to ~15k cycles. It speeds up builds.
  4. MOUNT c "[Local-Directory]/SRC" e.g. MOUNT c "E:\projects\u4-decompiled\SRC"

  5. Download tools
    1. Go to https://www.pcjs.org/software/pcx86/util/other/unp/4.11/
    2. In the dropdown under the command prompt select "UNP (Executable Unpacker) Source"
    3. Click "Load" and then "Save"
    4. In the dropdown select "MS C 4.00 (Disk 1)"
    5. Rename downloaded file to MSC1.img
    6. In the dropdown select "MS C 4.00 (Disk 2)"
    7. Rename downloaded file to MSC2.img
    8. In the dropdown select "MS C 4.00 (Disk 3)"
    9. Rename downloaded file to MSC3.img
    10. In the dropdown select "MS Macro Assembler 3.00"
    11. Rename downloaded file to MASM300.img
    12. Go to https://winworldpc.com/product/borland-turbo-c/2x
    13. Download "Borland Turbo C 2.0 (3.5)"
    14. Extract disk2.img from download and place with other img files
  6. Extract tools
    1. mkdir C:\tools

    2. mkdir C:\tools\MSC400

    3. mkdir C:\tools\MASM300

    4. mkdir C:\tools\MASM300\LIB

    5. mkdir C:\tools\MASM300\INCLUDE

    6. mkdir C:\tools\turboc20

    7. mkdir C:\ORIGINAL

    8. MOUNT d "[Local Directory with img files]"

    9. imgmount a D:\UNP411~1.IMG -t floppy

    10. copy A:\UNP.EXE C:\TOOLS

    11. imgmount -u a

    12. imgmount a D:\MSC1.IMG -t floppy

    13. copy A:*.* C:\tools\MSC400

    14. imgmount -u a

    15. imgmount a D:\MSC2.IMG -t floppy

    16. copy A:\EXEPACK.EXE C:\tools

    17. imgmount -u a

    18. imgmount a D:\MSC3.IMG -t floppy

    19. copy A:*.* C:\tools\MSC400\LIB

    20. copy A:\LINK.EXE C:\tools\MSC400

    21. imgmount -u a

    22. imgmount a D:\MASM300.IMG -t floppy

    23. copy A:\LINK.EXE C:\tools\MASM300

    24. copy A:\LINK.EXE C:\tools

    25. copy A:\MASM.EXE C:\tools\MASM300

    26. imgmount -u a

    27. imgmount a D:\disk2.img -t floppy

    28. copy A:\MAKE.EXE C:\TOOLS\TURBOC20

  7. Build
    1. DOIT

u4-decompiled's People

Contributors

ergonomy-joe avatar fenyx4 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.