unfinished PowerVR PCX emulation stub

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

unfinished PowerVR PCX emulation stub

Post by leilei »

for "fun" I went and created a dummy NEC PowerVR PCX2 addon 3d device that just logs pci access to file. nothing works yet

i'm not really versed in writing video emulation on my own, so right now this is nothing more than a useless stub. I have a long way to go and my only point of study right now is mame's powervr2.cpp file (which is the direct successor to the Midas5 hardware which may not be helpful) as well as some of the stuff in this sdk

but the developer drivers do install and show up on the tab at least!
pcempvr.png
pcempvr.png (27.86 KiB) Viewed 16381 times
Sends Windows to a bsod hell whenever you press Alt though
EDIT:got the Tomb Raider demo to a crashless blackscreen so far, able to change resolution with the function keys and i'm still trying to make heads and tails from the pci logging

EDIT2: bleh. pathetic code so far as follows in the new attachment, i'll let this rot here. the .h file is just

Code: Select all

extern device_t powervr_device;			// pcx2
and gets added in pc.c of course, if anyone fancies themselves some blind powervr tomb raider action

i don't expect this to continue from this state though. as it is a completely naive attempt
Attachments
vid_powervr.c
stubberVR
(3.97 KiB) Downloaded 442 times
Alegend45
Posts: 85
Joined: Sat 26 Apr, 2014 4:33 am

Re: unfinished PowerVR PCX emulation stub

Post by Alegend45 »

LOL, even my RIVA TNT emulation is more complete. at least that does VESA, and somewhat tries to emulate the card.
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: unfinished PowerVR PCX emulation stub

Post by Battler »

Except the NEC PowerVR is not a graphics card, but I suspect it's a Voodoo-type add-on.
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: unfinished PowerVR PCX emulation stub

Post by omarsis81 »

Alegend45 wrote:LOL, even my RIVA TNT emulation is more complete. at least that does VESA, and somewhat tries to emulate the card.
When can we see your TNT in PCem? Can it play some games? :roll:
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: unfinished PowerVR PCX emulation stub

Post by SarahWalker »

Alegend45 has been banned until he grows up.
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: unfinished PowerVR PCX emulation stub

Post by omarsis81 »

Image
I just took a look at the real hardware card. It look very small and cute. I felt in love with it lol
It surprises me that it doesn´t have any output, nor imput ports. It should work very different than the Voodoo
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: unfinished PowerVR PCX emulation stub

Post by SarahWalker »

omarsis81 wrote:It surprises me that it doesn´t have any output, nor imput ports. It should work very different than the Voodoo
Yes, instead of outputting a video image itself like a Voodoo, PowerVR cards send the rendered framebuffer to the 2D video card via the PCI bus. An interesting solution, but I would think dependent on the quality of the 2D card and the motherboard PCI implementation. Voodoo's passthrough solution is probably a bit more reliable!
User avatar
leilei
Posts: 1039
Joined: Fri 25 Apr, 2014 4:47 pm

Re: unfinished PowerVR PCX emulation stub

Post by leilei »

I've heavily procrastinated on this because i've yet to figure out the memory addresses and stuff like that. i've tried to fill the emulated powervr memory with garbage, hoping for the driver to pick it up to no avail.

I might have to dump my real card running somehow for studying. Not getting much of a clue how the internals work going through all the confidential documentation, which mostly only covers on how the low-level SGL api works being its most explicit detail

(also supposedly, using the PCX2 with a Voodoo3 will give it the Voodoo's dac filter, but i've never seen this happen in my captures)

some things I know on the real hardware:

