VOGONS

Common searches


Not Glidos, but psVoodoo question.

Topic actions

First post, by bored

User metadata
Rank Newbie
Rank
Newbie

I tried to run 'F22 Total Air War' in Glide mode using psVoodoo, but the game crashes with an error message 'Insufficient Memory for Clamp Textures'
Here is the psVoodoo log:

psVoodoo v0.8
Shader Version: FFFF0300
Number of texture stages: 8
Number of simultaneous texture: 8
Warning: TEXOP_PREMODULATE not supported
Warning: unsupported grTexMipMapMode called

Changing the psVoodoo config settings didn't make any difference.

Any ideas why this may be happening, and is there anything I can do?

ps I can use other wrappers, but I was interested to see what an open source project can do. OpenGlide works, but there are a lot of issues.

Reply 1 of 27, by Glidos

User metadata
Rank l33t
Rank
l33t

Nasty. Seems like the game is crashing outside of psVoodoo, but it must be something to do with psVoodoo if other wrappers work ok. Have you tried any other Direct3D-based wrappers?

That is an old version of psVoodoo. You can always get the latest version by installing Glidos and pulling it out of the install folder. I'll attach it to this post though, to save you the trouble.

Is there a demo of the game I could download to try out? Unlikely, but I might be able to find what's going on.

Attachments

  • Filename
    psVoodoo0-12.zip
    File size
    270.47 KiB
    Downloads
    372 downloads
    File comment
    psVoodoo v0.12
    File license
    Fair use/fair dealing exception

Reply 2 of 27, by bored

User metadata
Rank Newbie
Rank
Newbie

Many thanks for your answer!

I tried the latest version you provided but get the same crash with exactly the same log file contents, except for the version of course.
I stated earlier that OpenGlide works, but it doesn't. What was happening was that OpenGlide crashed early on because it couldn't find SDL, then the game continued using its own software renderer. Installing SDL caused the game to crash with OpenGlide, although with a different error than with psVooodoo.

The wrapper dgVoodoo, which uses Direct3D, works fine with the game.

I'll investigate further.....

Reply 3 of 27, by bored

User metadata
Rank Newbie
Rank
Newbie

...and a debug build of psVoodoo yields the same result, but with the following log file:
psVoodoo v0.12
Warning: grGlideInit called
Warning: grSstQueryHardware called
Warning: grSstSelect called
Warning: grTexMinAddress called
Warning: grTexMaxAddress called
Warning: grSstWinOpen called
Shader Version: FFFF0300
Number of texture stages: 8
Number of simultaneous texture: 8
Warning: TEXOP_PREMODULATE not supported
Warning: grClipWindow called
Warning: grFogMode called
Warning: grChromakeyMode called
Warning: grChromakeyValue called
Warning: grGammaCorrectionValue called
Warning: grBufferClear called
Warning: grBufferSwap called
Warning: grTexDownloadMipMapLevelPartial called
Warning: unsupported grTexMipMapMode called
Warning: grTexTextureMemRequired called
Warning: grSstWinClose called
Warning: grGlideShutdown called

Reply 5 of 27, by bored

User metadata
Rank Newbie
Rank
Newbie

Thanks. I put in a trace, hopefully in the right place, to log the value that is returned from that function and now the last part of the log looks like this:

Warning: grTexTextureMemRequired called
grTexTextureMemRequired:4096
grTexTextureMemRequired:4096
grTexTextureMemRequired:4096
grTexTextureMemRequired:4096
grTexTextureMemRequired:65536
Warning: grSstWinClose called
Warning: grGlideShutdown called

That 65536 seems to stand out somewhat....

Reply 7 of 27, by bored

User metadata
Rank Newbie
Rank
Newbie

Sure....if this is what you mean:

Warning: grTexTextureMemRequired called
evenOdd :3
aspectRatio :3
format :5
LargeLod :2
SmallLod :2
returned size:4096

evenOdd :3
aspectRatio :3
format :5
LargeLod :2
SmallLod :2
returned size:4096

evenOdd :3
aspectRatio :3
format :5
LargeLod :2
SmallLod :2
returned size:4096

evenOdd :3
aspectRatio :3
format :5
LargeLod :2
SmallLod :2
returned size:4096

evenOdd :3
aspectRatio :3
format :5
LargeLod :0
SmallLod :0
returned size:65536

Warning: grSstWinClose called
Warning: grGlideShutdown called

Where:
evenOdd 3=??
aspectRatio 3=GR_ASPECT_1x1
format 5=GR_TEXFMT_P_8
Lod 2/0=GR_LOD_64 /GR_LOD_256

Reply 9 of 27, by bored

User metadata
Rank Newbie
Rank
Newbie

OK, thanks. I'll plug away at this as time permits.
I downloaded a 3dFX demo from the olden days which works fine with psVoodoo, so at least I can see what a log of a working application looks like.

Reply 10 of 27, by bored

User metadata
Rank Newbie
Rank
Newbie

Stumped right now...

So, the basic problem is that TAW crashes with psVoodoo with 'Insufficient Memory for Clamp Textures'.
I can get the same error with the otherwise functioning dgVoodoo by limiting the texture memory to 1024kB in dgVoodoo's config utility.

psVoodoo reports 16MB texture memory available by default, but changing this up or down makes no difference.

