VOGONS


First post, by blueshogun96

User metadata
Rank Newbie
Rank
Newbie

I was searching the FAQ and I did not see an answer to this question here. I was wondering if PCI emulation was added to DOSBox. Last time I checked, PCI was never implemented.

The reason I'm asking was because at one point, I was going to attempt to add support for SST-1 (3Dfx Voodoo) for DOSBox so I could play some of those old 3Dfx games for DOS again (and obviously, kekko beat me to it). I tried running some of the Glide SDK's DOS samples and it would always give me the "no PCI detected" error upon startup. Now that kekko has successfully gotten the basics of SST-1 emulated, I'm assuming that PCI is supported somewhat. The 3Dfx supported version probably isn't part of the SVN though (haven't checked yet).

"Even if PCI is supported, 3Dfx emulation has already been added. Now what do you want to do?" Good question. Some of you might have noticed that I started a thread about writing an NV1 wrapper (NVIDIA NV1 Wrapper). Since it doesn't look like I'll have the skills to reverse engineer the entire NV1 API, I figured that actually emulating the hardware would be the best bet for the time being.

There isn't much documentation on the NV1, but there is enough to do some basic emulation of the hardware. The documentation on the PCI registers and such was really hard to come by but I did find it by accident a few years ago and I was smart enough to actually save it too because I never did find it again. XFree86 also had a working driver, although it was very basic and lacked 3D acceleration. I figured that this would be a good place to start on that.

In spite of the lack of documentation, there's another problem: There aren't very many games that utilize the NV1 card. So far, I only have 2 games that support it:

- Battle Arena Toshinden (DOS)
- Panzer Dragoon 1 (Windows)

So they are all I have to work with atm. Since I can't get Windows 95 to work on DOSBox to save my life, I guess getting Battle Arena Toshinden working would be a first step for now, but I'd still like to see if I can get Windows 95 to recognize the card in one of the PCI slots.

Oops, forgot one more issue. Unlike SST-1, the NV1 contains a 32Kb BIOS. I don't have this card (it's been a pain in the arse obtaining one) and I don't know where to begin dumping it or finding a firmware upgrade for this card (if any ever existed). If I had the card, I guess I could write a 32-bit DOS app to get the PCI registers and read the first 32Kb of the region where it resides. Can't guarantee that would work, but I guess it's worth a try.

So, any advice is greatly appreciated. I'd rather not re-invent the wheel (as in implement PCI myself if it hasn't already). Thanks.

Shogun.

Attachments

  • Filename
    nv1ref.h
    File size
    50.32 KiB
    Downloads
    225 downloads
    File comment
    NV1 outer GPU registers accessed VIA MMIO. Must check PCI registers for base address. I found this on XFree86.
    File license
    Fair use/fair dealing exception
  • Filename
    STG-2000_NV1_doc.rar
    File size
    3.56 MiB
    Downloads
    217 downloads
    File comment
    Documentation on the SGS Thompson 2000 series NV1 GPU compatible card. It doesn't explain how the quadratic rendering works, but the PCI, gameport, audio hardware, DSP and VGA registers are fully documented. A must have.
    File license
    Fair use/fair dealing exception

Reply 1 of 56, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

wait a few weeks.
and for 2 games I don't see that much use for adding a video card.

Water flows down the stream
How to ask questions the smart way!

Reply 3 of 56, by kekko

User metadata
Rank Oldbie
Rank
Oldbie

Hi shogun, how are you? I thought you were working on xbox 1 emulation 😀
A pci framework is already part of svn, you should be able to add a class that implements your device
about mmio access, have a look at the 3dfx patch, in particular the changes to memory.cpp and the voodoo page handler class in voodoo_main.
I guess qbix has a point, about nv1 software support, probably another hardware would be a better choice, like powervr.
there should be a console emulator around that already implements povervr emulation and its developer even posted on this forum in the 3dfx thread.
Anyway, probably 3dfx is enough for most of the 3d acceleration needs in dosbox; you might concentrate on emulating other features.

Reply 4 of 56, by blueshogun96

User metadata
Rank Newbie
Rank
Newbie

