VOGONS


First post, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

Looking at how DOSBox & QEMU revive the 3Dfx Glide accelerated games on modern system & OS, I was thinking if the same can be done for PowerVR native SGL games for DOS and Win9x. From the technical perspective, PowerVR PCX2 add-in card has an advantage over 3Dfx in emulation due to the headless architecture of PowerVR 3D rendering. Unlike 3Dfx hardware where they lived into the era of Win2k/WinXP, PowerVR PCX2 were dead after Win9x. Drivers support were only available on Win9x. So this makes perfect sense for DOSBox or QEMU running DOS/Win9x to revive PowerVR SGL games on modern system & OS, such as Windows 10 and Linux x64. There are several ways of achieving that vary in difficulties.

1. PowerVR SGL wrappers
Tuxality used to work on this, but I couldn't find anything to download from his website for the wrappers. This is the least resistance path to achieve the goal as the wrappers would have done all the heavy lifting of emulating the PowerVR SGL APIs. It should be comparatively easier to implement the stubs in DOSBox & QEMU to pass-through the APIs from guest into host. This does not require real PowerVR hardware. Glancing through the thread where Tuxality was actively developing the wrappers, it seemed that he was also stumbled on PowerVR titles that absolutely required Win9x to work, such as Mechwarrior 2 31st. If someone can point me to the last working version of Tuxality PowerVR SGL wrappers, then I would consider working on the the pass-through stubs for QEMU. I am a long-time fan of Mechwarrior 2 31st. This would pretty much give enough motivation for me get to play the game in PowerVR SGL version, which is highly claimed to be the best version. Tomb Raider 1 would come next on my mind.

2. PowerVR PCX2 PCI pass-through
From emulation perspective, this is highly doable. In fact, with the headless architecture it is possible to get the real PowerVR PCX2 render into the framebuffer of emulated display adapters in DOSBox & QEMU. Guest to host address mapping can be done on-the-fly behind the scene within DOSBox & QEMU. The PowerVR drivers running on guest OS would have its guest address programming intercepted and translated into host address, so the hardware can render directly into host physical memory. Official chip datasheet/programmer's manual for PowerVR PCX2 would really help to get this done correctly. Otherwise, reverse engineering can be done to log and trace very writes into the PCI apertures of the hardware and slowly figuring out the patterns of memory address programming. Unfortunately, this requires real PowerVR PCX2 hardware, and they have become really rare and expensive to acquire.

3. PowerVR PCX2 chip emulation
OK the last resort is obviously to do everything in emulation, similar to kekko voodoo1 chip emulation in DOSBox. This is nearly impossible to do without proper technical documentation. And, AFAIK there isn't any hardware documentation available today which describes the register level details of the PowerVR PCX2 chip.

I don't have PowerVR PCX2 hardware at my disposal. I can't work on #2 unless someone can help me to acquire one. I hope I can start working on #1 on QEMU if I can get my hand on the wrappers that Tuxality used to work on. My initial goal is to bring Mechwarrior 2 31st and Tomb Raider 1 to life. Once we get there, then we can see which PowerVR native titles to work on.

Please help to keep the discussion on-topic. There is no point to discuss PowerVR games through miniGL or Direct3D as those can always be played or easily made to play on modern OS, or games that support native PowerVR SGL, but also have very good 3Dfx Glide/Direct3D options, for eg. Turok 1.

Feel free to share any ideas on bringing PowerVR SGL games to life on modern system & OS.

Reply 1 of 16, by leileilol

User metadata
Rank l33t++
Rank
l33t++

