foxygit / doom Log in
commit 15a1c4924707f78ca4f9e109292e1ca35e83f1f7
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Mon Mar 28 23:33:09 2011 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Mon Mar 28 23:33:09 2011 +0000

    Emulate bug with IDMUS cheat when emulating v1.9 (thanks Alexandre
    Xavier).

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 2314
---
 NEWS           |  2 ++
 NOT-BUGS       | 17 +++++++++++++++++
 src/st_stuff.c |  9 +++++++--
 3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index c0163f8c..81cc5182 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,8 @@
      * The null sector dereference emulation code has been imported
        from Prboom+ - this fixes a desync with CLNJ-506.LMP (thanks
        entryway).
+     * The IDMUS cheat doesn't work when emulating the v1.9 executable
+       (thanks Alexandre Xavier).

     Bugs fixed:
      * Menu navigation when using joystick/joypad (thanks Alexandre
diff --git a/NOT-BUGS b/NOT-BUGS
index 38d97770..2a6c6500 100644
--- a/NOT-BUGS
+++ b/NOT-BUGS
@@ -110,3 +110,20 @@ More information can be found here:

     http://rome.ro/lee_killough/editing/visplane.shtml

+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+== IDMUS## cheat doesn't work with shareware/registered Doom IWADs ==
+
+The IDMUS cheat allows the in-game music to be changed.  However, in
+the original v1.9 this cheat didn't work properly when playing with
+the Doom 1 (shareware and registered) IWADs.  This bug was fixed in
+the Ultimate Doom and Final Doom executables.
+
+Chocolate Doom emulates this bug.  When playing with the shareware or
+registered Doom IWADs, the IDMUS cheat therefore does not work
+properly.  If you are playing with the Ultimate Doom IWAD, the
+Ultimate Doom executable is emulated by default, so the cheat works
+properly.
+
+# vim: tw=70
+
diff --git a/src/st_stuff.c b/src/st_stuff.c
index d9c45098..b1a46df5 100644
--- a/src/st_stuff.c
+++ b/src/st_stuff.c
@@ -521,8 +521,13 @@ ST_Responder (event_t* ev)

 	plyr->message = DEH_String(STSTR_MUS);
 	cht_GetParam(&cheat_mus, buf);
-
-	if (gamemode == commercial)
+
+        // Note: The original v1.9 had a bug that tried to play back
+        // the Doom II music regardless of gamemode.  This was fixed
+        // in the Ultimate Doom executable so that it would work for
+        // the Doom 1 music as well.
+
+	if (gamemode == commercial || gameversion < exe_ultimate)
 	{
 	  musnum = mus_runnin + (buf[0]-'0')*10 + buf[1]-'0' - 1;