Oh, hey kekko! Heh, wasn't sure if you were the same one from ngemu or what, 🤣. While I'm here, I'd like to say thanks for your hard work on emulating SST-1 (3Dfx Voodoo). I am still working on Xbox1, but honestly, I need a break from that from time to time, otherwise I can't work on it efficiently! So I do keep a few other projects handy for when I need to deviate a bit.

Maybe I should have been a bit more direct, but I was kinda hinting at some sort of way to add support for multiple 3D accelerators and let the user choose which one they want to use. But thinking a bit more about what DOSBox's purpose is, that sort of thing might be more suitable for Bochs or QEMU. Unfortunately for me, I find Bochs and QEMU too confusing to work with as it's source is advanced and complex.

But anyway, I'm not saying qbix doesn't have a valid point (because it very well may not be worth it), but let's just say that it's no longer business... it's personal! 3Dfx may be my passion, but NVIDIA is my specialty (primarily NV3 (Riva128) and NV2A (Xbox)), so I thought I'd do the old school SEGA fans a favour. Adding to the fact that not a single NVIDIA GPU has ever been emulated (except the NV2A, *very* partially), it's driving me nuts that my copy of Panzer Dragoon 1 doesn't work without NV1 so it's more motivation right there as I like challenges that no one has ever done or succeeded at. As for emulating PowerVR, I have absolutely no experience with that GPU as it never interested me in the past (which might change). Not saying that I can't do it, but what games actually utilize PowerVR besides Quake II?

Other than that, I don't see any other ways I could really contribute to DOSBox. I was also hoping that adding NV1 support could also help me learn more about it too.

Reply 5 of 56, by leileilol

User metadata
Rank l33t++
Rank
l33t++
blueshogun96 wrote:

Not saying that I can't do it, but what games actually utilize PowerVR besides Quake II?

A hell of a lot more than NV1, that's for sure. Almost every UnrealEngine1 game for example... I have a Youtube channel with video captures of PowerVR PCX2 running games it's intended to, and NOT intended to run. See the PowerVR Fun Thread in my sig for..... well PowerVR Fun.

By the way, in a SEGA slant, there's a Virtual On Cybertroopers release that uses PowerVR but I never had this myself.

For PowerVR PCX2 emulation, starting off with nullDC PVR emulation code's a good start, because that's emulating an evolution of the chipset (Midas). You'd have to work your way BACKWARDS.

apsosig.png
long live PCem

Reply 6 of 56, by blueshogun96

User metadata
Rank Newbie
Rank
Newbie

Heh, guess I haven't been paying enough attention to PowerVR all these years.... Now I'm starting to get curious as to how many games used exclusively, and how complex the hardware might be. I can't think of a single card from the 90s that's more complicated than NV1 and NV3 (Riva128).

I won't say it isn't worth emulating because I like to see everything/anything emulated just for the sake of emulating it. Sorry if I sound really stubborn with this topic, but even though there were only a few games using NV1, certain games can't be run without it (my copy of Panzer Dragoon has no software fallback). While 3Dfx and PowerVR emulation is thriving, NVIDIA is completely neglected 🙁 Therefore I'd still like to at least try. I'll still look into PowerVR just for fun, but I can't promise I'll implement it, assuming I can wrap my head around how it works or if there's enough documentation and other resources needed to emulate it.

Reply 7 of 56, by sliderider

User metadata
Rank l33t++
Rank
l33t++
blueshogun96 wrote:

Heh, guess I haven't been paying enough attention to PowerVR all these years.... Now I'm starting to get curious as to how many games used exclusively, and how complex the hardware might be. I can't think of a single card from the 90s that's more complicated than NV1 and NV3 (Riva128).

I won't say it isn't worth emulating because I like to see everything/anything emulated just for the sake of emulating it. Sorry if I sound really stubborn with this topic, but even though there were only a few games using NV1, certain games can't be run without it (my copy of Panzer Dragoon has no software fallback). While 3Dfx and PowerVR emulation is thriving, NVIDIA is completely neglected 🙁 Therefore I'd still like to at least try. I'll still look into PowerVR just for fun, but I can't promise I'll implement it, assuming I can wrap my head around how it works or if there's enough documentation and other resources needed to emulate it.

