[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - WinQuake without SciTech MGL (now with added DirectDraw)

WinQuake without SciTech MGL (now with added DirectDraw)

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Postby frag.machine » Tue Aug 10, 2010 8:11 pm

I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2120
Joined: Sat Nov 25, 2006 1:49 pm

Postby mh » Tue Aug 10, 2010 8:34 pm

User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby mh » Mon Oct 25, 2010 1:25 am

It took a while but here it is: the version with DirectDraw as well.



This is 32-bit DirectDraw because I didn't want to go messing around with exclusive mode, losing the surface, different modes for fullscreen vs windowed, and crap like that. I'll leave it as an exercise for anyone who wants to do an 8-bit version.

It still runs faster than the GDI version (which it's 100% compatible with, drop-'n'-go replace) despite this (might be slower on Windows 7 though). Just popped it into a test build and even a year after I wrote it, it still works just fine.

You can switch between the DirectDraw and the GDI drivers by using the "vid_ddraw" cvar.

I had another version that also supported GDI+ and Direct3D drivers, but both performed poorly. It should be possible to do an OpenGL driver for this too, by the way...
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby leileilol » Mon Oct 25, 2010 1:29 am

How would doing an MMX overlay work out for performance? On a P2/P3 that is (PMMX , K6 and 6x86MX wouldn't do so well)

ok, im annoying. i'll try this out
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby mh » Mon Oct 25, 2010 1:37 am

No idea. The DirectDraw portion of the code is pretty close to optimal as-is (at least for 32-bit), so I doubt if there's much more to be squeezed out of that (aside from going 8-bit, of course, and I could be wrong).

I've compiled both Win and GL Quake using MSVC 2008 with support for SSE and SSE2 instructions, trusting the compiler to work out what's best (which it's pretty damn good at), and got no performance improvements at all. In the case of WinQuake that's obviously the asm at work preventing it, in the case of GLQuake it suggests any bottlenecks that exist are elsewhere.

It would be interesting to compare an SSE2 WinQuake with an asm WinQuake though. Be nice to be able to get rid of the asm. You could write directly to the DirectDraw surface then instead of having to go through an intermediate system memory buffer. And start updating the software renderer for full proper 32-bit support too.
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby Spike » Mon Oct 25, 2010 12:04 pm

.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby mh » Mon Oct 25, 2010 1:36 pm

User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Postby Spike » Mon Oct 25, 2010 2:25 pm

I don't know what you're testing, but its not framerates/frametimes in quake. :)

Try rewriting your test loop using the msvc intrinsics, do four elements at a time, then see if its still slower.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby leileilol » Fri Nov 19, 2010 4:42 am

leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: WinQuake without SciTech MGL (now with added DirectDraw)

Postby szo » Sat Mar 03, 2012 7:52 pm

Have been using the dib sections code in my hexen2 project, uhexen2: first tested as is with the bottom-up dib setup, it worked, by magical means, in 32 bits only, whereas in 64 bits it failed miserably. Tried to understand the reason, got bored, and switched to using a top-down setup by feeding -DIBWidth to VID_CreateDIB() as the lazy solution albeit the result being somehow slower.

Noticed today that one big difference between q1 and q2 code is that the width, height, and most importantly the rowbytes member of the viddef_t structure is unsigned int in q1 but signed int in q2: the bottom-up dib section code might as well be the reason for the change. For the bottom-up setup, we are assigning -width to vid.rowbytes, which is unsigned in q1, and it works in 32 bits because the address space is 4 gb and you get a wraparound in pointer atrithmetics. However in win64 that doesn't happen with 64 bit pointers and you simply get a segfault.

In short, the dib code here is really meant for signed int vid.rowbytes. In case anyone ever runs into such failures...

Just applying patches to uhexen2 now, changing the width, height, conwidth, conheight and rowbytes members to signed int. The conrowbytes member is already signed so that's ok already. Shame that I nailed the issue this late, but better late than never.



szo
 
Posts: 132
Joined: Mon Dec 06, 2010 4:42 pm

Re: WinQuake without SciTech MGL (now with added DirectDraw)

Postby qbism » Sat Mar 03, 2012 9:57 pm

User avatar
qbism
 
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am

Re: WinQuake without SciTech MGL (now with added DirectDraw)

Postby Vic » Wed Mar 07, 2012 10:52 pm

Too bad I've never actually ported tochris to using DDraw init code :/ Along with proper renderer separation a-la Quake2. Good job anyway!

Off-topic: Although I don't get this obsession with asm code removal, it still performs a ton better than the C version.
User avatar
Vic
 
Posts: 21
Joined: Sun Nov 07, 2010 12:42 am

Re: WinQuake without SciTech MGL (now with added DirectDraw)

Postby qbism » Thu Mar 08, 2012 12:00 am

User avatar
qbism
 
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am

Re: WinQuake without SciTech MGL (now with added DirectDraw)

Postby mankrip » Mon Nov 26, 2012 6:46 pm

Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
/ /
User avatar
mankrip
 
Posts: 915
Joined: Fri Jul 04, 2008 3:02 am

Re: WinQuake without SciTech MGL (now with added DirectDraw)

Postby mh » Mon Nov 26, 2012 8:00 pm

It was needed on XP because the old driver model reserved those palette indexes for it's own use (long-standing NT issue). Can't exactly remember the thinking behind setting them to 0/0xff though. Either using an 8-bit buffer that's expanded to 32-bit at Flip time, or a WDDM driver, should remove the requirement for it.
User avatar
mh
 
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

PreviousNext

Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 2 guests