Running TAW in a debugger(IDA) seems to indicate that the game is getting to the point where it compares the texture memory required with the maximum available before it knows what the maximum available is. This is at odds with the psVoodoo log, which shows that it has reported back this value.

...investigation continuing.....

Reply 11 of 27, by Glidos

User metadata
Rank l33t
Rank
l33t
FX_ENTRY FxBool FX_CALL grSstQueryHardware(GrHwConfiguration *hwconfig)
{
LOGCALL(ECALL_grSstQueryHardware);

hwconfig->num_sst = 1;

hwconfig->SSTs[0].type = GR_SSTTYPE_VOODOO;

hwconfig->SSTs[0].sstBoard.VoodooConfig.fbRam = 8;
hwconfig->SSTs[0].sstBoard.VoodooConfig.fbiRev = 2;
hwconfig->SSTs[0].sstBoard.VoodooConfig.nTexelfx = 1;
hwconfig->SSTs[0].sstBoard.VoodooConfig.sliDetect = FXFALSE;

hwconfig->SSTs[0].sstBoard.VoodooConfig.tmuConfig[0].tmuRev = 1;
hwconfig->SSTs[0].sstBoard.VoodooConfig.tmuConfig[0].tmuRam = TEXMEMSIZE;

return FXTRUE;
}

Isn't that reporting 8MB?

Reply 12 of 27, by bored

User metadata
Rank Newbie
Rank
Newbie

TEXMEMSIZE is hardcoded to 16MB here:

#define TEXMEMSIZE (16*1024*1024)

and this is reported back in the grTexMaxAddress call:

Warning: grGlideInit called
Warning: grSstQueryHardware called
Warning: grSstSelect called
Warning: grTexMinAddress called
grTexMin :0
Warning: grTexMaxAddress called
grTexMax :16777216
Warning: grSstWinOpen called
Shader Version: FFFF0300
...etc

I thought maybe the game was having trouble with too much memory, but changing this value made no difference.

Reply 13 of 27, by bored

User metadata
Rank Newbie
Rank
Newbie

Seems to be a timing issue. The object 'glide' is not created until 'grSstWinOpen' is called but 'glide' is somehow involved in the 'grTexMinAddress' and 'grTexMaxAddress' calls which precede it.

I moved the line:
glide = new CGlide(&config);
into the 'grTexMinAddress' function and now the game starts. 😀

I can fly round a bit, then the game crashes with 'ERROR : Failed to read region.' This is probably related to the last entries of the psVoodoo log:

..
Pixel Shader:
ps_1_1
def c0, 0.0, 0.0, 0.0, 0.0
def c1, 1.0, 1.0, 1.0, 1.0
tex t0
mul r0.rgb, c1, t0
mov r0.a, v0

Warning: unsupported grSstIdle called
Warning: unsupported grLfbReadRegion called
Warning: grSstWinClose called

Is that serious?

Reply 14 of 27, by Glidos

User metadata
Rank l33t
Rank
l33t
bored wrote:
Seems to be a timing issue. The object 'glide' is not created until 'grSstWinOpen' is called but 'glide' is somehow involved in […]
Show full quote

Seems to be a timing issue. The object 'glide' is not created until 'grSstWinOpen' is called but 'glide' is somehow involved in the 'grTexMinAddress' and 'grTexMaxAddress' calls which precede it.

I moved the line:
glide = new CGlide(&config);
into the 'grTexMinAddress' function and now the game starts. 😀

Excellent. Well spotted. I'll need to find a better way to initialise that.

I can fly round a bit, then the game crashes with 'ERROR : Failed to read region.' This is probably related to the last entries […]
Show full quote

I can fly round a bit, then the game crashes with 'ERROR : Failed to read region.' This is probably related to the last entries of the psVoodoo log:

..
Pixel Shader:
ps_1_1
def c0, 0.0, 0.0, 0.0, 0.0
def c1, 1.0, 1.0, 1.0, 1.0
tex t0
mul r0.rgb, c1, t0
mov r0.a, v0

Warning: unsupported grSstIdle called
Warning: unsupported grLfbReadRegion called
Warning: grSstWinClose called

Is that serious?

Pretty sure grSstIdle does nothing very complicated. Should be easy to implement. grLfbReadRegion will probably be a little more work, but should be just a variation on grLfbReadBuffer. I'll have a look when I get the chance.

Thanks for all the analysis. This is the first time I've had any benefit out of making it open source.

Reply 15 of 27, by bored

User metadata
Rank Newbie
Rank
Newbie

Thank you for making it open source. It's been a pleasure investigating this. 😀

The game looks great before it crashes and if I select a 'Smartview' mode, where the camera follows different active units, it doesn't crash at all.

If it's easier in the short term just to provide some dummy data so that the game can continue, then the parameters associated with the 'grLfbReadRegion' call are as follows:
src_buffer=GR_BUFFER_BACKBUFFER
src_x=0
src_y=0
src_width=800
src_height=600
dst_stride=1600

Reply 17 of 27, by bored

User metadata
Rank Newbie
Rank
Newbie

Many thanks for that 😀 , but now I get this 🙁 :

..
Warning: unsupported grSstIdle called
Warning: grLfbReadRegion called
Warning: unsupported grLfbWriteRegion called
Warning: grSstWinClose called

I guess that's to be expected. What's the point of reading the screen if it's not going to be written back to cover up some activity?