x86/x64 emulating the N64's CPU

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

Rifter

Lifer
Oct 9, 1999
11,522
751
126
100% accuracy is not possible on current hardware. So its a good thing you dont need it to still enjoy playing games.
 

Revolution 11

Senior member
Jun 2, 2011
952
79
91
I am still waiting for BenchPress to jump in here and show us how AVX2 will change emulation forever. He's been doing that for every other thread out there. :whiste:
 

Cerb

Elite Member
Aug 26, 2000
17,484
33
86
100% accuracy is not possible on current hardware. So its a good thing you dont need it to still enjoy playing games.
I wonder if a good dynarec style emulator, complete with firmware knowledge for the DSP, could do it? High-level-only interpretation with the occasional JIT hotspot definitely won't be doing it any time soon.
 

amddammad

Junior Member
Oct 11, 2010
15
0
61
I am still waiting for BenchPress to jump in here and show us how AVX2 will change emulation forever. He's been doing that for every other thread out there. :whiste:

you seem to know alot about this emulator stuff so can you tell me when will ps3 emulator come?

sorry to hijack your thread op.
 

Revolution 11

Senior member
Jun 2, 2011
952
79
91
Lol, what? I am no expert. I just enjoy playing older classic games on platforms I never had the pleasure of owning in my childhood, I lurk a bit on emulator forums as a newbie, and I read that ArsTechnica article....

(If you have questions about coding, ask Cerb. If you need a speech about AVX2, ask BenchPress. :biggrin:)

The much-desired PS3 emulator will probably not be here anytime soon. Here's 3 reasons.

1. Performance Issues. The PS3 is a newer console so it has higher performance than the N64. Higher performance means much harder emulation.

2. Legal Issues. The overreach of copyright, patents, and the suppression of user rights to modify their own bought software means that emulation of current and new consoles may be illegal and certainly discouraged. Source code and documentation needed for good efficient emulation will most certainly not be released.

3. Online Paid Accounts. The rise of Xbox Live (and whatever the PS3 has) means that console manufacturers have a new steady revenue stream in people paying for good online multiplayer. Emulation could threaten this so there's no way the Big Three will open their consoles to emulation.
 
Last edited:

alyarb

Platinum Member
Jan 25, 2009
2,444
0
76
Reason #1 is good enough. Just too many technical caveats with PS3.

They can't even get a saturn emulator working properly, and the saturn wasn't a powerhouse even when it was new. It was just an unconventional asymmetric dual-proc (and from a traditional multiprocessing perspective, you could say the Cell is more exotic than the Hitachi arrangement in the Saturn). Even contemporary developers had little inclination let alone the necessary skills to optimize for each CPU.
 
Last edited:

Exophase

Diamond Member
Apr 19, 2012
4,439
9
81
Accuracy vs. speed is the main tradeoff with emulators. For more technical reasons, read the article.

This is kind of a myth, and with all due respect to byuu, I think laypeople would be benefited from hearing the take of other emulator authors.

There are many tradeoffs in the design of an emulator that can affect performance. For instance, performance can be effected by (this is hardly exhaustive): programming language used, portability efforts, legibility/lines of code, and effort and ingenuity in optimization. Poor accuracy is also not necessarily consciously obtained in favor of performance (or superior accuracy at the expense of performance). It can be in favor of implementation time and/or complexity. Or, very commonly, because the emulator author doesn't know have enough information for how the system works, either because he doesn't understand the available information or because the information hasn't been available in the first place. Reverse engineering hardware specifications exactly can be extremely difficult.

Several of the examples byuu gave have nothing to do with performance decisions.

