VOGONS


3dfx voodoo chip emulation

Topic actions

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

Reply 60 of 386, by xcomcmdr

User metadata
Rank Oldbie
Rank
Oldbie

Hy

I'd like to help you, but I have doubts I will be able to, 'cause while reading this topic, there's a lot of tech info that just puzzles me. ^^U (and I spent months debugging a race condition : Multithreaded video capturing so I'm afraid I'm not that much of a hacker)

Anyway I used a 3DFX back in the day, and a wrapper-independant implementation of Glide would be nice (rather that having to use a wrapper that takes control over -eg. no video capturing available, etc. ...))!

I'll look at the sources, but it may be a looong time before I send some useful patchs.
However, I may do the "clean up" part, if that helps.

Reply 61 of 386, by robertmo

User metadata
Rank l33t++
Rank
l33t++
kekko wrote:

It seems that changing memsize to 16 (was higher in config file) resolved my problem, but I can't say why. I tried increasing memory by steps, starting from 16 and games suddenly become unstable again. actually, launching dosbox from the ide, the memsize was 16. I'm wondering if there are errors in my page handler; if you have any suggestion, please let me know.

That is funny cause with memsize=16 games/tests doen't see voodoo at all (actually it worked once - quake 3 was extremelly slow 😉 )
What are your virtual memory settings (and what is the .swp file size)
Does it work every time? check tr2 setup test (hit it at least five times) (with everything turned on and 800x600)

