Video Memory Patch and GetAvailableTextureMem

Simon Day <[email protected]>
Newsgroups gmane.comp.emulators.winex.devel
Message-ID <1071526328.2544.17.camel@debian>
To take this off the support forums and onto here where it probably
belongs.

The story so far:

Trying to run a game called Horizons, however on startup it complains
that it only has 16Mb of ram available (this was first running on winex
3.2)

After checking out the cvs tip (this morning) I found Rob's video ram
patch did not seem to be in the code. So I looked at the hard coded
values - which were 32Mb (I then changed these to 128 as a stand in
until I could get hold of Rob's patch.

The game still comlained about only have 16Mb available - a grep of the
source found a few likely candidates - the 2 I changed together (as they
seemed equivalent for direct 3D 8 and 9 functions where in:


dlls/d3d9/d3d9_main.c

UINT WINAPI Direct3DDevice9_GetAvailableTextureMem(LPDIRECT3DDEVICE9
iface)
{
  TRACE("(%p)->()\n", iface);
  return 16*1024*1024; /* 16MB */
}

and 

                                                                                                                                          
dlls/d3d8/d3d8_main.c

UINT WINAPI Direct3DDevice8_GetAvailableTextureMem(LPDIRECT3DDEVICE8
iface)
{
  TRACE("(%p)->()\n", iface);
  return 16*1024*1024; /* 16MB */
}

Changing these to 32 solved my initial problem - however the game still 
wont run - I'm running with debug to try and figure out why.

What exactly did I change when I changed the texture mem? Is that
refering to graphics card memory or the APG apeture? shoudl this also be
parametised similarly to the videoram as done by rob in his patch?

These were all the possible assignments my grep came up with (though I
think the others are not a problem - I could be wrong though - not
particlarly familiar with the source yet)

dlls/d3d8/d3d8_main.c:  return 32*1024*1024; /* 16MB */
dlls/d3d9/d3d9_main.c:  return 32*1024*1024; /* 16MB */
dlls/ddraw/ddraw/user.c:    This->caps.dwVidMemTotal = 128*1024*1024;
dlls/ddraw/ddraw/user.c:    This->caps.dwVidMemFree = 128*1024*1024;
dlls/ddraw/ddraw/user.c:      128*1024*1024, /* dwVidMemTotal */
dlls/ddraw/ddraw/user.c:      128*1024*1024, /* dwVidMemFree */
dlls/quartz/ffmpeg/ffmpeg.c:#define VIDEO_BUFFER_SIZE (1024*1024)
dlls/quartz/ffmpeg/libavcodec/error_resilience.c:            int
color[4]={1024,1024,1024,1024};
dlls/quartz/ffmpeg/libavcodec/huffyuv.c:    uint8_t __align8
bitstream_buffer[1024*1024*3]; //FIXME dynamic alloc or some other
solution
dlls/quartz/ffmpeg/libavformat/jpeg.c:#define IO_BUF_SIZE (1024*1024)
dlls/sdldrv/sdlddraw.c:  
8*1024*1024,                                                  /*
dwVidMemTotal */
dlls/sdldrv/sdlddraw.c:  
8*1024*1024,                                                  /*
dwVidMemFree */
memory/global.c:        lpmem->dwTotalPhys     = 16*1024*1024;
memory/global.c:        lpmem->dwAvailPhys     = 16*1024*1024;
memory/global.c:        lpmem->dwTotalPageFile = 16*1024*1024;
memory/global.c:        lpmem->dwAvailPageFile = 16*1024*1024;
scheduler/process.c:    if (minset) *minset = 32*1024*1024;
scheduler/process.c:    if (maxset) *maxset = 32*1024*1024;


(as you may have guessed I just grepped for 1024*1024 assuming that is
what would be used on any hard coded video memory assignment)

Simon
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.