nVidia isn't being neglected. Apart from NV1, nVidia never had any proprietary API's to emulate. After NV1 they made DX and OpenGL compliant cards so if your VM can emulate those, then it can emulate any nVidia card made from NV3 onwards. Rendition, Videologic, and 3dfx all had their own proprietary 3D standards which is why they need emulation. So few games were ever made for NV1 that the value of emulating them is dubious at best as most people won't be able to get copies of those games, not legal ones anyway.

Reply 8 of 56, by Zorbid

User metadata
Rank Member
Rank
Member
sliderider wrote:

the value of emulating [NV1] is dubious at best

For you, perhaps, but definitely not for blueshogun96 who wants to scratch his own itch.

Feel free to write an OpenGL pass through or a D3D wrapper, it will be far more useful than criticizing other people's initiatives.

Reply 9 of 56, by blueshogun96

User metadata
Rank Newbie
Rank
Newbie
Zorbid wrote:
sliderider wrote:

the value of emulating [NV1] is dubious at best

For you, perhaps, but definitely not for blueshogun96 who wants to scratch his own itch.

Feel free to write an OpenGL pass through or a D3D wrapper, it will be far more useful than criticizing other people's initiatives.

I honestly don't see myself being able to complete a wrapper any time soon (like I'd prefer to do) since I'm not very skilled in reverse engineering nor do I have the time to learn at this point. It may be trivial for the rest of you, but not for me. For some of you, emulation is about what you can play or use, for others, emulation is about the thrill of getting something working and the preservation of a relic. I choose the latter, and that won't change anytime soon. Although kekko may be right. I should probably keep up with my higher priority emulation projects and do this in my spare time rather than get too fixated on it.

Reply 10 of 56, by sliderider

User metadata
Rank l33t++
Rank
l33t++
Zorbid wrote:
sliderider wrote:

the value of emulating [NV1] is dubious at best

For you, perhaps, but definitely not for blueshogun96 who wants to scratch his own itch.

Feel free to write an OpenGL pass through or a D3D wrapper, it will be far more useful than criticizing other people's initiatives.

I'm not criticizing anything. I'm just pointing out the fact that there is little value in an NV1 wrapper as there was only ever a handful of games that worked with it and not very many copies of those games are available anymore. Using Glide as an example to make my point, a Glide wrapper only has value because there are a lot of games that were written to work with it. If there had only been a few games that worked with Glide, then a Glide wrapper would also be of little value and not worth the time it's going to take to write and debug it. The value of an emulator or API wrapper increases or decreases with the number of games that had support for that API. There was a grand total of 4 games that were playable on an NV1 card and there's maybe a few dozen people who still own legal copies of those games and they all own NV1 cards anyway, so it's not going to generate enough interest to be worth the trouble of doing. The only kind of interest it might generate is among warez kiddies who would then download the games from "abandonware" sites when they can't get legal copies and that's not the kind of interest we need in this hobby.

Reply 11 of 56, by leileilol

User metadata
Rank l33t++
Rank
l33t++
blueshogun96 wrote:

Therefore I'd still like to at least try. I'll still look into PowerVR just for fun, but I can't promise I'll implement it, assuming I can wrap my head around how it works or if there's enough documentation and other resources needed to emulate it.

For starters, on the Matrox M3D cd there's a SGL.lib, SGL.h, and some other example source code that interfaces with SGL. Images of the CD should be in the PowerVR fun thread

There's a newer SGL.h found in the Deus Ex SDK (WOW! CRAP PAST THE RADAR)

apsosig.png
long live PCem

Reply 13 of 56, by blueshogun96

User metadata
Rank Newbie
Rank
Newbie
sliderider wrote:
Zorbid wrote:
sliderider wrote:

the value of emulating [NV1] is dubious at best

For you, perhaps, but definitely not for blueshogun96 who wants to scratch his own itch.

Feel free to write an OpenGL pass through or a D3D wrapper, it will be far more useful than criticizing other people's initiatives.

I'm not criticizing anything. I'm just pointing out the fact that there is little value in an NV1 wrapper as there was only ever a handful of games that worked with it and not very many copies of those games are available anymore. Using Glide as an example to make my point, a Glide wrapper only has value because there are a lot of games that were written to work with it. If there had only been a few games that worked with Glide, then a Glide wrapper would also be of little value and not worth the time it's going to take to write and debug it. The value of an emulator or API wrapper increases or decreases with the number of games that had support for that API. There was a grand total of 4 games that were playable on an NV1 card and there's maybe a few dozen people who still own legal copies of those games and they all own NV1 cards anyway, so it's not going to generate enough interest to be worth the trouble of doing.