But I have noticed that if I use memsize=63 and virtual memory turned off (setting it to 0 or auto (even if the file is not created doesn't help)) games/tests work every time, i haven't had a single problem (all tests in tomb raider 2 setup work correctly every time, i can keep hitting it like crazy and it never fails)
Though this is not a perfect solution as some games (for example Quake 3) need virtual memory.

Reply 63 of 386, by robertmo

User metadata
Rank l33t++
Rank
l33t++

same as yours, no textures, big mouse square has to be hidden in the bottom right corner 😉 no letters

Attachments

  • tr5.PNG
    Filename
    tr5.PNG
    File size
    199.51 KiB
    Views
    7673 views
    File license
    Fair use/fair dealing exception
  • Q3.PNG
    Filename
    Q3.PNG
    File size
    164.12 KiB
    Views
    7673 views
    File license
    Fair use/fair dealing exception

Reply 64 of 386, by xcomcmdr

User metadata
Rank Oldbie
Rank
Oldbie

I can't compile the sources (files/dosbox_20100910.zip) on GNU/Linux with gcc 😒

$ gcc --version
gcc (Ubuntu/Linaro 4.4.4-14ubuntu4) 4.4.5

output :

$./autogen.sh && ./configure --enable-core-inline && make
[...]
In file included from ../../include/SDL_config.h:42,
from ../../include/SDL_stdinc.h:28,
from ../../include/SDL_main.h:26,
from ../../include/SDL.h:28,
from ../../include/timer.h:23,
from ../../include/serialport.h:31,
from dos.cpp:33:
../../include/SDL_config_minimal.h:38: error: conflicting declaration ‘typedef unsigned int size_t’
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/include/stddef.h:211: error: ‘size_t’ has a previous declaration as ‘typedef long unsigned int size_t’
make[3]: *** [dos.o] Erreur 1
make[3]: quittant le répertoire « /home/max/Téléchargements/dosbox3DFX/src/dos »
make[2]: *** [all-recursive] Erreur 1
make[2]: quittant le répertoire « /home/max/Téléchargements/dosbox3DFX/src »
make[1]: *** [all-recursive] Erreur 1
make[1]: quittant le répertoire « /home/max/Téléchargements/dosbox3DFX »
make: *** [all] Erreur 2

nor with DOSBox-SVN:

$cp ../../../dosbox3DFX/src/hardware/memory.cpp ./src/hardware/memory.cpp
$cp ../../../dosbox3DFX/src/hardware/voo* ./src/hardware/.
$./autogen.sh && ./configure --enable-core-inline && make
[...]
In file included from voodoo.h:183,
from memory.cpp:28:
voodoo_types.h: In function ‘Bit32s _mul_32x32_shift(Bit32s, Bit32s, Bit8s)’:
voodoo_types.h:256: error: expected ‘(’ before ‘{’ token
voodoo_types.h:257: error: ‘mov’ was not declared in this scope
voodoo_types.h:257: error: expected ‘;’ before ‘eax’
In file included from memory.cpp:28:
voodoo.h: At global scope:
voodoo.h:184: error: expected constructor, destructor, or type conversion before ‘*’ token
In file included from voodoo.h:187,
from memory.cpp:28:
voodoo_func.h:70: error: ‘RECIPLOG_LOOKUP_BITS’ was not declared in this scope
voodoo_func.h:81: error: expected constructor, destructor, or type conversion before ‘(’ token
make[4]: *** [memory.o] Erreur 1
make[4]: quittant le répertoire « /home/max/Téléchargements/trunk/dosbox/trunk/src/hardware »
make[3]: *** [all-recursive] Erreur 1
make[3]: quittant le répertoire « /home/max/Téléchargements/trunk/dosbox/trunk/src/hardware »
make[2]: *** [all-recursive] Erreur 1
make[2]: quittant le répertoire « /home/max/Téléchargements/trunk/dosbox/trunk/src »
make[1]: *** [all-recursive] Erreur 1
make[1]: quittant le répertoire « /home/max/Téléchargements/trunk/dosbox/trunk »
make: *** [all] Erreur 2

Any ideas ?
(same without --enable-core-inline)

Reply 68 of 386, by kekko

User metadata
Rank Oldbie
Rank
Oldbie

I can't figure out what's going on with textures. It seems they're not correctly uploaded to texture ram, perhaps tmu chips are not correctly detected ?
I'm trying to run some of the test programs that come with the glide sources, in order to debug them; test21.c should render a couple of textured triangles.
I'm uploading glide2x and test21 sources+binaries, maybe someone has some ideas that may help fixing this.

Attachments

  • test21_dosbox.JPG
    Filename
    test21_dosbox.JPG
    File size
    14.96 KiB
    Views
    7400 views
    File comment
    test21.c (dosbox guest win98)
    File license
    Fair use/fair dealing exception
  • test21_openglide.JPG
    Filename
    test21_openglide.JPG
    File size
    28.86 KiB
    Views
    7400 views
    File comment
    test21.c (host machine + openglide)
    File license
    Fair use/fair dealing exception
  • Filename
    glide2x_246_linux.zip
    File size
    2.06 MiB
    Downloads
    694 downloads
    File license
    Fair use/fair dealing exception

Reply 69 of 386, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

> perhaps tmu chips are not correctly detected ?
Correct. See the "mojo.exe" program that comes with some glide development package. It detects 57005 TMU chips (= 0xdead).
A part of the failiure seems to be that the trexInit1 register isn't implemented (at least I couldn't find it). But the test writes to trexInit1 don't show in the log messages either, so there is probably another problem.

1+1=10

Reply 70 of 386, by kekko

User metadata
Rank Oldbie
Rank
Oldbie

trexinit registers fall back to the default case, they're written directly to the register cache array

Correct. See the "mojo.exe" program that comes with some glide development package. It detects 57005 TMU chips (= 0xdead).

You can bypass that checks with some environment variables; but it does not fix the issue. Nonetheless that detection routine should be fixed; it's performed by the function sst1InitGetTmuInfo and does something very strange...

Reply 71 of 386, by kekko

User metadata
Rank Oldbie
Rank
Oldbie

the env variables to bypass the tmu info check, just in case...

set GDBG_FILE=d:\gdbg.txt
set GDBG_LEVEL=89
set FX_GLIDE_NO_SPLASH=1
set SST_NODEVICEINFO=1
set SST_TMUCFG=64
set SST_TMUMEM_SIZE=4
set SST_FBIMEM_SIZE=4

also enables debug logging to file.

Reply 72 of 386, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Patch against R3638.

Changes:
- fix virtual<->physical memory address decoding
- stop disfunctional PCI devices from cropping up in Win9x
- Add basic display switching - (I must have gotten the wrong variable, it displays partially 3d-rendered screens, Kekko probably knows better)

Attachments

  • Filename
    dosbox_voodoo.zip
    File size
    103.88 KiB
    Downloads
    755 downloads
    File comment
    diff patch
    File license
    Fair use/fair dealing exception

1+1=10

Reply 74 of 386, by kekko

User metadata
Rank Oldbie
Rank
Oldbie

thank you hal, great work!. I would never imagine display switching could be that complicated.
About the flickering, the variable is correct, I guess the time we read it is wrong? Before, I was displaying the front buffer content on swapbuffer command occurrences. I guess now the display is updated asynchronously to the drawing (correct me if I'm wrong).
See also these functions voodoo_update, TIMER_*, *vblank* in voodoo.c from mame.

It seems now correctly switches to different resolutions, but the display may be wrongly updated due to a wrong scanline length value. Try to change VerticalTimer function, increasing viewbuf by v->fbi.rowpixels instead of width.

raster_0 is just a function I made for debugging purposes; the actual rendering is done by raster_generic_?tmu functions, with ? from 0 to 2 (see RASTERIZER macro) 0 for no tmu involved, 1 for 1 tmu and 2 for 2 tmus.

Reply 75 of 386, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Rendering works if v-sync is ignored:

/* if we're not syncing to the retrace, process the command immediately */
// if (!(data & 1))

At this point there won't be additional tearing as all lines are drawn at once.

1+1=10