3DFX emulation

Discussion of development and patch submission.
User avatar
leilei
Posts: 432
Joined: Fri 25 Apr, 2014 4:47 pm

Re: 3DFX emulation

Postby leilei » Sat 04 Feb, 2017 4:01 am

PCem crashes when you try to use 1024x768 in Battlezone with a Voodoo2. it should be able to function IIRC, i've seen it working on a single 3D Blaster V2 at one point. It didn't use a z-buffer for that mode iirc

It initializes 1024x768 with a brief grey flash and the first soundbuffer chunk in the game plays, and then PCem crashes to desktop.

Filter off and interpreter also tested.

Code: Select all

Voodoo Filter: 000000
Swap buffer 00000000 2 0FA9052C
Swap buffer 00000000 1 0FA9052C
Swap buffer 00000000 1 0FA9052C
Swap buffer 00000000 1 0FA9052C
Swap buffer 00000000 1 0FA9052C
Bad CMDFIFO packet ff929292 00300010
PIC1 : MASK 38 PEND 00 INS 00 VECTOR 50
PIC2 : MASK 0D PEND 00 INS 00 VECTOR 58
Orchidsworn
Posts: 59
Joined: Sun 22 Mar, 2015 10:16 pm

Re: 3DFX emulation

Postby Orchidsworn » Sat 04 Feb, 2017 10:08 am

omarsis81 wrote:
Orchidsworn wrote:If you got a computer that can run SLI emulation I am definitely envious.


LOL, no, of course I don't. I believe SLI is not implemented yet and you would requiere a Pentium II to get some juice out of them.
But I remember reading here that host CPU is not the most demanding stuff when emulating a video card. Currently PCem uses up to 3 threads, maybe SLI can take a fourth... (which is quite standard CPU)


IF that is doable it would almost be a why not situation of course. Hell my 7 year old computer I am on has 4 cores/threads.

I likely will have plenty of computer when I update next year ... just waiting on PCI-E 4.0 for future proofing sake

Maybe we will have Pentium II by that point which is about as powerful of a CPU as you need to play anything that a virutal xp machine or native windows can't already play.... here is to wishing. I really want network support more than anything.
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: 3DFX emulation

Postby SarahWalker » Sun 05 Feb, 2017 9:07 am

Battlezone only lets me select 640x480. Is there some patch I need?
User avatar
leilei
Posts: 432
Joined: Fri 25 Apr, 2014 4:47 pm

Re: 3DFX emulation

Postby leilei » Sun 05 Feb, 2017 11:28 am

You'll have to edit render.cfg to unlock it. After doing so the menu should grant access to 800x600 and 1024x768 for Direct3D
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: 3DFX emulation

Postby SarahWalker » Sun 05 Feb, 2017 4:53 pm

Battlezone works at 1024x768 as of rev 631. There did seem to be missing textures on the player's gun though, I've yet to confirm if this is the case or not on a real V2.
User avatar
leilei
Posts: 432
Joined: Fri 25 Apr, 2014 4:47 pm

Re: 3DFX emulation

Postby leilei » Mon 06 Feb, 2017 1:34 am

I get the gun. Make sure Cockpit Detail is set to Textured

A little interesting that the driver (3.02.02) turns off dithering and filtering for 1024x768 :)
Attachments
pcembz1024.jpg
pcembz1024.jpg (113.37 KiB) Viewed 4294 times
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: 3DFX emulation

Postby SarahWalker » Mon 06 Feb, 2017 8:30 pm

Rev 634 should fix the texture edge filtering issue.
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: 3DFX emulation

Postby SarahWalker » Mon 06 Feb, 2017 9:41 pm

Rev 635 fixes the Starfleet Academy flickering.
User avatar
leilei
Posts: 432
Joined: Fri 25 Apr, 2014 4:47 pm

Re: 3DFX emulation

Postby leilei » Tue 07 Feb, 2017 4:35 am

I've noticed a few polygons flashing in Starsiege Tribes.

Motorhead looks great and the motion blur works, the font's a pixel off though.