For starters, there were more than 4 games that use it, if you count the games that were written for DOS and not created by Sega. Second, it's pretty hard to assume that anyone who has an NV1 based game actually has an NV1 to begin with. Like I said, I have NV1 compatible games, but can't find an NV1 to save my life! I'd like to finally be able to play my copy of Panzer Dragoon on my PC, and having bilinear filtered textures and maybe some better texture perspective correction is just a bonus.

Btw, not trying to be rude or anything, but did you not read the last thing I said?? It would fully explain why I still want to pursue this even if no one else really cares.

"For some of you, emulation is about what you can play or use, for others, emulation is about the thrill of getting something working and the preservation of a relic."

I emulate hardware that interests me, NOT everyone else, hence the reason I've poured so much time into Xbox1.

The only kind of interest it might generate is among warez kiddies who would then download the games from "abandonware" sites when they can't get legal copies and that's not the kind of interest we need in this hobby.

This is a valid point/hypothesis here. I'm against warez 100%, but the games aren't that easy to find on pirate websites. I had an easier time finding legal copies of these games...

wd wrote:

Since this topic is about PCI emulation, did you check out the svn sources? If you need help getting a device added just post here.

Sorry for the late reply, but yes. I downloaded the latest SVN sources (last week, iirc) and started adding PCI device registers. I took a look at kekko's code for adding the SST-1 support, but the PCI emulation code is very different. So I'm not sure if I've been doing it right so far. My biggest question at the moment is why Windows says that the PCI bus is disabled even when the support is there. Was bit 31 not set in the PCI host or something?

I haven't done a whole lot on it yet because I'm also working on another emulator and stuff like that, but for now, the main thing is to get the device recognized. Unlike most video cards, the NV1 has more than one function, but it might be ok to only implement one, but I'm not sure. Fortunately for me, the MPU-401 device is already emulated, and that's what NV1 uses for audio. Either way, I wouldn't worry about that.

I'll post more information as it surfaces...

Reply 14 of 56, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Don't mind sliderider, he is known for his special take on things. Arguing with him will only derail your thread and get nowhere 😉

Are the NV1 games NV1 only or were there special versions of the games tailored to the NV1 (similar to other games that were bundled with video cards back in the days - I know I had a Mechwarrior (1or2) special version bundled with my Matrox Mystique back then. Would only work with a Mystique)?

Reply 15 of 56, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

My biggest question at the moment is why Windows says that the PCI bus is disabled even when the support is there. Was bit 31 not set in the PCI host or something?

You won't need the host and bus devices.

Reply 16 of 56, by blueshogun96

User metadata
Rank Newbie
Rank
Newbie
Dominus wrote:

Don't mind sliderider, he is known for his special take on things. Arguing with him will only derail your thread and get nowhere 😉

Are the NV1 games NV1 only or were there special versions of the games tailored to the NV1 (similar to other games that were bundled with video cards back in the days - I know I had a Mechwarrior (1or2) special version bundled with my Matrox Mystique back then. Would only work with a Mystique)?

Nah, I'm not mad at him, but I do get tired of people telling me to emulate whats "useful" to them. And quite honestly, the whole risk of attracting warez monkeys comes with any emulator ever written.

Since I only have 2 NV1 compatible games to test atm, so far, only one of them absolutely requires the NV1 to operate, and that would be Panzer Dragoon; Battle Arena Toshinden doesn't require it. I assumed that this game would have a software renderer as a fall back, but I was wrong. So honestly, I won't assume that the other games also have software fallbacks too.

Reply 18 of 56, by swaaye

User metadata
Rank l33t++
Rank
l33t++

NV1 was one of those chips that didn't do bilinear filtering so the games look a lot like CPU rendering but with some extras.

Games
3D Accelerated Games List (Proprietary APIs - No 3DFX/Direct3D)

Most are OEM releases and really hard to find.

Last edited by swaaye on 2011-09-12, 20:57. Edited 5 times in total.

Reply 19 of 56, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

thanks for the list 😀

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper