r/askscience • u/nixon11 • Mar 24 '14
Computing Why are high performance computers considered more powerful than the next gen consoles, but are unable to run even previous generation emulators (PS3, Xbox 360) at appropriate efficiency?
8
Upvotes
5
u/[deleted] Mar 25 '14
Architectural differences. The emulator tries to translate the instructions from the console architecture to the PC architecture. This takes a lot of overhead as potentially millions of instructions have to be translated per second.
I'll try to explain it as simply as possible.
Say you understand both Spanish and English. If you are given a speech in spanish and asked to present it to an english speaking audience, you'll have to translate it line by line and you will pause before reading each line, hence you will end up reading it much slower even though you can speak both languages really well.
The same happens in an emulator.
1.)The emulator receives a PowerPC/MIPS instruction. 2.)Then translates it into x86 instruction. 3.)Executes the instruction.
Take the above example, for each instruction required to play the game, the computer has to dedicate 3 or more cycles (Considering that each step uses a cycle each) and you can see how it all adds up.
Also, how the console exactly works is not documented, you'll have to reverse engineer most of the implementations which may be slower than the original or may work/not work on a case by case basis. This is what causes many rendering glitches in games.
I have used my limited knowledge to explain why games lag on an emulator, any experts can correct me and maybe I can learn something new as well :)
4
u/Beardacus5 Mar 24 '14
Architecture for a start. And I know that the PS3 uses a 7 "core" processor which cannot be emulated at the moment. Its not a GPU issue for sure, but a CPU compatibility issue.
I believe the same is also true of the 360, but the 360 CPU has less "cores". I'm not 100% on that though.
We can get there eventually, but its a case of having to brute force our way to emulation rather than just being able to outright use the code that's there. The code is not written for the OSs or the hardware we use as computers at all, hence the inefficiency.
1
u/ggtroll Big Data | Brain Mapping and Classification Mar 28 '14 edited Mar 28 '14
Actually it's a little bit of everything said in the thread and a bit more,
By definition to emulate means to 'mimic' completely; that's what emulators do basically they try to mimic a computer architecture in all it's (former, usually) glory. Computers have evolved a lot, take in for example the (now) old Intel 8086 processor [1] which had miniscule specs compared to today's computation beasts, even emulating that processor comes at a considerable overhead during execution although not very evident due to the fact that this processor is an x86 compliant one, and the first one at that!
Now to answering your question; older computers were very custom stuff not standardized at all and everyone was doing their own thing back in the day hoping that their solution would be best and prevail above all others; unfortunately what in truth happened was an architectural chaos and meant that you basically had to re-write all your software for that new computer you just bought. That was the 80's. During the 90's gaming consoles they followed that trend in an increasing fashion when PC processors started to standardize and all lean towards x86, so when we say consoles basically means 'welcome to the land of the custom (hardware)'.
To emulate a game you have emulate the whole console and this of course includes the CPU, GPU and so on; of course as I said above consoles are very custom hardware tailored specifically for that console, so even though that chip might be readily available the one used in the console might be an altered version of it with additional or reduced functionality than the original.
The hard part is emulating the architecture instructions both for the CPU as well as the GPU; for starters the computers we use today are either (little-endian based) 32-bit or 64-bit but the architectures older consoles used were of varying length the legendary Atari 2600 for example used an 8-bit [2] processor while the newer Sega Saturn used 2 SH-2 32-bit processors from Hitachi [3]. Not to mention the GPU's which are a whole new beast of their own. The register bit length is not even the hardest part, the hardest part is to emulate the actual assembly commands and what they do. I'll give one brief example without being too specific; say one console might have an instruction that takes two 16-bit registers adds to each one of them a fixed number say 4 and then adds them together returning the final result. Ideally that instruction would execute in 1-clock-cycle in the console as they would have created a specific part on the chip to perform that exact functionality; now translating that instruction to x86 for example would take 3 instructions instead of 1 in the console: two instructions to add to each register the fixed number and one instruction to add them together. There are also a lot more lower-level details but that would complicate the post quite a bit....
Emulating the GPU's is actually even harder than emulating the CPU's, this stems from the fact that most CPU's descend from a RISC [4] design standpoint so they have a lot in common. GPU's especially in the old days did not have a programming framework and their operations were quite complex and unique to each console. Fortunately recently consoles have started to comply with standards such as DirectX and OpenGL making their programming (and thus emulating) quite a bit easier. You can read an interesting article regarding the GPU of Nintendo Gamecube showcasing how difficult (even today) is to emulate decently a GPU of the old era [here].
Finally it has to be noted that emulators are large projects and require considerable time, effort and man-power to be made; the more complex the hardware gets the harder it is to emulate it in real time.
0
u/[deleted] Mar 25 '14
[deleted] — view deleted comment