Attached is the trailing artifacts Outrage gets immediately visible from the start (Doesn't happen on V1)
pcemoutrage.jpg
pcemoutrage.jpg (67.39 KiB) Viewed 4170 times
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: 3DFX emulation

Postby SarahWalker » Tue 07 Feb, 2017 8:32 pm

Outrage looks like that on real hardware. It appears to forget to clear it's framebuffers before rendering into them...
User avatar
leilei
Posts: 432
Joined: Fri 25 Apr, 2014 4:47 pm

Re: 3DFX emulation

Postby leilei » Tue 07 Feb, 2017 10:34 pm

Interesting. Looking into it, it's apparently a 3dfx driver regression. It looks normal on a May 1998 driver (except for hud texture corruptions ingame that do not happen on the later driver)
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: 3DFX emulation

Postby SarahWalker » Wed 08 Feb, 2017 10:06 pm

Rev 636 fixes the Serious Sam issues.
User avatar
leilei
Posts: 432
Joined: Fri 25 Apr, 2014 4:47 pm

Re: 3DFX emulation

Postby leilei » Sat 11 Feb, 2017 6:34 am

Good news, I've a working real Voodoo2 again. I'll try to check my own untested bugs later (i.e. nolf, max, etc)

Here's some accuracy nitpicking that might be way too last-minute for v12 (i'm not sure but still). I also have a Voodoo3 in the same system so I took some shots of that and PCem happens to resemble the V3 more at this point (though v3 might be a bit brighter biased in its dither?)

EDIT: Added Voodoo3's "smooth alpha blending" option results
Attachments
overdraws-revised.png
Additive textures overdrawn many times
overdraws-revised.png (24.54 KiB) Viewed 3703 times
v2-texel800.png
One white texel on a real Voodoo2.
v2-texel800.png (25.02 KiB) Viewed 3833 times
filterquality.png
Zoomed in tiny, alpha-blended gradient textures (red gradient from left, black gradient from bottom)
filterquality.png (13.07 KiB) Viewed 3926 times
Last edited by leilei on Sun 12 Feb, 2017 11:32 pm, edited 2 times in total.
User avatar
leilei
Posts: 432
Joined: Fri 25 Apr, 2014 4:47 pm

Re: 3DFX emulation

Postby leilei » Sun 12 Feb, 2017 5:15 am

Debunking my own reports with screenshots from the real V2:

NOLF combine bug is real behavior and is not a PCem bug
v2-nolf-combinebug.jpg
v2-nolf-combinebug.jpg (41.29 KiB) Viewed 3835 times


Max Payne combine bug is real behavior and is not a PCem bug
v2-max-combinebug.jpg
v2-max-combinebug.jpg (44.28 KiB) Viewed 3834 times


3DMark2001 HUD/Sponsor bug is a PCem bug and doesn't happen on real V2 hardware
v2-3dmark2001.jpg
v2-3dmark2001.jpg (75.38 KiB) Viewed 3835 times


Battlezone 2 menu successfully initializes on real V2 hardware.

Also noticed putting the Voodoo2's gamma up to 3 does not gamma the purple lines. which is strange as i've captured them amplified on V3's svideo out before, so maybe the order is...

V3:
- Filter
- Lines (4x1 filter only)
- Gamma

V2?:
- Gamma
- Filter
- Lines

While playing around with the gamma while looking at the single texel i've noticed it losing precision/getting more black bleed in the lower right corner, so maybe the filter is working on a gamma'd picture
User avatar
omarsis81
Posts: 544
Joined: Thu 17 Dec, 2015 6:20 pm

Re: 3DFX emulation

Postby omarsis81 » Sun 12 Feb, 2017 2:15 pm

Good work leilei!
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: 3DFX emulation

Postby SarahWalker » Sun 12 Feb, 2017 3:08 pm

Thanks for this leilei!

3DMark2001 is a bug in LOD calculations - PCem's implementation of this is a bit wrong. At some point I need to do some experimentation with a real V2 but that's not going to happen for v12.
User avatar
leilei
Posts: 432
Joined: Fri 25 Apr, 2014 4:47 pm

Re: 3DFX emulation

Postby leilei » Mon 13 Feb, 2017 1:34 am

There's also dithered mipmaps on the V2 (which when enabled, doesn't care whether it's bilinaer or trilinear filtering)

Q3A Demo v1.11, r_colorMipLevels 1 + devmap q3dm1, no overbrights, no gamma, lightmap, real v2 shot
v2-trilinear-lightmap-dithering.png
v2-trilinear-lightmap-dithering.png (186.09 KiB) Viewed 3693 times


and for reference (on LOD correction etc), here's with it off (while trilinear is still enabled - it uses bilinear on multitextured surfaces)
v2-trilinear-lightmap2.png
v2-trilinear-lightmap2.png (199.4 KiB) Viewed 3680 times
User avatar
leilei
Posts: 432
Joined: Fri 25 Apr, 2014 4:47 pm

Re: 3DFX emulation

Postby leilei » Tue 14 Feb, 2017 5:40 am

WIP Patch on the filter, changing the method. Didn't do any deep tuning/tweaking yet. it's also currently in a messy obviously refactorable state and is possibly slower/unstable. i just had to get this out as soon as i could

