diff --git a/README.md b/README.md index 7fcb7a911..d09b4e930 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,6 @@ I was excited to discover that the original DOOM source code was open on GitHub. Unfortunately, when I tried to clone and build it for myself, it did not work OOTB. This fork/repo contains a collection of fixes that I had to apply to get it working on my computer. The goal is that others will stumble across this repo and be able to build the source code for themselves without error. -For a full list of changes made to the repo after forking it, see the [changelog](./CHANGELOG.md). - ## Requirements _Note_: Provided commands were tested on Linux Mint Victoria 21.2. @@ -26,16 +24,31 @@ _Note_: Provided commands were tested on Linux Mint Victoria 21.2. ## Build and Run -0. Open up a terminal -1. `git clone https://github.com/lunkums/DOOM_fixed.git` (if not already done) -2. `cd DOOM_fixed/linuxdoom-1.10` -3. `make` (64-bit) or `make 32bit` (32-bit) -4. `cd linux/` -5. `curl -O https://distro.ibiblio.org/slitaz/sources/packages/d/doom1.wad` (download doom1.wad) -6. In a separate terminal, run `Xephyr :2 -ac -screen 640x400x8` -7. Back in the first terminal, run `DISPLAY=:2` then `./linuxxdoom -2` (-2 means the game is scaled by a factor of 2) +```bash +$ git clone https://github.com/lunkums/DOOM_fixed.git # clone the repo +$ cd DOOM_fixed/linuxdoom-1.10 # navigate to the linuxdoom-1.10 folder +$ make # 64-bit build +$ make 32bit # 32-bit build +$ cd linux/ # navigate to the output directory +$ curl -O https://distro.ibiblio.org/slitaz/sources/packages/d/doom1.wad # download the shareware wad +... +# in a separate terminal, run: +$ Xephyr :2 -ac -screen 320x200x8 # start an X server with Xephyr +... +# back in the first terminal, run: +$ DISPLAY=:2 # set the `DISPLAY` environment variable to be `:2` +$ ./linuxxdoom # LGTM +``` + +### Sound + +See the [sndserv README](./sndserv/README.md) for instructions on setting up the game's sound. + +### Music + +Unfortunately, Linux DOOM does not support music due to a licensing issue with the [DMX](https://doomwiki.org/wiki/DMX) sound library used in the original release. Reimplementing it is out of the scope of this fork. ## Additional Info -https://hexadecimal.uoregon.edu/~stevev/Linux-DOOM-FAQ.html -https://www.youtube.com/watch?v=9JgQfQHHhTw +- [Linux DOOM FAQ](https://hexadecimal.uoregon.edu/~stevev/Linux-DOOM-FAQ.html) +- [How To Compile Vanilla Doom (Linux Doom)](https://www.youtube.com/watch?v=9JgQfQHHhTw) diff --git a/linuxdoom-1.10/i_sound.c b/linuxdoom-1.10/i_sound.c index 0e25f72ea..db3d5b30b 100644 --- a/linuxdoom-1.10/i_sound.c +++ b/linuxdoom-1.10/i_sound.c @@ -64,7 +64,7 @@ rcsid[] = "$Id: i_unix.c,v 1.5 1997/02/03 22:45:10 b1 Exp $"; #ifdef SNDSERV // Separate sound server process. FILE* sndserver=0; -char* sndserver_filename = "./sndserver "; +char* sndserver_filename = "sndserver"; #elif SNDINTR // Update all 30 millisecs, approx. 30fps synchronized. @@ -746,7 +746,7 @@ I_InitSound() getenv("DOOMWADDIR"), sndserver_filename); else - sprintf(buffer, "%s", sndserver_filename); + sprintf(buffer, "./%s", sndserver_filename); // start sound process if ( !access(buffer, X_OK) ) diff --git a/linuxdoom-1.10/i_video.c b/linuxdoom-1.10/i_video.c index 79d47f62c..cebe6adb6 100644 --- a/linuxdoom-1.10/i_video.c +++ b/linuxdoom-1.10/i_video.c @@ -666,7 +666,6 @@ void grabsharedmemory(int size) id = shmget((key_t)key, size, IPC_CREAT|0777); if (id==-1) { - extern int errno; fprintf(stderr, "errno=%d\n", errno); I_Error("Could not get any shared memory"); } diff --git a/sndserv/Makefile b/sndserv/Makefile index 239ad5781..01eb72f17 100644 --- a/sndserv/Makefile +++ b/sndserv/Makefile @@ -13,7 +13,12 @@ LIBS=-lm O=linux -all: $(O)/sndserver +TARGET := $(O)/sndserver + +all: $(TARGET) + +32bit: CFLAGS += -m32 +32bit: $(TARGET) clean: rm -f *.o *~ *.flc diff --git a/sndserv/README.md b/sndserv/README.md new file mode 100644 index 000000000..4eee8e809 --- /dev/null +++ b/sndserv/README.md @@ -0,0 +1,25 @@ +# sndserv (Sound Server) + +Linux DOOM plays sounds from a separate process called sndserv (sound server). + +## Requirements + +_Note_: Provided commands were tested on Linux Mint Victoria 21.2. + +- Linux +- OSS Proxy Daemon (`sudo apt-get install osspd`) + +## Build and Run + +```bash +$ cd DOOM_fixed/sndserv # navigate to the `sndserv` directory +$ make # 64-bit build +$ make 32bit # 32-bit build +$ cp ./linux/sndserver ../linuxdoom-1.10/linux/ # copy sndserver to the linuxdoom output directory +``` + +## Additional Info + +- [How exactly did the linuxdoom sndserver used to work?](https://www.doomworld.com/forum/post/2544842) ([archive](https://web.archive.org/web/20231004233042/https://www.doomworld.com/forum/topic/131304-how-exactly-did-the-linuxdoom-sndserver-used-to-work/?tab=comments#comment-2544842)) +- [Where is /dev/dsp or /dev/audio?](https://askubuntu.com/questions/220370/where-is-dev-dsp-or-dev-audio?rq=1) ([archive](https://web.archive.org/web/20231004233215/https://askubuntu.com/questions/220370/where-is-dev-dsp-or-dev-audio?rq=1)) +- [Package: osspd (1.3.2-13.1)](https://packages.debian.org/sid/osspd) ([archive](https://web.archive.org/web/20231004234639/https://packages.debian.org/sid/osspd)) diff --git a/sndserv/linux.c b/sndserv/linux.c index 93b067d11..1db674f13 100644 --- a/sndserv/linux.c +++ b/sndserv/linux.c @@ -34,6 +34,7 @@ static const char rcsid[] = "$Id: linux.c,v 1.3 1997/01/26 07:45:01 b1 Exp $"; +#include #include #include @@ -53,7 +54,6 @@ myioctl int* arg ) { int rc; - extern int errno; rc = ioctl(fd, command, arg); if (rc < 0) diff --git a/sndserv/linux/.gitignore b/sndserv/linux/.gitignore new file mode 100644 index 000000000..d6b7ef32c --- /dev/null +++ b/sndserv/linux/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore