shithub: choc

Download patch

ref: d36dafa3fc3457333f1c49ce133c1e2587e778d4
parent: d8cfdba5bffc84b917f11db9564319693f29a629
parent: 7607140288b936d29f86b67eec1cbfa3eb60f5ca
author: Simon Howard <fraggle@soulsphere.org>
date: Sat Jun 4 15:36:32 EDT 2016

Merge remote-tracking branch 'origin/master' into sdl2-branch

--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -1,6 +1,11 @@
 Thanks for contributing to Chocolate Doom! Whatever your contribution,
 whether it's code or just a bug report, it's greatly appreciated.
 
+The project is governed by the
+[Contributor Covenant](http://contributor-covenant.org/version/1/4/)
+version 1.4. By contributing to the project you agree to abide by its
+terms. To report violations, please send an email to fraggle@gmail.com.
+
 ### Reporting bugs
 
 Before reporting a bug, it's worth checking if this really is a bug.
--- a/AUTHORS
+++ b/AUTHORS
@@ -2,4 +2,5 @@
 James Haley <haleyjd@hotmail.com>
 Samuel Villarreal <svkaiser@gmail.com>
 Fabian Greffrath <fabian@greffrath.com>
-Jonathan Dowland <jon+github@alcopop.org>
+Jonathan Dowland <jon@dow.land>
+Alexey Khokholov <alexeytf2@gmail.com>
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -1,0 +1,74 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as
+contributors and maintainers pledge to making participation in our project and
+our community a harassment-free experience for everyone, regardless of age, body
+size, disability, ethnicity, gender identity and expression, level of experience,
+nationality, personal appearance, race, religion, or sexual identity and
+orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment
+include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or
+advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic
+  address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+  professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable
+behavior and are expected to take appropriate and fair corrective action in
+response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or
+reject comments, commits, code, wiki edits, issues, and other contributions
+that are not aligned to this Code of Conduct, or to ban temporarily or
+permanently any contributor for other behaviors that they deem inappropriate,
+threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces
+when an individual is representing the project or its community. Examples of
+representing a project or community include using an official project e-mail
+address, posting via an official social media account, or acting as an appointed
+representative at an online or offline event. Representation of a project may be
+further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported by contacting the project team at fraggle@gmail.com. All
+complaints will be reviewed and investigated and will result in a response that
+is deemed necessary and appropriate to the circumstances. The project team is
+obligated to maintain confidentiality with regard to the reporter of an incident.
+Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good
+faith may face temporary or permanent repercussions as determined by other
+members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
+available at [http://contributor-covenant.org/version/1/4][version]
+
+[homepage]: http://contributor-covenant.org
+[version]: http://contributor-covenant.org/version/1/4/
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,66 @@
+HEAD:
+
+    General:
+    * Bash completion scripts are included. (thanks Fabian)
+    * Support the *.lmp file format in the OS X launcher (thanks Jon)
+    * Added emulation for pitch-shifting as in early versions of Doom,
+      Heretic, and Hexen. (thanks Jon)
+    * Write out aspect-correct 1600×1200 PNGs. (thanks Jon)
+    * OPL emulation is more accurate. (thanks Nuke.YKT)
+    * Futher emulation of DMX bugs with GUS cards. (thanks Nuke.YKT)
+    * Emulation of the disk icon has returned. (thanks Fabian, Jon)
+    * Checksum calculations were fixed on big endian systems, allowing
+      multiplayer games to be played in mixed little/big-endian
+      environments. (thanks GhostlyDeath, njankowski)
+
+    Build systems:
+    * Improved compatibility with BSD Make. (thanks R.Rebello)
+    * “./configure --with-PACKAGE” checks were repaired to behave
+      logically, rather than disabling the feature. (thanks R.Rebello)
+    * Default to installing the games to ${bindir}, such as /usr/local/bin,
+      rather than /usr/local/games. (thanks chungy)
+    * Support Visual Studio 2015. (thanks Azarien)
+    * Allow SDL headers and libraries to exist in the Microsoft Visual
+      Studio project directory. (thanks Quasar)
+    * Repaired the CodeBlocks projects by removing non-existent files from
+      the project files (thanks krystalgamer)
+
+    Doom:
+    * Chex Quest's level warp cheat (LEESNYDER##) was changed to behave
+      like the original EXE. (thanks Nuke.YKT)
+    * Allow starting multiplayer Chex Quest games.
+    * Allow Freedoom: Phase 1 ≤ 0.10.1 to be loaded with mods, with
+      -gameversion older than ultimate. (thanks Fabian, chungy)
+    * Added safety checks against write failures when saving a game,
+      such as when the directory is read-only.  Try falling back to a
+      temporary directory and reporting an error instead.
+      (thanks terrorcide)
+    * Versions 1.666, 1.7, and 1.8 are emulated. (thanks Nuke.YKT)
+
+    Heretic:
+    * Added map names for Episode 6, fixing a crash after completing a
+      level in this episode. (thanks J.Benaim)
+
+    Hexen:
+    * The MRJONES cheat code returns an identical string as vanilla,
+      and enables fully reproducable builds. (thanks Fabian)
+    * Fixed an issue where the game crashed while killing the Wraithverge
+      in 64-bit builds. (thanks J.Benaim)
+
+    Strife:
+    * Support added for automatic loading of the IWAD from the GOG.com
+      release of Strife: Veteran Edition on Windows. (thanks chungy)
+    * Jumping can be bound to a mouse button. (thanks Gez)
+    * Gibbing logic was changed to match vanilla behavior. (thanks Quasar)
+    * Several constants differences from vanilla were fixed. (thanks
+      Nuke.YKT, Quasar)
+    * When using -iwad, voices.wad from the IWAD's directory is prefered
+      over auto-detected DOS/Steam/GOG.com installs. (thanks Quasar)
+
+    libtextscreen:
+    * Simplified the API for creating and managing tables and columns.
+    * Allow cycling through tables with tab key.
+
 2.2.1 (2015-09-10):
 
     Chocolate Doom has not seen a great deal of "stable" patch
--- a/NOT-BUGS
+++ b/NOT-BUGS
@@ -18,7 +18,7 @@
     (read 106, should be 109)
 
     *** You may need to upgrade your version of Doom to v1.9. ***
-        See: http://doomworld.com/files/patches.shtml
+        See: https://www.doomworld.com/classicdoom/info/patches.php
         This appears to be v1.6/v1.666.
 
 This usually indicates that your IWAD file that you are using to play
@@ -130,9 +130,9 @@
 play is too complex; it was most likely designed to work with a limit
 removing source port.
 
-More information can be found here:
+More information can be found here (archived link):
 
-    http://rome.ro/lee_killough/editing/visplane.shtml
+    https://archive.is/s6h7V
 
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
--- a/README
+++ b/README
@@ -73,7 +73,7 @@
  * More information, including information about how to play various
    classic TCs, is available on the Chocolate Doom website:
 
-     http://www.chocolate-doom.org/
+     https://www.chocolate-doom.org/
 
    You are encouraged to sign up and contribute any useful information
    you may have regarding the port!
--- a/README.Music
+++ b/README.Music
@@ -18,7 +18,7 @@
 a good quality sound font is the eawpats font, which can be downloaded
 from the idgames archive as sounds/eawpats.zip:
 
-  http://www.doomworld.com/idgames/index.php?file=sounds/eawpats.zip
+  https://www.doomworld.com/idgames/sounds/eawpats
 
 Having installed a sound font, select "Native MIDI" in the sound
 configuration dialog in the setup tool, and use the "Timidity
@@ -39,7 +39,7 @@
 and are automatically detected. Otherwise, they can be downloaded
 from the idgames archive as music/dgguspat.zip:
 
-  http://www.doomworld.com/idgames/index.php?file=music/dgguspat.zip
+  https://www.doomworld.com/idgames/music/dgguspat
 
 Having downloaded the patches, select "GUS (emulated)" in the sound
 configuration dialog in the setup tool, and use the "GUS patch path"
--- a/configure.ac
+++ b/configure.ac
@@ -5,7 +5,7 @@
 PACKAGE_COPYRIGHT="Copyright (C) 1993-2015"
 PACKAGE_LICENSE="GNU General Public License, version 2"
 PACKAGE_MAINTAINER="Simon Howard"
-PACKAGE_URL="http://www.chocolate-doom.org/"
+PACKAGE_URL="https://www.chocolate-doom.org/"
 PACKAGE_ISSUES="https://github.com/chocolate-doom/chocolate-doom/issues"
 
 AC_CONFIG_AUX_DIR(autotools)
--- a/man/INSTALL.template
+++ b/man/INSTALL.template
@@ -65,6 +65,7 @@
    tnt.wad                     (Final Doom: TNT: Evilution)
    plutonia.wad                (Final Doom: Plutonia Experiment)
    chex.wad                    (Chex Quest)
+   freedm.wad                  (FreeDM)
 #endif
 #if HERETIC
    heretic1.wad                (Shareware Heretic)
@@ -81,7 +82,7 @@
 If you don't have a copy of a commercial version, you can download
 the shareware version of Doom (extract the file named doom1.wad):
 
- * http://www.doomworld.com/idgames/index.php?id=7053
+ * https://www.doomworld.com/idgames/idstuff/doom/win95/doom95
    (idstuff/doom/win95/doom95.zip in your nearest /idgames mirror)
 
 #endif
@@ -195,7 +196,7 @@
  * The IWAD file 'chex.wad', from the Chex Quest CD.
 
  * The dehacked patch 'chex.deh', which can be found here:
-   http://www.doomworld.com/idgames/?id=15420
+   https://www.doomworld.com/idgames/utils/exe_edit/patches/chexdeh
    (utils/exe_edit/patches/chexdeh.zip in your nearest /idgames mirror)
 
 Copy these files into a directory together and use the '-iwad' command
--- a/msvc/.gitignore
+++ b/msvc/.gitignore
@@ -5,3 +5,6 @@
 savegames
 strfsav*
 *.pcx
+SDL*
+begin_code.h
+close_code.h
\ No newline at end of file
--- a/opl/opl_sdl.c
+++ b/opl/opl_sdl.c
@@ -157,8 +157,6 @@
 
 static void FillBuffer(int16_t *buffer, unsigned int nsamples)
 {
-    unsigned int i;
-
     // This seems like a reasonable assumption.  mix_buffer is
     // 1 second long, which should always be much longer than the
     // SDL mix buffer.
--- a/pkg/osx/AppController.m
+++ b/pkg/osx/AppController.m
@@ -101,6 +101,11 @@
         [self->launcherManager addFileToCommandLine: fileName
                                forArgument: @"-merge"];
     }
+    else if (![extension caseInsensitiveCompare: @"lmp"])
+    {
+        [self->launcherManager addFileToCommandLine: fileName
+                               forArgument: @"-playdemo"];
+    }
     else if (![extension caseInsensitiveCompare: @"deh"])
     {
         [self->launcherManager addFileToCommandLine: fileName
--- a/pkg/osx/Info.plist.in
+++ b/pkg/osx/Info.plist.in
@@ -53,6 +53,18 @@
                 </dict>
                 <dict>
                         <key>CFBundleTypeName</key>
+                        <string>Doom demo recording</string>
+                        <key>CFBundleTypeIconFile</key>
+                        <string>wadfile.icns</string>
+                        <key>CFBundleTypeRole</key>
+                        <string>Viewer</string>
+                        <key>CFBundleTypeExtensions</key>
+                        <array>
+                                <string>lmp</string>
+                        </array>
+                </dict>
+                <dict>
+                        <key>CFBundleTypeName</key>
                         <string>Doom Dehacked patch</string>
                         <key>CFBundleTypeIconFile</key>
                         <string>wadfile.icns</string>
--- a/rpm.spec.in
+++ b/rpm.spec.in
@@ -3,7 +3,7 @@
 Summary: @PACKAGE_SHORTDESC@
 Version: @VERSION@
 Release: 1
-Source: http://www.chocolate-doom.org/downloads/@VERSION@/@PACKAGE@-@VERSION@.tar.gz
+Source: https://www.chocolate-doom.org/downloads/@VERSION@/@PACKAGE@-@VERSION@.tar.gz
 URL: @PACKAGE_URL@
 Group: Amusements/Games
 BuildRoot: /var/tmp/@PACKAGE@-buildroot
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,7 +1,7 @@
 
 SUBDIRS = doom heretic hexen strife setup
 
-execgamesdir = ${exec_prefix}/games
+execgamesdir = ${bindir}
 
 execgames_PROGRAMS = @PROGRAM_PREFIX@doom     \
                      @PROGRAM_PREFIX@heretic  \
--- a/src/d_iwad.c
+++ b/src/d_iwad.c
@@ -177,6 +177,14 @@
         SOFTWARE_KEY "\\GOG.com\\Games\\1435848742",
         "PATH",
     },
+
+    // Strife: Veteran Edition
+
+    {
+	HKEY_LOCAL_MACHINE,
+	SOFTWARE_KEY "\\GOG.com\\Games\\1432899949",
+	"PATH",
+    },
 };
 
 // Subdirectories of the above install path, where IWADs are installed.
--- a/src/d_mode.h
+++ b/src/d_mode.h
@@ -74,6 +74,16 @@
     exe_strife_1_31  // Strife v1.31
 } GameVersion_t;
 
+// What IWAD variant are we using?
+
+typedef enum
+{
+    vanilla,    // Vanilla Doom
+    freedoom,   // FreeDoom: Phase 1 + 2
+    freedm,     // FreeDM
+    bfgedition, // Doom Classic (Doom 3: BFG Edition)
+} GameVariant_t;
+
 // Skill level.
 
 typedef enum
--- a/src/doom.appdata.xml.in
+++ b/src/doom.appdata.xml.in
@@ -26,19 +26,19 @@
   </description>
   <screenshots>
     <screenshot type="default">
-      <image>http://www.chocolate-doom.org/wiki/images/9/97/GNOME_FreeDM_DEMO4.png</image>
+      <image>https://www.chocolate-doom.org/wiki/images/9/97/GNOME_FreeDM_DEMO4.png</image>
       <caption>FreeDM, DM05: Metal</caption>
     </screenshot>
     <screenshot>
-      <image>http://www.chocolate-doom.org/wiki/images/a/a6/GNOME_Doom_II_DEMO2.png</image>
+      <image>https://www.chocolate-doom.org/wiki/images/a/a6/GNOME_Doom_II_DEMO2.png</image>
       <caption>Doom II, Level 5: The Waste Tunnels</caption>
     </screenshot>
     <screenshot>
-      <image>http://www.chocolate-doom.org/wiki/images/4/41/GNOME_Doomsday_of_UAC.png</image>
+      <image>https://www.chocolate-doom.org/wiki/images/4/41/GNOME_Doomsday_of_UAC.png</image>
       <caption>Doomsday of UAC (uac_dead.wad)</caption>
     </screenshot>
     <screenshot>
-      <image>http://www.chocolate-doom.org/wiki/images/2/2a/GNOME_Freedoom_DTWID_DEMO3.png</image>
+      <image>https://www.chocolate-doom.org/wiki/images/2/2a/GNOME_Freedoom_DTWID_DEMO3.png</image>
       <caption>Doom the Way id Did, on Freedoom. Level 3-2: City of Corpses</caption>
     </screenshot>
   </screenshots>
--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -119,9 +119,6 @@
 // Store demo, do not accept any inputs
 boolean         storedemo;
 
-// "BFG Edition" version of doom2.wad does not include TITLEPIC.
-boolean         bfgedition;
-
 // If true, the main game loop has started.
 boolean         main_loop_started = false;
 
@@ -413,7 +410,7 @@
 //
 void D_DoomLoop (void)
 {
-    if (bfgedition &&
+    if (gamevariant == bfgedition &&
         (demorecording || (gameaction == ga_playdemo) || netgame))
     {
         printf(" WARNING: You are playing using one of the Doom Classic\n"
@@ -582,7 +579,7 @@
 
     // The Doom 3: BFG Edition version of doom2.wad does not have a
     // TITLETPIC lump. Use INTERPIC instead as a workaround.
-    if (bfgedition && !strcasecmp(pagename, "TITLEPIC")
+    if (gamevariant == bfgedition && !strcasecmp(pagename, "TITLEPIC")
         && W_CheckNumForName("titlepic") < 0)
     {
         pagename = DEH_String("INTERPIC");
@@ -815,9 +812,6 @@
 
 void D_SetGameDescription(void)
 {
-    boolean is_freedoom = W_CheckNumForName("FREEDOOM") >= 0,
-            is_freedm = W_CheckNumForName("FREEDM") >= 0;
-
     gamedescription = "Unknown";
 
     if (logical_gamemission == doom)
@@ -824,7 +818,7 @@
     {
         // Doom 1.  But which version?
 
-        if (is_freedoom)
+        if (gamevariant == freedoom)
         {
             gamedescription = GetGameName("Freedoom: Phase 1");
         }
@@ -847,17 +841,14 @@
     {
         // Doom 2 of some kind.  But which mission?
 
-        if (is_freedoom)
+        if (gamevariant == freedm)
         {
-            if (is_freedm)
-            {
-                gamedescription = GetGameName("FreeDM");
-            }
-            else
-            {
-                gamedescription = GetGameName("Freedoom: Phase 2");
-            }
+            gamedescription = GetGameName("FreeDM");
         }
+        else if (gamevariant == freedoom)
+        {
+            gamedescription = GetGameName("Freedoom: Phase 2");
+        }
         else if (logical_gamemission == doom2)
         {
             gamedescription = GetGameName("DOOM 2: Hell on Earth");
@@ -1129,7 +1120,7 @@
 static void LoadIwadDeh(void)
 {
     // The Freedoom IWADs have DEHACKED lumps that must be loaded.
-    if (W_CheckNumForName("FREEDOOM") >= 0)
+    if (gamevariant == freedoom || gamevariant == freedm)
     {
         // Old versions of Freedoom (before 2014-09) did not have technically
         // valid DEHACKED lumps, so ignore errors and just continue if this
@@ -1440,6 +1431,24 @@
         LoadIwadDeh();
     }
 
+    // Check which IWAD variant we are using.
+
+    if (W_CheckNumForName("FREEDOOM") >= 0)
+    {
+        if (W_CheckNumForName("FREEDM") >= 0)
+        {
+            gamevariant = freedm;
+        }
+        else
+        {
+            gamevariant = freedoom;
+        }
+    }
+    else if (W_CheckNumForName("DMENUPIC") >= 0)
+    {
+        gamevariant = bfgedition;
+    }
+
     // Doom 3: BFG Edition includes modified versions of the classic
     // IWADs which can be identified by an additional DMENUPIC lump.
     // Furthermore, the M_GDHIGH lumps have been modified in a way that
@@ -1448,10 +1457,9 @@
     // We specifically check for DMENUPIC here, before PWADs have been
     // loaded which could probably include a lump of that name.
 
-    if (W_CheckNumForName("dmenupic") >= 0)
+    if (gamevariant == bfgedition)
     {
         printf("BFG Edition: Using workarounds as needed.\n");
-        bfgedition = true;
 
         // BFG Edition changes the names of the secret levels to
         // censor the Wolfenstein references. It also has an extra
@@ -1599,7 +1607,7 @@
     }
 
     // Check for -file in shareware
-    if (modifiedgame)
+    if (modifiedgame && (gamevariant != freedoom))
     {
 	// These are the lumps that will be checked in IWAD,
 	// if any one is not present, execution will be aborted.
@@ -1638,12 +1646,12 @@
     // Freedoom's IWADs are Boom-compatible, which means they usually
     // don't work in Vanilla (though FreeDM is okay). Show a warning
     // message and give a link to the website.
-    if (W_CheckNumForName("FREEDOOM") >= 0 && W_CheckNumForName("FREEDM") < 0)
+    if (gamevariant == freedoom)
     {
         printf(" WARNING: You are playing using one of the Freedoom IWAD\n"
                " files, which might not work in this port. See this page\n"
                " for more information on how to play using Freedoom:\n"
-               "   http://www.chocolate-doom.org/wiki/index.php/Freedoom\n");
+               "   https://www.chocolate-doom.org/wiki/index.php/Freedoom\n");
         I_PrintDivider();
     }
 
--- a/src/doom/doomstat.c
+++ b/src/doom/doomstat.c
@@ -25,6 +25,7 @@
 GameMode_t gamemode = indetermined;
 GameMission_t	gamemission = doom;
 GameVersion_t   gameversion = exe_final2;
+GameVariant_t   gamevariant = vanilla;
 char *gamedescription;
 
 // Set if homebrew PWAD stuff has been added.
--- a/src/doom/doomstat.h
+++ b/src/doom/doomstat.h
@@ -56,10 +56,8 @@
 extern GameMode_t	gamemode;
 extern GameMission_t	gamemission;
 extern GameVersion_t    gameversion;
+extern GameVariant_t    gamevariant;
 extern char            *gamedescription;
-
-// If true, we're using one of the mangled BFG edition IWADs.
-extern boolean bfgedition;
 
 // Convenience macro.
 // 'gamemission' can be equal to pack_chex or pack_hacx, but these are
--- a/src/doom/g_game.c
+++ b/src/doom/g_game.c
@@ -2177,7 +2177,8 @@
                         "\n"
                         "*** You may need to upgrade your version "
                             "of Doom to v1.9. ***\n"
-                        "    See: http://doomworld.com/files/patches.shtml\n"
+                        "    See: https://www.doomworld.com/classicdoom"
+                                  "/info/patches.php\n"
                         "    This appears to be %s.";
 
         I_Error(message, demoversion, G_VanillaVersionCode(),
--- a/src/doom/m_random.c
+++ b/src/doom/m_random.c
@@ -16,11 +16,6 @@
 //	Random number LUT.
 //
 
-
-#include <time.h>
-
-#include "m_random.h"
-
 //
 // M_Random
 // Returns a 0-255 number
@@ -66,13 +61,5 @@
 
 void M_ClearRandom (void)
 {
-    prndindex = 0;
-
-    // Seed the M_Random counter from the system time
-
-    rndindex = time(NULL) & 0xff;
+    rndindex = prndindex = 0;
 }
-
-
-
-
--- a/src/doom/p_mobj.c
+++ b/src/doom/p_mobj.c
@@ -44,6 +44,12 @@
 //
 int test;
 
+// Use a heuristic approach to detect infinite state cycles: Count the number
+// of times the loop in P_SetMobjState() executes and exit with an error once
+// an arbitrary very large limit is reached.
+
+#define MOBJ_CYCLE_LIMIT 1000000
+
 boolean
 P_SetMobjState
 ( mobj_t*	mobj,
@@ -50,6 +56,7 @@
   statenum_t	state )
 {
     state_t*	st;
+    int	cycle_counter = 0;
 
     do
     {
@@ -72,6 +79,11 @@
 	    st->action.acp1(mobj);	
 	
 	state = st->nextstate;
+
+	if (cycle_counter++ > MOBJ_CYCLE_LIMIT)
+	{
+	    I_Error("P_SetMobjState: Infinite state cycle detected!");
+	}
     } while (!mobj->tics);
 				
     return true;
--- a/src/gusconf.c
+++ b/src/gusconf.c
@@ -35,7 +35,9 @@
 typedef struct
 {
     char *patch_names[MAX_INSTRUMENTS];
+    int used[MAX_INSTRUMENTS];
     int mapping[MAX_INSTRUMENTS];
+    unsigned int count;
 } gus_config_t;
 
 char *gus_patch_path = "";
@@ -109,6 +111,7 @@
 static void ParseLine(gus_config_t *config, char *line)
 {
     char *fields[6];
+    unsigned int i;
     unsigned int num_fields;
     unsigned int instr_id, mapped_id;
 
@@ -120,11 +123,33 @@
     }
 
     instr_id = atoi(fields[0]);
+
+    // Skip non GM percussions.
+    if ((instr_id >= 128 && instr_id < 128 + 35) || instr_id > 128 + 81)
+    {
+        return;
+    }
+
     mapped_id = atoi(fields[MappingIndex()]);
 
-    free(config->patch_names[instr_id]);
-    config->patch_names[instr_id] = M_StringDuplicate(fields[5]);
-    config->mapping[instr_id] = mapped_id;
+    for (i = 0; i < config->count; i++)
+    {
+        if (config->used[i] == mapped_id)
+        {
+            break;
+        }
+    }
+    
+    if (i == config->count)
+    {
+        // DMX uses wrong patch name (we should use name of 'mapped_id'
+        // instrument, but DMX uses name of 'instr_id' instead).
+        free(config->patch_names[i]);
+        config->patch_names[i] = M_StringDuplicate(fields[5]);
+        config->used[i] = mapped_id;
+        config->count++;
+    }
+    config->mapping[instr_id] = i;
 }
 
 static void ParseDMXConfig(char *dmxconf, gus_config_t *config)
@@ -137,8 +162,11 @@
     for (i = 0; i < MAX_INSTRUMENTS; ++i)
     {
         config->mapping[i] = -1;
+        config->used[i] = -1;
     }
 
+    config->count = 0;
+
     p = dmxconf;
 
     for (;;)
@@ -225,8 +253,8 @@
     }
 
     fprintf(fstream, "\ndrumset 0\n\n");
-
-    for (i = 128 + 25; i < MAX_INSTRUMENTS; ++i)
+    
+    for (i = 128 + 35; i <= 128 + 81; ++i)
     {
         if (config->mapping[i] >= 0 && config->mapping[i] < MAX_INSTRUMENTS
          && config->patch_names[config->mapping[i]] != NULL)
--- a/src/heretic.appdata.xml.in
+++ b/src/heretic.appdata.xml.in
@@ -25,19 +25,19 @@
   </description>
   <screenshots>
     <screenshot type="default">
-      <image>http://www.chocolate-doom.org/wiki/images/9/93/GNOME_Heretic_E5M4.png</image>
+      <image>https://www.chocolate-doom.org/wiki/images/9/93/GNOME_Heretic_E5M4.png</image>
       <caption>Level E5M4: Courtyard</caption>
     </screenshot>
     <screenshot>
-      <image>http://www.chocolate-doom.org/wiki/images/1/14/GNOME_Heretic_Shareware_DEMO3.png</image>
+      <image>https://www.chocolate-doom.org/wiki/images/1/14/GNOME_Heretic_Shareware_DEMO3.png</image>
       <caption>Shareware Level E1M9: The Graveyard</caption>
     </screenshot>
     <screenshot>
-      <image>http://www.chocolate-doom.org/wiki/images/3/34/GNOME_Heretic_E4M1.png</image>
+      <image>https://www.chocolate-doom.org/wiki/images/3/34/GNOME_Heretic_E4M1.png</image>
       <caption>Level E4M1: Catafalque</caption>
     </screenshot>
     <screenshot>
-      <image>http://www.chocolate-doom.org/wiki/images/4/42/GNOME_Heretic_Shareware_DEMO1.png</image>
+      <image>https://www.chocolate-doom.org/wiki/images/4/42/GNOME_Heretic_Shareware_DEMO1.png</image>
       <caption>Shareware Level E1M3: The Gatehouse</caption>
     </screenshot>
   </screenshots>
--- a/src/heretic/am_map.c
+++ b/src/heretic/am_map.c
@@ -83,7 +83,11 @@
     "E5M6:  COLONNADE",
     "E5M7:  FOETID MANSE",
     "E5M8:  FIELD OF JUDGEMENT",
-    "E5M9:  SKEIN OF D'SPARIL"
+    "E5M9:  SKEIN OF D'SPARIL",
+    // EPISODE 6: unnamed
+    "E6M1:  ",
+    "E6M2:  ",
+    "E6M3:  ",
 };
 
 static int cheating = 0;
--- a/src/hexen.appdata.xml.in
+++ b/src/hexen.appdata.xml.in
@@ -25,19 +25,19 @@
   </description>
   <screenshots>
     <screenshot type="default">
-      <image>http://www.chocolate-doom.org/wiki/images/0/0f/GNOME_Hexen_Guardian_of_Fire.png</image>
+      <image>https://www.chocolate-doom.org/wiki/images/0/0f/GNOME_Hexen_Guardian_of_Fire.png</image>
       <caption>Level "Guardian of Fire"</caption>
     </screenshot>
     <screenshot>
-      <image>http://www.chocolate-doom.org/wiki/images/5/5c/GNOME_Hexen_Effluvium.png</image>
+      <image>https://www.chocolate-doom.org/wiki/images/5/5c/GNOME_Hexen_Effluvium.png</image>
       <caption>Level "Effluvium"</caption>
     </screenshot>
     <screenshot>
-      <image>http://www.chocolate-doom.org/wiki/images/c/c1/GNOME_Hexen_Dragon_Chapel.png</image>
+      <image>https://www.chocolate-doom.org/wiki/images/c/c1/GNOME_Hexen_Dragon_Chapel.png</image>
       <caption>Level "Dragon Chapel"</caption>
     </screenshot>
     <screenshot>
-      <image>http://www.chocolate-doom.org/wiki/images/a/a7/GNOME_Hexen_Darkmere.png</image>
+      <image>https://www.chocolate-doom.org/wiki/images/a/a7/GNOME_Hexen_Darkmere.png</image>
       <caption>Level "Darkmere"</caption>
     </screenshot>
   </screenshots>
--- a/src/hexen/h2_main.c
+++ b/src/hexen/h2_main.c
@@ -290,7 +290,7 @@
             "You are trying to use the Hexen v1.0 IWAD. This isn't\n"
             "supported by " PACKAGE_NAME ". Please upgrade to the v1.1\n"
             "IWAD file. See here for more information:\n"
-            "  http://www.doomworld.com/classicdoom/info/patches.php");
+            "  https://www.doomworld.com/classicdoom/info/patches.php");
     }
 }
 
--- a/src/mus2mid.c
+++ b/src/mus2mid.c
@@ -403,7 +403,7 @@
 
             // First time using the channel, send an "all notes off"
             // event. This fixes "The D_DDTBLU disease" described here:
-            // http://www.doomworld.com/vb/source-ports/66802-the
+            // https://www.doomworld.com/vb/source-ports/66802-the
             WriteChangeController_Valueless(channel_map[mus_channel], 0x7b,
                                             midioutput);
         }
--- a/src/setup/Makefile.am
+++ b/src/setup/Makefile.am
@@ -1,6 +1,4 @@
 
-gamesdir = $(prefix)/games
-
 AM_CFLAGS = @SDL_CFLAGS@                                           \
             @SDLMIXER_CFLAGS@                                      \
             -I$(top_srcdir)/textscreen -I$(top_srcdir)/src
--- a/src/setup/compatibility.c
+++ b/src/setup/compatibility.c
@@ -22,7 +22,7 @@
 
 #include "compatibility.h"
 
-#define WINDOW_HELP_URL "http://www.chocolate-doom.org/setup-compat"
+#define WINDOW_HELP_URL "https://www.chocolate-doom.org/setup-compat"
 
 int vanilla_savegame_limit = 1;
 int vanilla_demo_limit = 1;
--- a/src/setup/display.c
+++ b/src/setup/display.c
@@ -28,7 +28,7 @@
 #include "display.h"
 #include "config.h"
 
-#define WINDOW_HELP_URL "http://www.chocolate-doom.org/setup-display"
+#define WINDOW_HELP_URL "https://www.chocolate-doom.org/setup-display"
 
 extern void RestartTextscreen(void);
 
--- a/src/setup/joystick.c
+++ b/src/setup/joystick.c
@@ -29,7 +29,7 @@
 #include "txt_joyaxis.h"
 #include "txt_joybinput.h"
 
-#define WINDOW_HELP_URL "http://www.chocolate-doom.org/setup-gamepad"
+#define WINDOW_HELP_URL "https://www.chocolate-doom.org/setup-gamepad"
 
 typedef struct
 {
--- a/src/setup/keyboard.c
+++ b/src/setup/keyboard.c
@@ -25,7 +25,7 @@
 #include "joystick.h"
 #include "keyboard.h"
 
-#define WINDOW_HELP_URL "http://www.chocolate-doom.org/setup-keyboard"
+#define WINDOW_HELP_URL "https://www.chocolate-doom.org/setup-keyboard"
 
 int vanilla_keyboard_mapping = 1;
 
--- a/src/setup/mainmenu.c
+++ b/src/setup/mainmenu.c
@@ -38,7 +38,7 @@
 #include "multiplayer.h"
 #include "sound.h"
 
-#define WINDOW_HELP_URL "http://www.chocolate-doom.org/setup"
+#define WINDOW_HELP_URL "https://www.chocolate-doom.org/setup"
 
 static const int cheat_sequence[] =
 {
--- a/src/setup/mouse.c
+++ b/src/setup/mouse.c
@@ -25,7 +25,7 @@
 #include "mode.h"
 #include "mouse.h"
 
-#define WINDOW_HELP_URL "http://www.chocolate-doom.org/setup-mouse"
+#define WINDOW_HELP_URL "https://www.chocolate-doom.org/setup-mouse"
 
 static int usemouse = 1;
 
--- a/src/setup/multiplayer.c
+++ b/src/setup/multiplayer.c
@@ -34,10 +34,10 @@
 #include "net_io.h"
 #include "net_query.h"
 
-#define MULTI_START_HELP_URL "http://www.chocolate-doom.org/setup-multi-start"
-#define MULTI_JOIN_HELP_URL "http://www.chocolate-doom.org/setup-multi-join"
-#define MULTI_CONFIG_HELP_URL "http://www.chocolate-doom.org/setup-multi-config"
-#define LEVEL_WARP_HELP_URL "http://www.chocolate-doom.org/setup-level-warp"
+#define MULTI_START_HELP_URL "https://www.chocolate-doom.org/setup-multi-start"
+#define MULTI_JOIN_HELP_URL "https://www.chocolate-doom.org/setup-multi-join"
+#define MULTI_CONFIG_HELP_URL "https://www.chocolate-doom.org/setup-multi-config"
+#define LEVEL_WARP_HELP_URL "https://www.chocolate-doom.org/setup-level-warp"
 
 #define NUM_WADS 10
 #define NUM_EXTRA_PARAMS 10
--- a/src/setup/sound.c
+++ b/src/setup/sound.c
@@ -25,7 +25,7 @@
 #include "mode.h"
 #include "sound.h"
 
-#define WINDOW_HELP_URL "http://www.chocolate-doom.org/setup-sound"
+#define WINDOW_HELP_URL "https://www.chocolate-doom.org/setup-sound"
 
 typedef enum
 {
--- a/src/strife.appdata.xml.in
+++ b/src/strife.appdata.xml.in
@@ -26,19 +26,19 @@
   </description>
   <screenshots>
     <screenshot type="default">
-      <image>http://www.chocolate-doom.org/wiki/images/b/b2/GNOME_Strife_Rowan.png</image>
+      <image>https://www.chocolate-doom.org/wiki/images/b/b2/GNOME_Strife_Rowan.png</image>
       <caption>Talking to Rowan</caption>
     </screenshot>
     <screenshot>
-      <image>http://www.chocolate-doom.org/wiki/images/1/1f/GNOME_Strife_Town.png</image>
+      <image>https://www.chocolate-doom.org/wiki/images/1/1f/GNOME_Strife_Town.png</image>
       <caption>The Town</caption>
     </screenshot>
     <screenshot>
-      <image>http://www.chocolate-doom.org/wiki/images/8/8a/GNOME_Strife_Opening.png</image>
+      <image>https://www.chocolate-doom.org/wiki/images/8/8a/GNOME_Strife_Opening.png</image>
       <caption>Opening Cinematic</caption>
     </screenshot>
     <screenshot>
-      <image>http://www.chocolate-doom.org/wiki/images/c/c4/GNOME_Strife_Sewage.png</image>
+      <image>https://www.chocolate-doom.org/wiki/images/c/c4/GNOME_Strife_Sewage.png</image>
       <caption>In the sewage</caption>
     </screenshot>
   </screenshots>
--- a/src/strife/am_map.c
+++ b/src/strife/am_map.c
@@ -320,11 +320,10 @@
 //
 void AM_addMark(void)
 {
-    markpoints[markpointnum].x = m_x + m_w/2;
-    markpoints[markpointnum].y = m_y + m_h/2;
+    markpoints[markpointnum].x = plr->mo->x; // 20160306 [STRIFE]: use player position
+    markpoints[markpointnum].y = plr->mo->y;
     //markpointnum = (markpointnum + 1) % AM_NUMMARKPOINTS;
     ++markpointnum; // haleyjd 20141101: [STRIFE] does not wrap around
-
 }
 
 //
--- a/src/strife/d_main.c
+++ b/src/strife/d_main.c
@@ -832,49 +832,48 @@
     // Load voices.wad 
     if(isregistered)
     {
-        char *name = D_FindWADByName("voices.wad");
+        char *name = NULL;
+        int p;
 
-        if(!name) // not found?
+        // If -iwad was used, check and see if voices.wad exists on the same
+        // filepath.
+        if((p = M_CheckParm("-iwad")) && p < myargc - 1)
         {
-            int p;
+            char   *iwad     = myargv[p + 1];
+            size_t  len      = strlen(iwad) + 1;
+            char   *iwadpath = Z_Malloc(len, PU_STATIC, NULL);
+            char   *voiceswad;
 
-            // haleyjd STRIFE-FIXME: Temporary?
-            // If -iwad was used, check and see if voices.wad exists on the
-            // same filepath.
-            if((p = M_CheckParm("-iwad")) && p < myargc - 1)
-            {
-                char   *iwad     = myargv[p + 1];
-                size_t  len      = strlen(iwad) + 1;
-                char   *iwadpath = Z_Malloc(len, PU_STATIC, NULL);
-                char   *voiceswad;
-                
-                // extract base path of IWAD parameter
-                M_GetFilePath(iwad, iwadpath, len);
-                
-                // concatenate with /voices.wad
-                voiceswad = M_SafeFilePath(iwadpath, "voices.wad");
-                Z_Free(iwadpath);
-
-                if(!M_FileExists(voiceswad))
-                {
-                    disable_voices = 1;
-                    Z_Free(voiceswad);
-                }
-                else
-                    name = voiceswad; // STRIFE-FIXME: memory leak!!
-            }
+            // extract base path of IWAD parameter
+            M_GetFilePath(iwad, iwadpath, len);
+
+            // concatenate with /voices.wad
+            voiceswad = M_SafeFilePath(iwadpath, "voices.wad");
+            Z_Free(iwadpath);
+
+            if(!M_FileExists(voiceswad))
+                Z_Free(voiceswad);
             else
-                disable_voices = 1;
+                name = voiceswad; // STRIFE-FIXME: memory leak!!
         }
 
-        if(disable_voices) // voices disabled?
+        // not found? try global search paths
+        if(!name)
+            name = D_FindWADByName("voices.wad");
+
+        // still not found? too bad.
+        if(!name)
         {
+            disable_voices = 1;
+
             if(devparm)
                  printf("Voices disabled\n");
-            return;
         }
-
-        D_AddFile(name);
+        else
+        {
+            // add it.
+            D_AddFile(name);
+        }
     }
 }
 
--- a/src/strife/g_game.c
+++ b/src/strife/g_game.c
@@ -2329,7 +2329,8 @@
                         "\n"
                         "*** You may need to upgrade your version "
                             "of Strife to v1.1 or later. ***\n"
-                        "    See: http://doomworld.com/files/patches.shtml\n"
+                        "    See: https://www.doomworld.com/classicdoom"
+                                  "/info/patches.php\n"
                         "    This appears to be %s.";
 
         I_Error(message, demoversion, STRIFE_VERSION,
--- a/src/strife/p_enemy.c
+++ b/src/strife/p_enemy.c
@@ -1240,7 +1240,7 @@
     {
         int     t          = P_Random();
         angle_t shootangle = actor->angle + ((t - P_Random()) << 20);
-        int     damage     = (P_Random() & 7) + 1;
+        int     damage     = 3*((P_Random() & 7) + 1);
 
         P_LineAttack(actor, shootangle, 2048*FRACUNIT, slope, damage);
         ++i;
@@ -2211,7 +2211,7 @@
     A_FaceTarget(actor);
     if(P_CheckMeleeRange(actor))
     {
-        int damage = 8 * (P_Random() % 10 + 1);
+        int damage = 6 * (P_Random() % 10 + 1);
         
         S_StartSound(actor, sfx_mtalht);
         P_DamageMobj(actor->target, actor, actor, damage);
@@ -3177,7 +3177,10 @@
     // beacon no longer special
     actor->flags &= ~MF_SPECIAL;
 
-    // set color and flags
+    // 20160306: set rebel threshold
+    mobj->threshold = 100;
+
+    // set rebel color and flags
     mobj->flags |= ((actor->miscdata << MF_TRANSSHIFT) | MF_NODIALOG);
     mobj->target = NULL;
 
--- a/src/strife/p_inter.c
+++ b/src/strife/p_inter.c
@@ -488,13 +488,13 @@
         break;
 
     // missile
-    case SPR_ROKT:
+    case SPR_MSSL:
         if(!P_GiveAmmo(player, am_missiles, 1))
             return;
         break;
 
     // box of missiles
-    case SPR_MSSL:
+    case SPR_ROKT:
         if(!P_GiveAmmo(player, am_missiles, 5))
             return;
         break;
@@ -852,9 +852,9 @@
             }
         }
 
-        target->flags &= ~MF_SOLID;
+        //target->flags &= ~MF_SOLID;
         target->player->playerstate = PST_DEAD;
-        target->player->mo->momz = 5*FRACUNIT;  // [STRIFE]: small hop!
+        target->player->mo->momz += 5*FRACUNIT;  // [STRIFE]: small hop!
         P_DropWeapon(target->player);
 
         if(target->player == &players[consoleplayer]
@@ -1352,7 +1352,7 @@
             if(target->player)
             {
                 target->player->cheats |= CF_ONFIRE;
-                target->player->powers[pw_communicator] = false;
+                target->player->powers[pw_invisibility] = false;
                 target->player->readyweapon = 0;
                 P_SetPsprite(target->player, ps_weapon, S_WAVE_00); // 02
                 P_SetPsprite(target->player, ps_flash, S_NULL);
--- a/src/strife/p_pspr.c
+++ b/src/strife/p_pspr.c
@@ -854,7 +854,7 @@
         mo->health = -1;
         if(!linetarget)
         {
-            an = player->pitch >> ANGLETOFINESHIFT;
+            an = (unsigned int)player->pitch >> ANGLETOFINESHIFT;
             mo->momz += FixedMul(finesine[an], mo->info->speed); 
         }
         break;