It doesn't add differences anymore, but tries to average with a 25% translucency per sampled pixel and tries to obey the threshold.

I started off by trying to copy the output of an Elite Force menu screen with SSTV2_VIDEO_FILTER_THRESHOLD set to 0xFFFFFF, and then tried to apply the threshold stuff later. On a real V2 the vertical purple lines in the interface would show 3 times to the right and once to the left, as well as the small text seeing slightly double.

Also I ordered the gamma to happen in the filter function before that filters rather than after it

EDIT: Replaced patch with a more noticable, more stable slightly cleaned up version
Attachments
voodoofilter-2017b.patch
WIP PATCH DON'T COMMIT
(8.66 KiB) Downloaded 25 times
Last edited by leilei on Fri 17 Feb, 2017 12:52 pm, edited 1 time in total.
User avatar
leilei
Posts: 432
Joined: Fri 25 Apr, 2014 4:47 pm

Re: 3DFX emulation

Postby leilei » Thu 16 Feb, 2017 2:39 am

Empire Earth can freeze the guest system when using the Voodoo 1 and 2. Works on ViRGE with graphical corruption though, i've yet to test this on the real V2 (worth noting the main menu is 1024x768 and is using the direct3d api)
EDIT: Doesn't work on real V2. gives black screen error message and quits (but doesn't freeze)

unrelated, also backing up my claim about the order of gamma before filter, is i've seen the dither pattern unscathed in superbright pixels of overpowered gamma (which would overflow and lead into garbage colors on real hardware)

Oddly I can't see any purple lines at all on this real V2. V3's are obvious though, and I believe V1's filter is the same as V3's. i'll have to remake my filter to have v1 filter and the v2 filter separated

EDIT 2:
PATCH INCOMING

Changes:
- New method for Voodoo2 filter (since the previous patch)
- No lines on Voodoo2
- Added new filter for Voodoo2 and kept that separate from Voodoo's filter
- Fixed offset bug on Voodoo1's filter (all columns are now visible and nothing should be pushed off)
- Moved lines before the filtering on Voodoo1 (based on Voodoo3 observation)
- Gamma is back to after the filter for both cards for now

Known bugs:
- Voodoo2 filter seems to makes banding in the darker colors, yet to investigate this (possibly some blending dither table aberration with lightmaps)
- Voodoo2 filter's a little slow and could be faster
- Might be a little unstable? I've seen some games hang on quit but whether it's related to the filter I do not know
Attachments
voodoofilter-2017d.patch
(14.77 KiB) Downloaded 21 times
User avatar
leilei
Posts: 432
Joined: Fri 25 Apr, 2014 4:47 pm

Re: 3DFX emulation

Postby leilei » Sat 18 Feb, 2017 10:49 pm

I regret not quadruple posting :(

New patch based on current revision. Only changes since the last patch is that I dropped the + 1's on filter line stuff since they're no longer necessary
Attachments
voodoofilter-2017j.patch
(18.29 KiB) Downloaded 23 times
ZoltanTheHun
Posts: 3
Joined: Sun 19 Feb, 2017 9:57 pm

Re: 3DFX emulation

Postby ZoltanTheHun » Sun 19 Feb, 2017 10:50 pm

Thanks Sarah and everyone else who added to this truly amazing emulator.

Let me share my findings about V12 of the emulator.

In Janes F-15, when recompiler activated on VoodooII, I get Z-buffer like issues with skybox and terrain, also mouse cursor is not visible. If I turn off recompiler, there is very minimal issue with runway and ground texture zfighting from certain angles.
Attachments
f15_2.jpg
f15_2.jpg (101.18 KiB) Viewed 3236 times
f15_1.jpg
f15_1.jpg (71.84 KiB) Viewed 3236 times
User avatar
leilei
Posts: 432
Joined: Fri 25 Apr, 2014 4:47 pm

Re: 3DFX emulation

Postby leilei » Mon 20 Feb, 2017 3:25 am

^ Can reproduce. Used a mid-98 driver and the latest official jan-00 driver.


EDIT: New patch. changes since last:

- an attempt to optimize the V2 filter - it's a single loop now
- an attempt to make filter more stable by not forgetting to add free() on the fil uint8_s

Attached is a comparison picture of the two filters
Attachments
leifxatm.png
leifxatm.png (195.57 KiB) Viewed 3177 times
voodoofilter-2017l.patch
(17.8 KiB) Downloaded 26 times
User avatar
Fusion
Posts: 11
Joined: Sun 05 Feb, 2017 10:14 pm
Location: Ontario, Canada

Re: 3DFX emulation

Postby Fusion » Mon 20 Feb, 2017 3:28 pm

How does one go about using your patches? Do they get placed somewhere and compiled with the emulator? And do we need all your patches in order, or just the latest one? Thanks!
User avatar
omarsis81
Posts: 544
Joined: Thu 17 Dec, 2015 6:20 pm

Re: 3DFX emulation

Postby omarsis81 » Mon 20 Feb, 2017 4:03 pm

Fusion wrote:How does one go about using your patches? Do they get placed somewhere and compiled with the emulator? And do we need all your patches in order, or just the latest one? Thanks!


I believe you need to compile the whole program
User avatar
leilei
Posts: 432
Joined: Fri 25 Apr, 2014 4:47 pm

Re: 3DFX emulation

Postby leilei » Tue 21 Feb, 2017 10:00 am

I thought Aliens vs. Predator worked fine on Voodoo2 until I tried the marines campaign and immediately saw issues with alpha modulation which can hinder gameplay

doesn't happen on Voodoo Graphics, and pre-DX7 Voodoo2 drivers (June '99 and earlier). I'll have to drag this over to the real V2 and see if it happens on 3.02.02 there.
Attachments
pcemv2avp5.jpg
pcemv2avp5.jpg (82.87 KiB) Viewed 3063 times
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: 3DFX emulation

