VOGONS


3dfx voodoo chip emulation

Topic actions

  • This topic is locked. You cannot reply or edit posts.

Reply 203 of 386, by Quaker766

User metadata
Rank Newbie
Rank
Newbie

hey guys. Before I post i would just like to thank kekko and all the people working on this great program. But i have a slight prob. I downloaded the souce from the fist post (by kekko) extract it then put a normal dosbox Configure files in the voodoo source. When making (in MinGW+MSYS) I get this at the end:
Voodoo.h:9:14 error: a storage class can only specified for objects and functions
make[3]: *** [memory.o] Error 1
make[3]: Leaving Directoy '/c/dosbox/src/hardware
make[2]: *** [install-recursive] Error 1
make[2]: Leaving Directory '/c/dosbox/src/hadware
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory '/c/dosbox/src/hardware
make: *** [install-recursive] Error 1

Now im not a programmer but to me it seems voodoo.h is screwing with things. Ive tried the updated voodoo.h etc but even they do it.

Thanks for any help
-Quaker
EDIT: tried to do the same thing with new stable source. instead no voodoo.h error or memory.o error. but an all recursive error for dosbox.exe. Man compilings hard... Or maybe im a noob!!! 😒

Reply 204 of 386, by kekko

User metadata
Rank Oldbie
Rank
Oldbie

need a hand with paletted textures in opengl, and with textures in general;
this is the code for 8bpp textures (mostly copy/paste from opengl tutorials):

				texptr = (GLvoid *)&v->tmu[0].ram[(texbase) & v->tmu[0].mask];

glEnable(GL_TEXTURE_2D);
glEnable(GL_COLOR_TABLE);
glEnable(GL_SHARED_TEXTURE_PALETTE_EXT);
PFNGLCOLORTABLEEXTPROC glColorTableEXT = (PFNGLCOLORTABLEEXTPROC) wglGetProcAddress("glColorTableEXT");
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glBindTexture(GL_TEXTURE_2D, texID);
glColorTableEXT(GL_TEXTURE_2D, GL_RGBA8, 256, GL_RGBA, GL_UNSIGNED_BYTE, v->tmu[0].lookup);
glTexImage2D(GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, smax, tmax, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, texptr);

Attachments

  • Filename
    voodoo_ogl_exp2.diff
    File size
    10.73 KiB
    Downloads
    285 downloads
    File license
    Fair use/fair dealing exception

Reply 207 of 386, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

A call to

const char * extensionString=(const char *)glGetString(GL_EXTENSIONS);

should contain GL_ARB_imaging if the color table functions are supported,
see http://www.opengl.org/sdk/docs/man/xhtml/glColorTable.xml .

But think the pointer should be zero or unmodified if it isn't supported.

Reply 208 of 386, by kekko

User metadata
Rank Oldbie
Rank
Oldbie

I'm trying to convert textures to 32bpp on the fly, so I won't need palette handling, just to make it work. but it doesn't work at all.
I guess there's something missing in the sequence of functions I call.
Hoped in gulikoza's help, which showed interest in it, but he's missing at this moment...

Reply 210 of 386, by kekko

User metadata
Rank Oldbie
Rank
Oldbie

no, all functions report glGetError = 0. apparently my card has no problems with paletted textures.
anyway, I'm now trying something simpler, with 32bpp textures and random data from emulated texture ram:

		smax = tmax = 256;
glEnable( GL_TEXTURE_2D );
texID = 13;
glGenTextures(1, &texID);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glBindTexture(GL_TEXTURE_2D, texID);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, smax, tmax, 0, GL_RGB, GL_UNSIGNED_BYTE, (GLvoid *)v->tmu[0].ram);

glEnable (GL_TEXTURE_2D);
glBindTexture (GL_TEXTURE_2D, texID);
glBegin(GL_TRIANGLES);
glTexCoord2f(0.0,0.0); glVertex2f((float)v->fbi.ax/16, (float)v->fbi.ay/16);
glTexCoord2f(0.0,1.0f); glVertex2f((float)v->fbi.bx/16, (float)v->fbi.by/16);
glTexCoord2f(1.0f,0.0); glVertex2f((float)v->fbi.cx/16, (float)v->fbi.cy/16);

glEnd();
glDisable (GL_TEXTURE_2D);
glDeleteTextures(1,&texID);

it shows nothing of course. can you see what's wrong?

Attachments

  • Filename
    voodoo_ogl_exp3.diff
    File size
    10.67 KiB
    Downloads
    173 downloads
    File license
    Fair use/fair dealing exception

Reply 211 of 386, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Use glTexEnvi instead of glTexEnvf.

Also set the following ones (same place):

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP);

unless you got those in some setup routines already and don't change them.

Then set the general color to white, like just before the GL_TRIANGLES,
and try disabling blending if that may be used elsewhere.

Reply 212 of 386, by gulikoza

User metadata
Rank Oldbie
Rank
Oldbie

What wd said 😀
The texture won't work because it is incomplete. The default GL_TEXTURE_MIN_FILTER state is GL_NEAREST_MIPMAP_LINEAR so GL will consider the texture incomplete as long as you don't create the mipmaps.

glTexParameter is per texture object state so it has to be set for every glGenTextures() object.

http://www.si-gamer.net/gulikoza

Reply 215 of 386, by kekko

User metadata
Rank Oldbie
Rank
Oldbie

since writing abap programs the whole day makes me more dumb everyday, I'm getting confused even with fixed point to float conversion with c language.
I have the starting values of s,t and deltas along x,y.
the original s,t data and deltas are 16.32 fixed point
x,y data are in 12.4 fixed point format
I need to get s,t for the three triangle vertices:

		float scale = (float)0xffffffff;
s0 = (float)((float)extra->starts0/scale);
t0 = (float)((float)extra->startt0/scale);

int dx = (v->fbi.bx >> 4) - (v->fbi.ax >> 4);
int dy = (v->fbi.by >> 4) - (v->fbi.ay >> 4);
s1 = (float)((float)(extra->starts0 + dy * extra->ds0dy + dx * extra->ds0dx)/scale);
t1 = (float)((float)(extra->startt0 + dy * extra->dt0dy + dx * extra->dt0dx)/scale);
dx = (v->fbi.cx >> 4) - (v->fbi.ax >> 4);
dy = (v->fbi.cy >> 4) - (v->fbi.ay >> 4);
s2 = (float)((float)(extra->starts0 + dy * extra->ds0dy + dx * extra->ds0dx)/scale);
t2 = (float)((float)(extra->startt0 + dy * extra->dt0dy + dx * extra->dt0dx)/scale);

can you see something wrong in this code?
thanks for the patience 😀

Attachments

  • Filename
    voodoo_ogl_exp4.diff
    File size
    13.48 KiB
    Downloads
    163 downloads
    File license
    Fair use/fair dealing exception

Reply 216 of 386, by bored

User metadata
Rank Newbie
Rank
Newbie

For me the 'Holy Grail' of simming would be able to run the 3dFX version of EF2000 on modern hardware using DosBox. This hasn't been possible since the game is written to talk directly to a Voodoo card rather than using glide.

Skimming through this thread indicates that with a certain amount of configuration, this is now possible. Can this really be true?

Reply 218 of 386, by bored

User metadata
Rank Newbie
Rank
Newbie

Not at all. 😀

It was that screenshot that prompted the question.

I'm using the standard version of DosBox for EF2000 but I guess I'll need to compile some special version to get the 3dFX support.
Before I learn how to do that, I'd like to make sure that it really is possible and that I haven't misunderstood what is going on here.