ref: 48918f22c81e7b40188fb647f5fdbe360b0b9877
parent: bef4378c5cac18cea163dcdd6aea424e08e56ebf
author: qwx <qwx@sciops.net>
date: Wed Jan 15 19:30:33 EST 2025
add doom-iwad: custom iwad and engine selection
--- /dev/null
+++ b/doom-iwad
@@ -1,0 +1,35 @@
+diff d5938c597328adb8abb8785b4ac820ca0f094b6b uncommitted
+--- a/sys/src/games/doom/d_main.c
++++ b/sys/src/games/doom/d_main.c
+@@ -578,6 +578,7 @@
+ //
+ void IdentifyVersion (void)
+ {
++ int p;
+ char *wadfile, *slash;
+
+ if (M_CheckParm ("-shdev"))
+@@ -623,7 +624,22 @@
+ */
+ }
+
+- if ( (wadfile = I_IdentifyWAD("doom2f.wad")) ) {
++ p = M_CheckParm ("-iwad");
++ if (p && p < myargc-1 && (wadfile = I_IdentifyWAD(myargv[p+1])) )
++ {
++ p = M_CheckParm ("-gamemode");
++ gamemode = commercial;
++ if (p && p < myargc-1)
++ {
++ if (!strcmp(myargv[p+1], "ultimate"))
++ gamemode = retail;
++ else if (!strcmp(myargv[p+1], "registered"))
++ gamemode = registered;
++ else if (!strcmp(myargv[p+1], "shareware"))
++ gamemode = shareware;
++ }
++ D_AddFile (wadfile);
++ } else if ( (wadfile = I_IdentifyWAD("doom2f.wad")) ) {
+ gamemode = commercial;
+ // C'est ridicule!
+ // Let's handle languages in config files, okay?