Page 2 of 2
Re: 2 Obscure WinQuake fixes
Posted: Wed Sep 17, 2014 1:31 am
by Baker
Do these kind of things crash the id386 asm too?
I ask because some of calculations in C work slightly dfferently if id386 is defined.
Like does the sprite draw Z issue crash the asm code too?
Re: 2 Obscure WinQuake fixes
Posted: Fri Sep 19, 2014 11:39 pm
by mankrip
Baker wrote:Do these kind of things crash the id386 asm too?
Yes. I always test my code with the x86 ASM enabled.
But I also test the pure C code when finding such bugs, and Makaqu's model crash bug is in there too.
Baker wrote:Like does the sprite draw Z issue crash the asm code too?
Yes. However, I didn't test this one to see if it happens in pure C.
Re: 2 Obscure WinQuake fixes
Posted: Sat Sep 20, 2014 1:24 am
by leileilol
It also happens in pure C. I believe it has to do with drawing one whole pixel covering the screen, and trying to draw the next but it couldn't find a space for it and has an access violation right there. An alternative way to fix this would be better sprite clipping code that's more aware of screen boundaries
Re: 2 Obscure WinQuake fixes
Posted: Tue Sep 23, 2014 12:43 am
by qbism
Is there a specific scenario that can duplicate this crash?
Re: 2 Obscure WinQuake fixes
Posted: Wed Sep 24, 2014 8:05 am
by Baker
qbism wrote:Is there a specific scenario that can duplicate this crash?
For me, it is very hard to create the scenario. I have had it exactly once during debugging ever, despite trying to cause the conditions to occur again.
There might be a consistent way to cause it, but I am unaware of it.
Re: 2 Obscure WinQuake fixes
Posted: Fri Sep 26, 2014 1:34 am
by mankrip
qbism wrote:Is there a specific scenario that can duplicate this crash?
In the previous page:
leileilol wrote:I discovered the crash happening in Quake 1.01 (yes this crash goes way back, errormessage spewing something about surfacecache) after trying a mod that spammed bubbles exactly at the view, where swimming backwards would trigger a crash. I kept reproducing this crash, kept debugging and managed to fix it around 2012 as well (without any knowledge of szo's fix).
Also, much like Hexen II, the mod was also programmed by Mike Gummelt. XD so props to him for coding stuff that triggers obscure engine crashes easily in '96!
Re: 2 Obscure WinQuake fixes
Posted: Fri Sep 26, 2014 3:37 am
by qbism
Got it. Easiest to duplicate with a stationary sprite. Move back and forth through it slowly. Normally engine will stop rendering the sprite when pixel height is almost full screen but eventually will crash.