Carmageddon fix

Developer's Forum, for discussion of bugs, code, and other developmental aspects of OpenGLide.

Carmageddon fix

Postby gulikoza » 2010-10-25 @ 14:27

When running inside DOSBox, Carmageddon only shows black screen when the movies are supposed to be shown. It works fine with dgVoodoo.
I figured out, Carmageddon issues a LFB lock but never bothers to unlock the buffer (as that would actually trigger buffer update in openglide, instead the buffer remains empty). Glide reference specifically states that an application can only call grLfbLock and grLfbUnlock when it holds a lock to a buffer and cannot use other commands.
The following patch issues a buffer unlock when grSwapBuffers is called and re-locks the buffer after the SwapBuffers. It's against what reference manual says (even if SwapBuffers implicitly unlocked the buffer on real hardware, the application could not expect the LFB pointer to remain valid after the buffer swap), but it makes the game work :happy:
Attachments
openglide-carma.diff
(557 Bytes) Downloaded 787 times
Last edited by gulikoza on 2010-10-26 @ 12:29, edited 1 time in total.
User avatar
gulikoza
Oldbie
 
Posts: 1618
Joined: 2004-6-25 @ 14:53

Re: Carmageddon fix

Postby Miki Maus » 2010-10-25 @ 17:14

Interesting, because Carmageddon works fine with openglide when using glidos.

Keep up the good work! :wink:
User avatar
Miki Maus
Member
 
Posts: 197
Joined: 2004-10-18 @ 22:19
Location: Cave

Re: Carmageddon fix

Postby thedoctor45 » 2010-10-25 @ 17:21

you can also fix the problem by adding the -vrush argument to carmav.exe.
User avatar
thedoctor45
Newbie
 
Posts: 37
Joined: 2010-7-12 @ 16:40

Re: Carmageddon fix

Postby thedoctor45 » 2010-10-26 @ 02:16

hmm... with the hires and carmageddon patches the 3Dfx version of BLOOD now looks like this:

Image

any idea what could cause that and how to debug this?
User avatar
thedoctor45
Newbie
 
Posts: 37
Joined: 2010-7-12 @ 16:40

Re: Carmageddon fix

Postby Glidos » 2010-10-26 @ 12:11

thedoctor45 wrote:hmm... with the hires and carmageddon patches the 3Dfx version of BLOOD now looks like this:

.
.
.

any idea what could cause that and how to debug this?


Yep, You can't scale blood. The 3dfx patch is a bit of a hack: where the software version used to generate lots of one-pixel-wide lines, the 3dfx patch generates very thin triangles. Glidos has a way around it, but it's very complicated: Glidos reads in the little triangles, and stiches them together to make big ones; it also has to use linear regression to calulate good texture coords.
User avatar
Glidos
l33t
 
Posts: 3107
Joined: 2002-8-08 @ 02:55

Re: Carmageddon fix

Postby Glidos » 2010-10-26 @ 12:13

Miki Maus wrote:Interesting, because Carmageddon works fine with openglide when using glidos.

Keep up the good work! :wink:


I ran into similar problems, and implemented a similar solution. The fault is with Carmegeddon. Glidos uses several special cases in Carmageddon, and still it doesn't quite get it right.
User avatar
Glidos
l33t
 
Posts: 3107
Joined: 2002-8-08 @ 02:55

Re: Carmageddon fix

Postby gulikoza » 2010-10-26 @ 12:32

Updated and simplified the patch in the first post. There's really no good reason to wait for bufferswap and issue a full buffer lock since LFB is just allocated memory :wink:
User avatar
gulikoza
Oldbie
 
Posts: 1618
Joined: 2004-6-25 @ 14:53


Return to OpenGLide Development

Who is online

Users browsing this forum: No registered users and 0 guests