The "original" Colossal Cave Adventure for Windows ================================================== A few days ago I stumbled upon Dan Nelson's port of the original PDP-10 FORTRAN source code by Crowther and Woods /1/ to ANSI FORTRAN 77 /2/ in the Interactive Fiction Archive. Unfortunately, I couldn't find a pre-compiled Windows binary or at least a DOS executable for running in DOSBox /3/ of this port. And yes, I want 'to play the original colossal cave adventure in its true original form, with no omissions, additions, or modernizations' /4/ in a modern Windows environment. Therefore, I started my own short adventure in compiling this piece of history for Windows. As Dan suggested, I compiled his port using g77 which is available in various versions for Windows on the internet. I changed the path to the binary state file from '/etc/advent.bin' to 'advent.bin' for obvious reasons. The state file resides now in the executable directory. Therefore, write permissions to this directory are required, when using magic. g77 did compile Dan's source files out of the box without any problems. But I realized that g77 is fairly old and the compilers I found did only create win32 executables. I checked the net for more modern GNU Fortran compilers and ended up with several versions of gfortran (MinGW and MinGW-w64 environment). gfortran threw several warnings and errors during the first run. I did suppress the warnings regarding obsolete features using the option -std=legacy. For solving the compiler errors I had to change only a few lines, especially the format argument in the WRITE statements for issuing error messages when reading and writing files as well as one sloppy written continuation line. Clive Page's Professional Programmer's Guide to Fortran77 /5/ helped me find my way. The changes are documented in the unified diff files. I tested several versions of gfortran (7.4.0, 8.3.0, 9.2.0 and an experimental relase of 10.0.0). All versions of gfortran (as well as g77) did compile the changed source files without any problems. I decided to use gfortran 9.2.0 for building x86 and x64 releases with static linked libraries. The resulting executables have been packed with UPX 3.95w /6/. This archive contains following files: advent.dat data file converted by Dan Nelson advent.dat.orig original data file by Crowther and Woods advent.for updated source file for advent advent.for.orig original source file by Crowther and Woods advent.unidiff unified diff file documenting my changes to advent.for datcvt.for source file for data file converter by Dan Nelson make.bat batch file for compiling advent and wiz (gfortran) make-g77.bat batch file for compiling advent and wiz (g77) README README by Dan Nelson README.win this file wiz.for updated source file for wiz wiz.unidiff unified diff documenting my changes to wiz.for x64\advent.dat Pre-compiled Windows binaries (x64) x64\advent.exe x64\wiz.exe x86\advent.dat Pre-compiled Windows binaries (x86) x86\advent.exe x86\wiz.exe The binaries have been successfully tested on Windows XP SP3 (x86 only), Windows 7 SP1, and Windows 10 Pro 1903. Thanks to Dan we are able to play our beloved Colossal Cave Adventure in it's true original form (at least until the year 2101; see Dan's comment in SUBROUTINE DATIME). As long as future GNU Fortran Compilers support FORTRAN 77 it will be possible to compile executables not only for UNIX environments but also for Windows operating systems (and others as well, of course.) Thank you very much, Dan! Hartmut Kuehne Dec 14, 2019 Update: "You fell into a pit..." ================================ Of course, it had to happen: When compiling the sources with gfortran 9.2.0, I did fall, full of confidence, into a pit prepared only for me by the developers of the gfortran compiler. I did not break my neck, but the random number generator. No dwarfs, no pirate, no escape from Witt's End... According to the documentation of gfortran 9.2.0 /7/, the compiler does provide an intrinsic function RAN as alias for RAND for compatibility with HP FORTRAN 77/iX. This intrinsic function has been called instead of advent's own random number generator function RAN. After declaring RAN as external procedure (EXTERNAL RAN) the dwarfs did return! This archive contains now the updated sources and binaries. Jan 04, 2020. References: /1/ https://www.ifarchive.org/if-archive/games/source/advent-original.tar.gz /2/ https://www.ifarchive.org/if-archive/games/source/advent-orig-nelson.tar.gz /3/ https://www.dosbox.com/ /4/ see README by Dan Nelson /5/ Page, Clive G.: Professional Programmer's Guide to Fortran77 https://www.star.le.ac.uk/~cgp/prof77.pdf /6/ https://upx.github.io/ /7/ https://gcc.gnu.org/onlinedocs/gfortran/RAN.html