shithub: qk1

Download patch

ref: cb2c442bc7239d3f50691812f9a7aa7f4ced50a8
parent: 216c1ae66ef6967d1a470a431418241c001c708b
author: Konstantinn Bonnet <[email protected]>
date: Thu Feb 19 05:52:25 EST 2015

up resolution limit to an arbitrary 4096x4096

fixes invalid writes and reads after resize or on init when resolution too large

--- a/README
+++ b/README
@@ -1,33 +1,25 @@
 qk1 - (9) quake
 ===============
-	- based on linux/x11 code from original release
 	- setup:
 		. mk install
 		. mkdir id1
 		. cp /n/quakecd/id1/*.pak id1/
 		. run from same dir...
-	- unfinished and very buggy (both shitty new code and badly ported old code)
-	- sound works, but is glitchy and reduces FPS quite a bit
+	- sound works, but is glitchy and reduces FPS quite a bit, esp. high resolutions
 	- cdaudio, networking: PORTME
-	- assume high resolutions don't work well and are very crash prone (e.g. > 800x600)
-		. exit with: Hunk_Alloc: failed on ... => not enough memory (default 8M);
-		->use [-mem megabytes], e.g.:
-			% qk1 -nosound -mem 10
-		. if window size < physical screen size, swipe mouse super fast to exit
-		the window (bug in mproc())
-		. actually, I've seen only two points where it segfaults, and it's fairly
-		constant
-	- resolutions under 320x240 don't seem to work
+	- high resolutions work up to 4096x4096 (arbitrary limit in r_shared.h)
+		. by default, quake uses a 8MB heap, which will be insufficient for higher
+		resolutions → exit with "Hunk_Alloc: failed on ..."
+			-> use -mem param, e.g.
+			% qk1 -mem 24
+		. resolutions under e.g. 320x240 don't work
 	- don't use -winsize, -width, -height; just resize the window (bugsbugsbugs)
 	- mouse is grabbed using m_windowed cvar
 		. open console (~)
 		. type m_windowed 1 (can autocomplete w/ tab)
-		. setting now saved in id1/config.cfg
+		. setting saved on exit in id1/config.cfg
 	- official expansions (rogue and hipnotic) work fine, mods could too
 	- tested on 386 and amd64 only (works ok on a pentium 4)
-	- the point of THIS port is to make it work on plan9, and be portable across
-	cputypes on plan9, which justifies some more intrusive changes (but is a bad
-	justification)
 
 
 some params useful for workarounds
@@ -43,6 +35,7 @@
 
 port notes
 ----------
+	- based on linux/x11 code from original release
 	- pr_strings: assumed 32bit pointer arithmetic: use PR_GetStr() instead of
 	  dealing with it directly; may be ass
 	- global cppdefotomy, removing code seen as useless for plan9
@@ -57,8 +50,8 @@
 	saved on exit; maybe there's a better way
 
 
-bugs present in linux/x11 (w/ my workaround for amd64)
-------------------------------------------------------
+todo/issues
+-----------
 	- compile with PARANOID -> MSG_WriteByte complains about range error and
 	  exits. no idea why.
 	- new game while already ingame -> front falls off
@@ -65,19 +58,8 @@
 		. most of the time: exits with R_RenderView: called without enough stack
 		. sometimes: goes batshit on the console (->press y again and quit normally, etc.)
 	- compile with BAN_TEST -> net_dgrm build fails
-	- sprites/particles not scaled on high resolutions
-	- mouselook was completely fucked; still is somewhat
-		. when paused, if _windowed_mouse 1, can still look around with the mouse, even
-		if world is frozen
-	- fp exceptions galore
-	- high resolutions -> casts Anxiodepressive Disorder on user
-	- resizing to smaller window -> no.
-	- resizing several times -> no.
-	- seemingly random crashes on startup (fp?)
-
-
-todo/issues
------------
+	- sprites/particles not scaled correctly on high resolutions
+	- m_windowed 1: can still look around in frozen world when paused
 	- net_9p.c
 	- cd_9.c,net_udp.c,net_dgrm.c: actuallyport
 	- snd_9.c, vid_9.c: lousy
--- a/r_shared.h
+++ b/r_shared.h
@@ -10,8 +10,8 @@
 #define MAXWORKINGVERTS	(MAXVERTS+4)	// max points in an intermediate
 										//  polygon (while processing)
 // !!! if this is changed, it must be changed in d_ifacea.h too !!!
-#define	MAXHEIGHT		1024
-#define	MAXWIDTH		1280
+#define	MAXHEIGHT		4096
+#define	MAXWIDTH		4096
 #define MAXDIMENSION	((MAXHEIGHT > MAXWIDTH) ? MAXHEIGHT : MAXWIDTH)
 
 #define SIN_BUFFER_SIZE	(MAXDIMENSION+CYCLE)
--- a/u/d_ifacea.h
+++ b/u/d_ifacea.h
@@ -19,7 +19,7 @@
 #define	CYCLE	128
 
 // !!! if this is changed, it must be changed in r_shared.h too !!!
-#define	MAXHEIGHT	1024
+#define	MAXHEIGHT	4096
 
 // !!! if this is changed, it must be changed in quakedef.h too !!!
 #define CACHE_SIZE	32		// used to align key data structures