Accuracy itself can refer to a lot of different things. Really broadly speaking, you can look at functional specification and timing specification as being two sort of separate things (even though they aren't really at the fundamental level). For instance an ISA may define the functional specification of an instruction set at great detail but say nothing about timing, which can vary a lot between CPU microarchitectures. But these different CPUs are still intended to run the same programs, and most programs (at least those made in the last 15+ years, outside of embedded programming) don't rely on timing to the extent that they only operate "correctly" if the timing is spot on. They might operate "differently" in some circumstances though, like having a higher framerate or exhibiting less slowdown. If this bothers you then it makes sense to push for better timing accuracy. But the popular N64 emulators suffer from way more fundamental forms of functional inaccuracy.

Note that the virtualization standards set forth by Popek and Goldberg basically boil down to the virtualized program not knowing it's being virtualized, yet performance/timing accuracy is given as an explicit exception to this.

The gold standard for timing accuracy is "cycle accuracy", which at least makes sense for consoles where everything runs off of a single clock - including I/O devices, so making a cycle accuracy CD-ROM emulator for instance makes no sense. Making a cycle accuracy N64 emulator would indeed be very resource intensive.. but first and foremost it'd be really hard to determine how all of the N64 works at this level. Since it has a lot of different components with complex interconnects.

Revolution 11 said:
I am still waiting for BenchPress to jump in here and show us how AVX2 will change emulation forever. He's been doing that for every other thread out there. :whiste:

It probably could theoretically, but it won't ;p In the context of N64 on I could see an efficient AVX2 implementation helping a lot with RSP emulation.
 
Last edited:

Hypertag

Member
Oct 12, 2011
148
0
0
While it is kind of rediclous that we have better Wii and PS2 emulators than N64 emulators, I don't think there is much we can do about it outside of paying a software development team a few million to develop one properly.
 

Anarchist420

Diamond Member
Feb 13, 2010
8,645
0
76
www.facebook.com
100% accuracy is not possible on current hardware. So its a good thing you dont need it to still enjoy playing games.
I don't know about all that.

Emulation accuracy is very important to me and the N64 emulators available are awful in terms of accuracy. I can get them to run plenty fast, but lack of accuracy kills them.
 

TakeNoPrisoners

Platinum Member
Jun 3, 2011
2,600
1
81
To emulate some processor 100% means you have to emulate every individual electron in the processor itself. Something like that is just so far beyond our current technical capibility that you will probably be waiting decades for the technology.

At some point you just need to draw the line and say that something is good enough for your needs now.
 

BFG10K

Lifer
Aug 14, 2000
22,709
2,972
126
I'm guessing the shaders of a GPU could be used and with the workload split between those and the CPU, but using ROPs to emulate the N64's blending just doesn't give enough accuracy.
I doubt the N64 would need more than FP32 accuracy.
 

Obsoleet

Platinum Member
Oct 2, 2007
2,181
1
0
To emulate some processor 100% means you have to emulate every individual electron in the processor itself. Something like that is just so far beyond our current technical capibility that you will probably be waiting decades for the technology.

At some point you just need to draw the line and say that something is good enough for your needs now.

Just not having tons of crappy old consoles laying around is good enough reason for me. I'm only interested in Genesis (all titles) and maybe 1 SNES title (Super Mario World) emulation.

While it is kind of rediclous that we have better Wii and PS2 emulators than N64 emulators, I don't think there is much we can do about it outside of paying a software development team a few million to develop one properly.

Good thing I still have my 64 and no Wii or PS2 :)
 

Anarchist420

Diamond Member
Feb 13, 2010
8,645
0
76
www.facebook.com
Just not having tons of crappy old consoles laying around is good enough reason for me.
That and the fact that the analog output circuitry weakens. It's most noticeable with my PS2 and Genesis (although the PS2 never had good video output circuitry in the first place and the Genesis model I have doesn't have the best Sony video encoder).

The last time I played my Genesis it looked and sounded like crap; the video output was rather blurry and the colors were not vibrant at all. My genesis is far from being fresh, so it's a good thing Kega Fusion is accurate enough; there is a particular plugin that I really like and it's compatible with every game I've tried.

SSF could use some work, but I find it better than any of the N64 emulators I tried.