// Chocolate-heretic Blasphemer Version 0.3
// Chocolate-heretic-plus bumps limits and removes crashing menu. 
// Version 0.3 enables "DrawPatch" crashes, but removes offending menu item.
// Designed so that Blasphemer will not crash with normal usage and settings.
// Make a new directory and run these two commands in it.
//
// $ git clone https://github.com/chocolate-doom/chocolate-doom
// $ patch -p0  < chocolate-heretic-plus-sbv3.patch
//
// Recommend renaming the chocolate-heretic binary and moving it to where 
// 	the other chocolate-doom binaries are.
// Mouse sensitivity can be adjusted with chocolate-doom's setup binaries.

diff -ruN chocolate-heretic-plus/src/heretic/doomdef.h chocolate-doom/src/heretic/doomdef.h
--- chocolate-heretic-plus/src/heretic/doomdef.h	2021-09-17 15:28:21.141321438 -0400
+++ chocolate-doom/src/heretic/doomdef.h	2021-09-17 15:31:19.888282967 -0400
@@ -547,7 +547,7 @@
 
 extern ticcmd_t *netcmds;
 
-#define SAVEGAMESIZE 0x30000
+#define SAVEGAMESIZE 0x30000*16
 #define SAVESTRINGSIZE 24
 
 extern mapthing_t *deathmatch_p;
diff -ruN chocolate-heretic-plus/src/heretic/mn_menu.c chocolate-doom/src/heretic/mn_menu.c
--- chocolate-heretic-plus/src/heretic/mn_menu.c	2021-09-17 15:28:21.153321906 -0400
+++ chocolate-doom/src/heretic/mn_menu.c	2021-09-17 15:31:37.224958101 -0400
@@ -94,7 +94,6 @@
 static boolean SCQuitGame(int option);
 static boolean SCEpisode(int option);
 static boolean SCSkill(int option);
-static boolean SCMouseSensi(int option);
 static boolean SCSfxVolume(int option);
 static boolean SCMusicVolume(int option);
 static boolean SCScreenSize(int option);
@@ -249,7 +248,6 @@
 static MenuItem_t OptionsItems[] = {
     {ITT_EFUNC, "END GAME", SCEndGame, 0, MENU_NONE},
     {ITT_EFUNC, "MESSAGES : ", SCMessages, 0, MENU_NONE},
-    {ITT_LRFUNC, "MOUSE SENSITIVITY", SCMouseSensi, 0, MENU_NONE},
     {ITT_EMPTY, NULL, NULL, 0, MENU_NONE},
     {ITT_SETMENU, "MORE...", NULL, 0, MENU_OPTIONS2}
 };
@@ -257,7 +255,7 @@
 static Menu_t OptionsMenu = {
     88, 30,
     DrawOptionsMenu,
-    5, OptionsItems,
+    4, OptionsItems,
     0,
     MENU_MAIN
 };
@@ -701,7 +699,7 @@
     {
         MN_DrTextB(DEH_String("OFF"), 196, 50);
     }
-    DrawSlider(&OptionsMenu, 3, 10, mouseSensitivity);
+
 }
 
 //---------------------------------------------------------------------------
diff -ruN chocolate-heretic-plus/src/heretic/p_spec.h chocolate-doom/src/heretic/p_spec.h
--- chocolate-heretic-plus/src/heretic/p_spec.h	2021-09-17 15:28:21.165322373 -0400
+++ chocolate-doom/src/heretic/p_spec.h	2021-09-17 15:31:19.888282967 -0400
@@ -55,7 +55,7 @@
 //
 //      Animating line specials
 //
-#define	MAXLINEANIMS		64
+#define	MAXLINEANIMS		64*256
 extern short numlinespecials;
 extern line_t *linespeciallist[MAXLINEANIMS];
 
@@ -233,7 +233,7 @@
 
 #define	PLATWAIT	3
 #define	PLATSPEED	FRACUNIT
-#define	MAXPLATS	30
+#define	MAXPLATS	30*256
 
 extern plat_t *activeplats[MAXPLATS];
 
diff -ruN chocolate-heretic-plus/src/heretic/r_bsp.c chocolate-doom/src/heretic/r_bsp.c
--- chocolate-heretic-plus/src/heretic/r_bsp.c	2021-09-17 15:28:21.165322373 -0400
+++ chocolate-doom/src/heretic/r_bsp.c	2021-09-17 15:31:19.888282967 -0400
@@ -67,7 +67,7 @@
 // render overage and then bomb out by detecting the overflow after the 
 // fact. -haleyjd
 //#define MAXSEGS 32
-#define MAXSEGS (SCREENWIDTH / 2 + 1)
+#define MAXSEGS (SCREENWIDTH / 2 + 1)*8
 
 cliprange_t solidsegs[MAXSEGS], *newend;        // newend is one past the last valid seg
 
@@ -448,7 +448,7 @@
     }
 
     // check for solidsegs overflow - extremely unsatisfactory!
-    if(newend > &solidsegs[32])
+    if(newend > &solidsegs[32*8])
         I_Error("R_Subsector: solidsegs overflow (vanilla may crash here)\n");
 }
 
diff -ruN chocolate-heretic-plus/src/heretic/r_local.h chocolate-doom/src/heretic/r_local.h
--- chocolate-heretic-plus/src/heretic/r_local.h	2021-09-17 15:28:21.165322373 -0400
+++ chocolate-doom/src/heretic/r_local.h	2021-09-17 15:31:19.888282967 -0400
@@ -147,8 +147,8 @@
 
 typedef byte lighttable_t;      // this could be wider for >8 bit display
 
-#define	MAXVISPLANES	128
-#define	MAXOPENINGS		SCREENWIDTH*64
+#define	MAXVISPLANES	128*8
+#define	MAXOPENINGS		SCREENWIDTH*64*8
 
 typedef struct
 {
@@ -184,7 +184,7 @@
 #define SIL_TOP		2
 #define	SIL_BOTH	3
 
-#define	MAXDRAWSEGS		256
+#define	MAXDRAWSEGS		256*8
 
 // A vissprite_t is a thing that will be drawn during a refresh
 typedef struct vissprite_s
@@ -400,7 +400,7 @@
 //
 // R_things.c
 //
-#define	MAXVISSPRITES	128
+#define	MAXVISSPRITES	128*8
 
 extern vissprite_t vissprites[MAXVISSPRITES], *vissprite_p;
 extern vissprite_t vsprsortedhead;