- Bandwidth is the primary bottleneck, followed by texture cache and possibly polygon limit. Is fastest at 320x200
- It can do quads and "n-sided polygons"
- Minimum texture size is 32x32, and the driver will upsample lower textures than that to 32x32
- Screen is composed of 32x32 tiles
- it's a 24-bit card that has a 16-bit post dither, being the default configuration. 24-bit can be unlocked through the registry and is actually faster
- the bilinear filtering precision is like PCem's Voodoo blinear code, but much less precise (even wobbles in some extreme close ups), and even less precise on alpha channels
- nothing blends! No blending functions at all. Only alpha. Unlike ViRGE, the alpha can be modulated at least.
- nVidia cards don't get along with its Direct3D HAL. If you've got a real PCX2, please don't use an nVidia card with it (ati, matrox and 3dfx are fine)
- averages 24fps in Turok, roughly half the performance of a 3dfx Voodoo Graphics in PCem
- Unreal shipped with support for this card from the initial release. Support of it kinda got dummied out in the later UE1 titles, but could be undummied and functioning with a bit of kernelex and hexing trickery so you could play Deus Ex, Rune, Unreal Tournament, etc. on this card
- The video card variants in the Apocalypse 3D line mash a Tseng ET6100 for the 2D core on the same board, as well as an ESS Agogo-XP for sound
- Techland's SGL MiniGL can get this card into running games you'd never think it would run ever (i.e. Q3, MDK2)
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: unfinished PowerVR PCX emulation stub

Post by omarsis81 »

I never had a PowerVR card, nor read much about it, but reading your post got me intrigued, so I begun a little research, and found it looked quite good on some games
See this Tomb Raider video I found
https://www.youtube.com/watch?v=5GMesT4WKzI

I found out that there is a version of Resident Evil optimized for PowerVR cards, so I hoped I could see it running it with your driver someday, but I believe there isn't much documentation to emulate it properly... maybe dumping or debugging real time games with actual hardware, but I have no idea how to do that

leilei, do you have the Matrox M3D card? I read the Apocalypse 5D was also popular.

On the other hand, half the performance of the Voodoo 1 isn't very appealing haha.
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: unfinished PowerVR PCX emulation stub

Post by omarsis81 »

I found a comparison video of the Resident Evil I was talking about.
https://www.youtube.com/watch?v=u2LVfam6w1o
Hmm, no big deal between D3D and PowerVR, except it's brightness

What is very interesting on this video card, is that with the same 4MB RAM it has, it can do 800x400 and 1024 I think, while Voodoo its only limited to 640x480
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: unfinished PowerVR PCX emulation stub

Post by SarahWalker »

Voodoo has to fit 2 framebuffers + Z-buffer into half of that 4 MB, as only 2 MB is connected to the FBI chip; the other 2 MB is entirely for textures. Hence the 640x480 limit (800x600 with 4 MB of framebuffer memory). On PowerVR, only one framebuffer has to fit in memory in the worst case, and I'm not sure even that - in theory if only a single render pass is required then it would render entirely to on-chip tile memory then transfer straight to the 2D card, meaning no frame or Z-buffer has to be in PowerVR memory at any point. I'm not sure if it's that clever though, so it might end up with 1 framebuffer + Z-buffer in 4 MB of memory.

Edit: just had a quick look at Vintage3D's Midas 3 (the immediate predecessor to PCX1, and probably the same actual architecture) review, and that seems to have only 1 MB for textures and 512 kb for geometry, no framebuffer memory. So resolution is limited entirely by the 2D card. This would seem to imply a hard limit on geometry complexity per frame though.
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: unfinished PowerVR PCX emulation stub

Post by omarsis81 »

Hey guys! I found a SDK package for the Series 1 at Vogons, maybe that could help with the development of the emulation chip
https://www.vogonsdrivers.com/index.php?catid=25
https://www.vogonsdrivers.com/getfile.p ... enustate=0
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: unfinished PowerVR PCX emulation stub

Post by omarsis81 »

I also found the project of this guy who is working on a PowerVR wrapper. He's been doing a great work, and seems almost done.
Sure it can give you an inspiration ;)

http://redtux.rocik.net/?page=projects&sub=sgl_wrapper
User avatar
leilei
Posts: 1039
Joined: Fri 25 Apr, 2014 4:47 pm

Re: unfinished PowerVR PCX emulation stub

Post by leilei »

SGL docs do not help or even give me clues on the registers. not even the developer drivers and debug
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: unfinished PowerVR PCX emulation stub

Post by omarsis81 »

leilei wrote:SGL docs do not help or even give me clues on the registers. not even the developer drivers and debug
What do you need? Chipset's datasheet?
Post Reply