Postby SarahWalker » Wed 22 Feb, 2017 9:08 pm

Rev 649 brings the filter up to voodoofilter-2017l.patch.

Btw, you don't need to free the fil* arrays - they're allocated on the stack so get freed when they go out of scope.
User avatar
leilei
Posts: 432
Joined: Fri 25 Apr, 2014 4:47 pm

Re: 3DFX emulation

Postby leilei » Thu 23 Feb, 2017 1:24 am

Thanks. At this point I have no idea what to do next with the filter other than finetuning lookup table generation against useful VGA captures that aren't made yet. I tried my best at eyeballing it while adjusting the threshold for differences. I think i'm done with it until the V3 ever comes (not sure how its 2x2 box filter could play with the threaded lines)
rakzom
Posts: 5
Joined: Mon 16 Nov, 2015 9:20 pm

Re: 3DFX emulation

Postby rakzom » Mon 27 Feb, 2017 9:50 pm

With v12 and Voodoo 2, there is some texture glitches in Motocross Madness demo for the player shadows and the dust trail

https://www.youtube.com/watch?v=_cr8h6Ir9fM

PCem v12 - 91% - Award 430VX PCI - Pentium MMX 166 - Press CTRL-END to release mouse 27_02_2017 22_43_51.jpg
PCem v12 - 91% - Award 430VX PCI - Pentium MMX 166 - Press CTRL-END to release mouse 27_02_2017 22_43_51.jpg (69.42 KiB) Viewed 2669 times
szadycbr
Posts: 185
Joined: Mon 21 Nov, 2016 6:23 pm

Re: 3DFX emulation

Postby szadycbr » Sat 04 Mar, 2017 6:36 pm

Hi there, i run across the 3dfx city app. from 1998 and i tryed to run it on win98 IE 5.0 but it wont work cos plugin could not recognize VM version, so i downloaded msvm 2.0 but it did not allow me to install , cos newer ver. was installed. i did install win95 to check that thing and after following the oficial guide it works.
I saw video on YT ,the guy runs it on genue p3 ,there is the vid from the guy on YT https://www.youtube.com/watch?v=eghlSdGvuC0 and link to archive 3dfx page if anyone want to check it out http://web.archive.org/web/199804212245 ... nload.html and for some reason i could not download the 4.9MB msvm from this site so i got it from Microsoft archive http://web.archive.org/web/199904201448 ... javx86.asp

And thats how it looks on PCem , looks kinda same. Can anyone tell me whats happend to blinking HDD "diode" in v12? it was extremally helpfull, how can i get it back? cos now i dont know what the machine is doing, is it thinking? copying? or what? this indicator was very helpfull, how to bring it back?
Attachments
3dfx city 2.jpg
3dfx city 2.jpg (196.75 KiB) Viewed 1723 times
Last edited by szadycbr on Sat 04 Mar, 2017 8:30 pm, edited 1 time in total.
SarahWalker
Site Admin
Posts: 1327
Joined: Thu 24 Apr, 2014 4:18 pm

Re: 3DFX emulation

Postby SarahWalker » Sun 05 Mar, 2017 9:30 am

The HDD blinking is currently only implemented in the DirectDraw display code, not Direct3D. I keep meaning to port it but keep forgetting. Maybe for v13?

Return to “Development”

Who is online

Users browsing this forum: grommit2007 and 3 guests