GameCube Emulation and Pixel Processing Problems
dolphin-emu.org
dolphin-emu.org
Compare this to the MAME situation, where most early 3d arcade games are completely unplayable, and will remain like this for the foreseeable future, because the way computers are going, there is no way in hell we'll be able to emulate those old, custom graphics cards with full accuracy and full speed using only general purpose CPUs.
From what I understand the most demanding thing to emulate isn't the 3D hardware anyways, it's the high clock rate CPUs. Most of the latest 3D hardware supported by MAME is implemented with ASICs which have a relatively high level interface. This allows the emulation to be pretty highly optimized since the low-level details aren't visible to the game software anyways. CPUs are a whole different story though. There you are stuck emulating individual instructions which gets pretty hairy when the CPU you're emulating can do 200+ MIPS.
I see your logic there. Claim there is no way in hell it will happen and it will significantly increase the probability that it will happen.
Which is pretty much exactly how NES and SNES cartridges worked, come to think of it—except that the console they were patching was hardware, so they had to add new physical chips to do it. (Speaking of, I've always wondered why no console just ships with some FPGAs inside that are free for each game to program on startup.)
There's also the issue of developing for an fpga being more difficult, and thus time consuming, than writing tight c.
Compare this with the PS2, which has a bunch of crazy programmable coprocessors to build an extremely flexible but hard-to-emulate system.
It's probably no coincidence, given that it was developed by ex-SGI engineers who founded their own company, ArtX, who got bought out by ATI to develop the R300, one of the first modern programmable GPUs.
The 3DS processor is capable of emulating 8-bit systems, as it has virtual console NES and GB/GBC games. SEGA also ported some Genesis games to run on the 3DS, but I think they had to re-write parts in native ARM code as straight emulation wasn't fast enough (Google "Sega M2 GigaDrive" for a great series of interviews about this).
As a matter of fact, AMD GPUs are using the floating point ALUs to perform integer math (note: this might have changed with their GCN architecture). However, given that the mantissa of IEEE floats is just 24 bits long, the ALU also can just handle 24 bits, which is not sufficient for full 32 bit math. Hence, for "true" integer arithmetic, the ALUs need to be double-pumped or emulated via floats (i.e. the dirty tricks which we avoided need to be done in the driver instead - but at this stage it can actually be done reliably, even if it's still ugly).
I assume the situation is similar for Nvidia GPUs. Either way both vendors said their GPUs aren't designed for optimal integer performance - so that's why we expect the performance drawbacks of integer usage to become less and less of an issue in the future.
as for nvidia knee-capping integer arithmetic on their GPUs.. i terribly doubt that is the case - pointer arithmetic (and hence memory access) requires integer operations, and i've seen very little evidence to suggest that there are any artificial issues with it.
That said, there's a "fast" path on AMD GPUs for shader code which only requires 24 bits of integer precision. Those are actually exactly enough for GameCube/Wii GPU emulation, however I'm not sure if their shader compiler properly optimizes our code to use that path.
http://www.nvidia.com/object/quadro.html
Granted, most games don't use double precision or integer math so it's a reasonable choice for market segmentation.
Being on a mac, I'm tied to OpenGL so I'm hoping this doesn't hurt me too much.
You can also get an upgrade application from http://windows.microsoft.com/en-US/windows-8/upgrade-product... to move Win7 up to Win8.
But AFAIK you can't get a MS Windows 8 ISO to download from Microsoft itself?
In the first equation (it admits it's wrong), I plug in 1 and get 0.00390625.
In the second equation, I plug in 1 and get -0.992188.
I think the answer is supposed to still be 1, because there should be no overflow until it is 256.
I thought maybe I was misunderstanding and the equation isn't just to handle overflows but is supposed to add 1 then handle overflows. So I plugged in 0 into the equations and they both outputted 0. So they aren't trying to add 1.
Wouldn't the correct equation be frac(value / 256.0) * 256.0 ?
EDIT: So uh, as a quick example of where things go REALLY wrong with the first equation - try value=-0.0000001 ;)
It's still not completely correct, some values passed through that function come back as +/- 1e-16 and 255/256 becomes 0. Showing us again how floats are bloody hard to work with for the average programmer.
Edit: saw neobrain's comment, please disregard my post. Still, shouldn't there be a round in there too?
I don't think so, since that particular code was just meant to emulate integer overflows (in contrast to the limited decimal precision of integers). If you were to emulate the precision as well, it would likely need an additional round around everything indeed, i.e. something like round(value - 2.0 * round(0.5 * value * (255.0/256.0)) * 256.0).
If anything, this discussion shows that it's getting annoyingly complex to find the correct formula though, especially if all corner cases are supposed to be handled correctly. Oh right, and the real fun begins when you try to emulate 24 bit integers, for which the proposed method doesn't work at all because floats only have 23 bits of mantissa :)
Chances are there are simpler ways to emulate this stuff, I really don't know. Would be interesting to hear from GPU driver developers how integers are emulated within the driver via floats if hardware does not support integers :)
At least I have an excuse to buy a GTX 780 now.
EDIT: Fixed incorrect double-negative
A similar situation comes up with Gnash, the GNU adaptation of flash. They require developers to have never installed flash, which requires signing the EULA, which includes a clause about reverse-engineering the program.
People avoid disassembly in clean-room implementations out of an abundance of caution. If it's evident that the logic was ripped from disassembled executables, you'll have a harder time defending against patent claims or frivolous copyright claims.
IANAL, but this is my understanding.
I'll probably just remove this link from the downloads page.