#30 Bugs and fixes for glide2x and voodoo2

closed-fixed
nobody
None
5
2006-12-03
2004-09-15
Max Behensky
No

Hi, folks-

I'm trying to get glide2x to build and work for voodoo2
on linux. I seem to have got it to work, and in the
process found a few problems and fixes.

I checked out the current CVS for glide2x into a directory:

cvs
-d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/glide
login

cvs -z3
-d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/glide
co glide2x

I then checked out swlibs into the glide2x directory:

cd glide2x

cvs -z3
-d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/glide
co glide2x

I then tried to build the voodoo2 version:

make -f makefile.linux FX_GLIDE_HW=cvg clean
make -f makefile.linux FX_GLIDE_HW=cvg

This got most of the way through, but barfed linking
the first test program.
There were link errors with missing _trisetup and
_trisetup_cull.

After a lot of looking around on the internet, I found
that the problem was
that the make was silently choking assembling xdraw2.s
because I was missing
a program "gasp", the gnu assembly preprocessor.

Gasp has been removed from binutils as of version 2.14.
I found
binutils-2.13.2, and unpacked it:

tar -xvf binutils-2.13.2.tar.gz

I then built it:
cd binutils-2.13.2
./configure
make clean
make

This doesn't seem to build gasp, though. I had to do
it manually:

cd gas
make gasp-new

I then copied gasp-new to /usr/bin:

su
cp gasp-new /usr/bin/gasp
exit

Now, the voodoo2 version compiled correctly. To build
and install it, I did:

cd glide2x

make -f makefile.linux FX_GLIDE_HW=cvg clean
make -f makefile.linux FX_GLIDE_HW=cvg

su
make -f makefile.linux FX_GLIDE_HW=cvg
INSTALL_DESTINATION=/usr/local
exit

Note that /usr/local/lib needs to be in your
LD_LIBRARY_PATH for this to work.

I have to run glide stuff as super user, since I had no
luck compiling the
3dfx device (redhat patched their kernel, breaking things).

When I tried test00 it barfed, saying it couldn't
initialize the hardware.

I tried debugging it, and after some fooling around,
found a problem in the new pci library, in
swlibs/newpci/pcilib/fxpci.c:

At line 472, the code is trying to decide if you have a
3dfx driver:

#ifdef __linux__
if (hasDev3DfxLinux) return pciOpenLinux();
#endif /* defined(__linux__) */

But hasDev3DfxLinux is a function! This line ALWAYS
does pciOpenLinux(), even when it won't work. I
changed it to:

#ifdef __linux__
if (hasDev3DfxLinux()) return pciOpenLinux();
#endif /* defined(__linux__) */

Now everything works..

Max Behensky

Discussion

  • Daniel Borca
    Daniel Borca
    2004-12-15

    Logged In: YES
    user_id=718668

    Hi Max,

    Sorry for the laaaate reply! (again)

    I suggest you always checkout the branch named
    "glide-devel-branch" (it is the branch we're working on -
    and the branch where fixes will be committed).

    Good point regarding "swlibs/newpci/pcilib/fxpci.c"! I'll
    look into it.

    As for the assembly problems, the best way to handle this is
    to convert them to NASM syntax and use a similar scheme that
    glide3x uses.

    Regards,
    Daniel Borca

     
  • Daniel Borca
    Daniel Borca
    2004-12-15

    • status: open --> open-accepted
     
  • Guillem Jover
    Guillem Jover
    2006-12-03

    • status: open-accepted --> closed-fixed
     
  • Guillem Jover
    Guillem Jover
    2006-12-03

    Logged In: YES
    user_id=442734
    Originator: NO

    Daniel fixed this some time ago...