Re: NFS: Porsche Unleashed

Ove Kaaven <[email protected]>
Newsgroups gmane.comp.emulators.winex.devel
Organization TransGaming Technologies Inc
Message-ID <1075366952.10953.204.camel@renegade>
tor, 29.01.2004 kl. 02.47 skrev Rob Crittenden:
> Hi, I'm working on NFS: Porsche Unleashed again. The problems I was having
> before were related to the fact that I hadn't imported the registry properly.
> 
> Now I'm seeing more identifiable problems, specifically the app is calling
> DirectDraw_CreateSurface without setting DDSD_PIXELFORMAT. This is causing
> bpp to be 0 and was generating an assert() in ddraw/main.c:549.

It's creating a primary surface. The app is actually not allowed a
specify dimensions or pixel formats for those, these are instead
supposed to be taken from the current mode. The problem here is just
that the game hasn't called SetDisplayMode yet at this point, therefore
This->pixelformat is all zeroes (in create_primary in
dlls/ddraw/ddraw/main.c). It could be fixed by initializing
This->pixelformat from the current desktop mode when creating the ddraw
object (and probably in RestoreDisplayMode too). It's possible to get
the current desktop bit depth with GetSystemMetrics(SM_WINE_BPP), this
is also used in dlls/d3d8/d3d8_main.c. Perhaps add a "orig_bpp" along
with the existing "orig_width" and "orig_height" global variables, and
use it in the ddraw object constructor.

> I goofed around setting random bits in the structure but I'm really just
> shooting in the dark.

Not sure what structure you mean. The crash you have now is not
necessarily a crash in graphics code, at least I don't see any obvious
signs of that (although you should also add +x11drv to the debugmsgs
when you're looking for those). You should use some other debug channels
to find out more about the crash, for example +relay,+seh. Or better,
try to get a backtrace from a debugger.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.