I'd only ever consider option 3 for the long-term, no wrapping-to-other-APIs software-rendered way. You're looking at a chip that works with 'infinite planes' and n-sided polygons along with a crazy way for alpha sorting, shadows and the like. On top of the quirks, there's no register level docs around. It's nowhere near your 3dfx emulation analogue (which began with Aaron Giles checking out 3dfx's publicly released tech docs post-closure)

The most you can really do for 3 is to work from Dreamcast emulation sources as the PowerVR2 chips (CLX, Neon250) are quite literally an evolution from the PCX2. Mame's software rasterizer is a good start, though it's missing dithering and tiled rendering (And a lot of things, mame's dc/naomi emulation barely even works)
Tuxality was also going to try to implement the PCX2 in PCem at one point. I did do a basic register-logging stub PCI device but couldn't make heads or tails of what the driver wanted though

Most of the PowerVR games are only Win9x titles, so I wouldn't advise any DOSBox-related efforts.

by the way, DOSBox is not for running Windows 9x

Reply 2 of 16, by spiroyster

User metadata
Rank Oldbie
Rank
Oldbie

Yeessshhh numero uno ftw!

Personally, as someone who just wants to play the games on a modern system (scaled, and maybe with some shaders 😀), #1 I think is the easiest option to just get playing the SGL titles with non powerVR hardware.

#2 would be nice, but the PowerVR hardware would no doubt introduce limitations on modern hardware in terms of screen resolution and texture filtering etc. It might be nice to break out of this restriction? i.e Using it through a VM great!, but my WQXGA would mean I need a magnifying glass to actually enjoy the games o.0

#3, I Don't think there is a need to do the chip emulation unless you are an absolute purist, TBDR is 'just another renderer' and there isn't anything that could distinguish it from a standard rasteriser. The side-effects of its rasterization can be emulated, and unless the ability to always software render SGL is wanted? I can't see it being worth the time yet... unless you are a purist of course o.0

As leileilol said, powerVR titles are win9x only, which means for #1, the games would also have to be patched to work outside 9x. #2 cannot happen outside 9x unless you patch the drivers for said hardware, and patching would still need to be done for #3... so either way, for anything apart from #1 for Win9x... games need patching.

I think the stages would be...

1. Trace SGL calls on actual powerVR hardware in 9x.
2. Wrap these calls to have an SGL wrapper for win9x (OpenGL).
3. Patch the titles to work on later OS. Then use the wrapper.

I say GL, because this will mean no need for any more wrapper layering (DX wrapper) on linux etc. All modern cards support all versions of GL.

I was thinking about #1 as a project for myself this winter. Got all the bits for a 'videologic build' (Apocalypse 3D/Vivid XS) just need to find time to put it together and get tracing the API calls. 😀

Whatever you do, it would be nice to keep it open source, it seems SGL wrappers have been attempted by more than one over the years, but for whatever reason these projects dried up (time I guess... you reach a certain age, have kids etc and time becomes gold dust 😉). And when they dry up, there is nothing else for someone to pick up to continue with. Then the next person has to start from scratch again. booo

Incidentally, Demul is getting very mature these days, however the author doesn't want to open source it so we are left eagerly waiting their next release. It would be interesting to see their implementation in regards to the graphics. Is DC graphics subsystem SGL based?

Reply 3 of 16, by Scali

User metadata
Rank l33t
Rank
l33t
spiroyster wrote:

TBDR is 'just another renderer' and there isn't anything that could distinguish it from a standard rasteriser. The side-effects of its rasterization can be emulated

Actually, there's quite a bit that could distinguish it from a standard rasterizer.
The PCX2 can render its tiles directly to the frontbuffer of the host card, which creates an interesting 'racing the beam' scenario. You can actually see the tiles being blted to the screen, when the rendering is slower than the refresh rate.
Also, the fact that TBDR doesn't require an actual zbuffer in memory makes for interesting scenarios (and especially in the case of the Kyro II generation, various interesting bugs in games). Normally there is only a zbuffer inside the tile, making multi-pass rendering an interesting special-case.

These side-effects can't really be emulated in any other way than actually rendering per-tile (using a scissor rect, or even better, using a tile-sized backbuffer and actively blting to the real frontbuffer/backbuffer) and actively ditching the zbuffer between tiles.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 4 of 16, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie
leileilol wrote:

Most of the PowerVR games are only Win9x titles, so I wouldn't advise any DOSBox-related efforts.

spiroyster wrote:

As leileilol said, powerVR titles are win9x only, which means for #1, the games would also have to be patched to work outside 9x. #2 cannot happen outside 9x unless you patch the drivers for said hardware, and patching would still need to be done for #3... so either way, for anything apart from #1 for Win9x... games need patching.

DOSBox & QEMU can run DOS/Win9x as guest OS perfectly with good speed on today's modern system. There is no need to patch the games, they can be run in pristine condition. I believe this was sort of a blocker for Tuxality in his PowerVR SGL wrappers development as he needed to build a retro win9x gaming system to check out his work.

BTW, what happened to Tuxality's work on PowerVR SGL wrappers? Had any binaries &/or source code ever been made available for others to try out? The last status on the thread showed 2 supported PowerVR games, Virtual-On & BioHazard. Judging from the YouTube videos, it seems that the rendering implementation is pretty matured. I would estimate that Mechwarrior 2 31st would have worked if we could get the SGL wrappers to work in QEMU.

Reply 6 of 16, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie
leileilol wrote:
kjliew wrote:

DOSBox & QEMU can run DOS/Win9x as guest OS perfectly with good speed on today's modern system.

No

@leileilol, you seem to possess a strong objection for DOSBox running Win9x as guest OS. I fully understood that this is unsupported. To be frank, even QEMU community would care less about Win9x support as such OS does not have commercial values in virtualization. VMWare & VirtualBox, all had dropped the balls on Win9x. It just so happens that Win9x still works and good enough to achieve my goal of getting the games to run on it, and playable.

I have come across games that won't work in DOSBox with Win9x as guest OS. However, for games that work, they work really well. The x86 CPU emulation, though not complete, is the fastest I have seen. QEMU TCG has a more robust, but slower CPU emulation. For Win9x games that I tested that failed in DOSBox, they worked pretty well in QEMU provided the CPU requirement was within the reach of QEMU emulation.

Reply 7 of 16, by gdjacobs

User metadata
Rank l33t++
Rank
l33t++
kjliew wrote:
leileilol wrote:
kjliew wrote:

DOSBox & QEMU can run DOS/Win9x as guest OS perfectly with good speed on today's modern system.

No

@leileilol, you seem to possess a strong objection for DOSBox running Win9x as guest OS. I fully understood that this is unsupported. To be frank, even QEMU community would care less about Win9x support as such OS does not have commercial values in virtualization. VMWare & VirtualBox, all had dropped the balls on Win9x. It just so happens that Win9x still works and good enough to achieve my goal of getting the games to run on it, and playable.

I have come across games that won't work in DOSBox with Win9x as guest OS. However, for games that work, they work really well. The x86 CPU emulation, though not complete, is the fastest I have seen. QEMU TCG has a more robust, but slower CPU emulation. For Win9x games that I tested that failed in DOSBox, they worked pretty well in QEMU provided the CPU requirement was within the reach of QEMU emulation.

I think you answered your own question.

All hail the Great Capacitor Brand Finder

Reply 8 of 16, by spiroyster

User metadata
Rank Oldbie
Rank
Oldbie
Scali wrote:
Actually, there's quite a bit that could distinguish it from a standard rasterizer. The PCX2 can render its tiles directly to th […]
Show full quote
spiroyster wrote:

TBDR is 'just another renderer' and there isn't anything that could distinguish it from a standard rasteriser. The side-effects of its rasterization can be emulated

Actually, there's quite a bit that could distinguish it from a standard rasterizer.
The PCX2 can render its tiles directly to the frontbuffer of the host card, which creates an interesting 'racing the beam' scenario. You can actually see the tiles being blted to the screen, when the rendering is slower than the refresh rate.
Also, the fact that TBDR doesn't require an actual zbuffer in memory makes for interesting scenarios (and especially in the case of the Kyro II generation, various interesting bugs in games). Normally there is only a zbuffer inside the tile, making multi-pass rendering an interesting special-case.

These side-effects can't really be emulated in any other way than actually rendering per-tile (using a scissor rect, or even better, using a tile-sized backbuffer and actively blting to the real frontbuffer/backbuffer) and actively ditching the zbuffer between tiles.

Ah ok, but did any SGL titles exploit this for anything? I suspect not although do remember some fade-out with a game called SubCulture which was drawing selective tiles??? If it is, then yes this behavoir would have to be replicated 😒

kjliew wrote:
DOSBox & QEMU can run DOS/Win9x as guest OS perfectly with good speed on today's modern system. There is no need to patch the ga […]
Show full quote
leileilol wrote:

Most of the PowerVR games are only Win9x titles, so I wouldn't advise any DOSBox-related efforts.

spiroyster wrote:

As leileilol said, powerVR titles are win9x only, which means for #1, the games would also have to be patched to work outside 9x. #2 cannot happen outside 9x unless you patch the drivers for said hardware, and patching would still need to be done for #3... so either way, for anything apart from #1 for Win9x... games need patching.

DOSBox & QEMU can run DOS/Win9x as guest OS perfectly with good speed on today's modern system. There is no need to patch the games, they can be run in pristine condition. I believe this was sort of a blocker for Tuxality in his PowerVR SGL wrappers development as he needed to build a retro win9x gaming system to check out his work.

BTW, what happened to Tuxality's work on PowerVR SGL wrappers? Had any binaries &/or source code ever been made available for others to try out? The last status on the thread showed 2 supported PowerVR games, Virtual-On & BioHazard. Judging from the YouTube videos, it seems that the rendering implementation is pretty matured. I would estimate that Mechwarrior 2 31st would have worked if we could get the SGL wrappers to work in QEMU.

Ah I missread your first post. Thought it was about getting SGL to work on modern (non-9x). So you want to keep this within win9x or dosbox? Maybe avoid a wrapper then since you need something to 'wrap' it to? Are you talking about passing through to host offscreen renderbuffer to render, and then back to guest framebuffer? Otherwise its going to be really slow since its basically a software renderer, and running within the guest? or am I missing something here 😵

I'm not familiar with this way of doing things? don't you need the dll in guest environment (sgl.dll) to talk directly to the VM/host hardware somehow?

Reply 9 of 16, by kjliew

User metadata
Rank Oldbie
Rank
Oldbie

A simple example, taking Mechwarrior 2 31st PowerVR version.

If we had the SGL-to-OpenGL wrapper, called it SGLwrap.dll preferably open-sourced, then we could run the game inside QEMU with Win9x as guest OS. Mechwarrior 2 31st only run on Win9x in pristine condition. There is a stub SGL.dll in the guest OS which is used by the game. The emulator (DOSBox/QEMU) provides virtualized interface for the stub SGL.dll to pass-through the APIs into the real SGLwrap.dll on the host OS. The host OS can be Windows 10 or Linux where SGL-to-OpenGL wrapper would be functional.

Both DOSBox & QEMU support this for 3Dfx Glide API.

Reply 10 of 16, by VirtuaIceMan

User metadata
Rank Oldbie
Rank
Oldbie

I was keeping in touch with Tuxality but I'm not sure what's happened to him. As I own a copy of the rare Moon Racer PowerVR game I was hoping it might be playable one day, but he's not been on VOGONS since July 😒

I know he'd had a few issues in various parts of the world where he was staying, hopefully he'll pop back on here at some point.

My PC spec: Win10 64bit, i7-4970K (not overclocked), KFA2 GeForce RTX 2070 SUPER, Creative Soundblaster ZXr, 16GB RAM, Asus Z97-A motherboard, NZXT 410 case, ROG Swift GSYNC monitor

Reply 11 of 16, by VirtuaIceMan

User metadata
Rank Oldbie
Rank
Oldbie

Actually I just heard from him, the wrapper isn't dead but it's stressful to work on it, hopefully there may be news in the coming months, but no firm release date.

My PC spec: Win10 64bit, i7-4970K (not overclocked), KFA2 GeForce RTX 2070 SUPER, Creative Soundblaster ZXr, 16GB RAM, Asus Z97-A motherboard, NZXT 410 case, ROG Swift GSYNC monitor

Reply 14 of 16, by leileilol

User metadata
Rank l33t++
Rank
l33t++

refine your spelling. pcsx2's an emulator. also always look for the brand (apocalypse, 3dengine, m3d) as sellers may not always describe the gpu involved.

by the way, DOSBox is not for running Windows 9x

Reply 15 of 16, by matze79

User metadata
Rank Oldbie
Rank
Oldbie

How do you cool your PCX1 Cards ? mine is getting temperatures where you almost burn your fingers.. i think i would go add a Heatsink on it.
But how to attach one without loosing the prints on the chip ? Maybe make some Sort of Clamp ?

Implent PCX2 in FPGA and make new PCI Card 😉

https://dosreloaded.de - The German Retro DOS PC Community
https://www.retroianer.de - under constructing since ever

Co2 - for a endless Summer