Changes

Jump to navigation Jump to search

Emulation accuracy

14,198 bytes added, 27 February
no edit summary
;It'''Accuracy''' is s important to know that emulation accuracy and compatibility are two different things; while how accurate the closely an emulator is to mimics the original hardwareis important, don't mistake that for compatibility. Accuracy Whether games run properly is most a separate concern, accuracy can sometimes influence it. See [[#Perfection.3F|"perfection"]] and [[#Controversy|"controversy"]] sections. ;In the world of computing, terms like "[[Hypervisors|hypervisors]]", "[[Simulators|simulators]]", "[[Compatibility_layer|compatibility layers]]", "[[Wrappers|wrappers]]", "[[FPGA|FPGA-based hardware cloning]]" and "[[:Category:Emulators|software emulators]]" are often achieved by tighter syncingused interchangeably, leading to confusion. While they share some similarities, each technology serves a distinct purpose and operates at different levels. Within the realm of computer science, emulation occupies a niche distinct from virtualization or other techniques. Whereas hypervisors usually used for partitioning physical hardware resources among multiple guest operating systems, and simulators where developers build virtual replicas of specific environments or processes, emulation endeavors to recreate an entire historical architecture. This digital reconstruction seeks to faithfully capture the instruction set, timing behaviors, hardware features and even peripheral nuances of a bygone hardware platform. Unlike compatibility layers, which translate software instructions to a native format, emulation builds a virtual stage upon which the software itself can perform authentically. More accuracy means less graphics Emulation's intricate tapestry sometimes intertwines with threads of other technologies though. Notably, certain emulators leverage hypervisors for a more efficient handling of resource allocation and audio glitchesisolation. Additionally, some emulators employ compatibility layers as subcomponents, at acting as translators for specific libraries or APIs that might otherwise be incompatible with the cost host environment. Think of additional CPU power required these layers as linguistic bridges, allowing the emulated software to run converse fluently with the modern system hardware. By strategically merging these techniques and the help of skilled use of [[High/Low_level_emulation|HLE and LLE or Hybrid]], [[Dynamic_recompilation|compiler techniques]] and using specific features such as Fast Memory Access[https://github.com/PCSX2/pcsx2/pull/5821][https://github.com/PCSX2/pcsx2/pull/7295][https://yuzu-emu.org/entry/yuzu-fastmem/#what-is-fastmem][https://dolphin-emu.org/blog/2016/09/06/booting-the -final-gc-game at full speed/] and instruction set support (such as [https://whatcookie.github.io/posts/why-is-avx-512-useful-for-rpcs3/ AVX-512 for RPCS3]) and other various optimizations[https://yuzu-emu.org/entry/yuzu-progress-report-dec-2023/#android-adventures-and-kernels-with-benefits], certain emulators achieve impressive levels of performance and compatibility, further unlocking the doors to historical software [[Preservation_projects|preservation]].==Types[https:=====Low accuracy===//youtu.be/cCXri4yDHmU]
Low accuracy So in summary, an accurate emulator is when an instruction given to both the program and the hardware results in both outputting the same result. That means accurate emulators will have a large amount of visual produce much fewer audio and audio video glitches, usually at the cost of more processing power needed. They will typically use various game-specific hacks to skip over problems, such as speed or compatibility issues with specific gamesIt's often achieved by using tighter synchronization. Many times, these The more accurate an emulator authors will only prioritize popular gamesis, and the less popular games will lesser deviations there is from real hardware behavior but the more demanding it is. Ironically, that aspect might at times be incompatible. An example of this at odds with how authentic the experience is Speedy Gonzales: Los Gatos Bandidos with emulators such as , when it introduces [[ZSNESInput lag]] and [[Snes9x]], where the game will soft-lock towards the end. This can also become very problematic when ROM hacks use these hacks A similar debate surrounds CRT shaders as well. Not to run by abusing mention the errors to create otherwise impossible behavior. This means that hardware intensive nature of very accurate emulators for later consoles may be at odds with the ROM hack can only be used in that one specific emulator and is incompatible 's usability, especially with real hardware the recent collapse of Moore's Law (either through flash cart or reproductionin layman's terms, you can't just "buy a better PC" if semiconductor technology does not catch up fast enough with what it takes for accurate emulation that makes zero compromises for optimizing speed). Such an issue has occurred with [[ZSNES]] As a result, accuracy and emulator authenticity continue to be controversial subjects and still occurs today with new N64 ROM hackshighly a matter of opinion depending on what aspect of the experience the user values more.
Many times, newer emulators use ==Types==Emulators tend to favor [[High/Low level emulation|High -Level Emulation (HLE) as opposed to Low -Level Emulation (LLE)]] for hardware demanding systems to emulate, <abbr title="This shouldn't be confused with compatibility though.">which results in lower accuracy. There are some exceptions to HLE causing low accuracy</abbr> because instead of mimicking the hardware these games were released on, such as High-Level emulators mimic how the games themselves behaved on the desired system. While emulators like [[Dolphin]] emulatorfavor accuracy but still retain HLE for performance and have [[High/Low_level_emulation#Examples|successfully used it to an advantage]], but these types of exceptions are uncommon, and it can still hinder accuracy. ===Low accuracy===An emulator isn't accurate when it has a large amount of visual and audio glitches and favors performance as much as possible. More information about this To work around these glitches, emulator developers typically include game-specific hacks (and prioritize popular games) to skip over problems, such as compatibility issues that can cause games to break. Many times, these emulators will be found at deemed incompatible with the less popular (obscure) games. As Near (then known as byuu) explains in a 2011 Ars Technica article linked below, ''Speedy Gonzales: Los Gatos Bandidos'' will soft lock towards the end due to a specific hardware edge case that isn't emulated in [[ZSNES]] or [Highhttps://github.com/snes9xgit/snes9x/issues/Low level emulation280 Snes9x], but is properly dealt with in his own emulator [[higan]] due to his documentation of the system. This can also become very problematic when ROM hacks abuse software errors (aka. emulator oversights) to create otherwise impossible behaviors to achieve what they can. When a ROM hack can only be used in that one specific emulator, he explains, it becomes incompatible with real hardware (either through a flash cart or printed), and that such an issue has occurred with [[ZSNES]] pagebefore and continues to occur with Nintendo 64 ROM hacks.
===Medium accuracy===
Medium accuracy emulators will finds itself in between, think of it as the middle ground. Emulators with medium-level accuracy have fewer glitchesa decent level of compatibility with commercially released games and should be able to get the job done for the most part. Emulators with medium accuracy don't cover some of the more advanced nuances of the hardware it seeks out to imitate, but will still have many problemsthis shouldn't matter a whole lot for a good number of games. Most high-level emulators may fall into this category. In summary, emulators with medium-level accuracy are passable. They aren't the worst, but they aren't fantastic either, they sit in the middle.
===High accuracy===
High accuracy emulators try to replicate is a level of precision that emulator developers strive for when achieving [[#Cycle_accuracy|cycle accuracy]] or even [[#Partial cycle-accuracy|partial-cycle accuracy]] is not practical or necessary. This approach focuses on replicating the original system 's components as closely as possible, and for that reason take aiming to faithfully reproduce its behavior while staying mindful of hardware demands. Though it may demand more CPU processing power compared to do so. They will have lowly accurate emulators, pursuing a more accurate emulation experience can pay off in the form of fewer audio and /visual glitchesand better handling of niche scenarios that creative programmers often implement. High Though they don't mimic every clock cycle as precisely as cycle-accuracy , highly accurate emulators may or may not be cycle accuratecapture the essence of the original hardware very well. Some high accuracy emulators can achieve Also achieving 100% compatibility with commercially released gamesis a common goal for emulators with high accuracy. Some of these emulators represent an even more meticulous level of precision in replicating the original system compared to other highly accurate emulators, this heightened level of accuracy often involves more sophisticated techniques, demanding increased computational resources.
===Cycle accuracy===
Cycle accurate accuracy is a more stringent form of emulation is trying accuracy that seeks to perfectly emulate timings right down precisely replicate the timing and execution of each individual cycle of the original hardware. This type of emulation accuracy aims to per-match the appropriate timing and execution of each cycle. The authenticity and performance of the emulator in question depends in how cycle accessesaccuracy is implemented. Typically, emulators with this level of accuracy ensure that situations where precise timing is required are properly dealt with.  So each individual component is emulated at exactly the right time, in perfect syncsummary, we can talk about three types of cycle emulation: "partial cycle-accuracy", "cycle-based accuracy" and so on, which has a high CPU cost"full cycle-accuracy". The speed These can be considered as subsets of "cycle accuracy." Due to technical challenges and performance considerations, emulators often employ either "partial cycle-accuracy" or "cycle-based accuracy" depending on the specific requirements. Mesen, BlastEm, NanoBoyAdvance, Azayaka, MartyPC and Stella are recognized for their cycle-accurate emulation depends , though for knowing the specific degree of cycle-by-cycle precision for each needs further research. ====Partial cycle-accuracy====This focuses on replicating the timing of instructions and key internal operations, while simplifying or skipping some less critical details. This can lower the way performance requirements compared to full cycle accuracy . Remember, just because an emulator is implementedpartially cycle-accurate doesn't necessarily make it more accurate than a highly accurate emulator. For example, CEN64 only emulates the CPU pipeline cycle-accurately and that's all, on the other hand Simple64 is more accurate in terms of timing for specific tasks like certain DMA transfers, even though it doesn't achieve partially cycle-accurate emulation.:Examples of partially cycle-accurate emulators are [https://old.reddit.com/r/emulation/comments/vy8cg7/ares_v129_has_been_released_crossplatform/ig4da06/ bsnes] and [https://discord.com/channels/976404869386747954/976463759935696977/1106700321222299762 CEN64].  ====Cycle -based accuracy ====This type of emulation accuracy aims to reproduce the system's functional behavior within a specified number of cycles without necessarily adhering to the exact timing of each individual cycle. Since this method doesn't necessarily mean 100% go out of its way to mimic the precise timing and execution of each cycle, it may not be able to handle all hardware edge cases.:An example of a cycle-based emulator is jgnes with its cycle-based emulation of the Ricoh 2A03 and PPU. ====Full cycle-accuracy====This aims to mimic every aspect of the CPU's timing and behavior, including internal operations and interactions with other components like memory and I/O devices. This demands the highest processing power for emulation among the cycle level accuracysubsets. Only if :[https://old.reddit.com/r/emulation/comments/vy8cg7/ares_v129_has_been_released_crossplatform/ig4da06/ Examples of fully cycle-accurate emulators: higan and ares]. ===Subcycle accuracy===The heartbeat of an IC is its clock signal; a full cycle of the emulator clock signal involves two transitions: from low to high and then back from high to low. Therefore, even a chip that is implemented perfectly fully synchronized to its clock may not be emulated accurately if it is emulated with only cycle precision as it perfect'll have to bundle together both its rising and falling actions. An  The [[wikipedia:Zilog_Z80|Z80]] processor offers an example of this: almost all inputs are sampled on a rising clock, but the WAIT signal is sampled on a falling clock. E.g. in a standard three-clock-cycle memory access machine cycle accurate the WAIT line is sampled on the final falling clock — 0.5 cycles before the end of the machine cycle. If the Z80 is required to wait, it will sample the WAIT line again at cycle intervals until it spots that it is no longer asserted and complete 0.5 cycles after that. Therefore, an emulator that only cycles accurately will have to sample it either 0.5 cycles early or 0.5 cycles late and will stop waiting either 0.5 cycles early or 0.5 cycles late, causing a phase error with whatever it was sampling. Worse than that, as the Z80 tests WAIT only once every machine cycle, not every clock cycle, missing it as a result of sampling at the wrong time can cause a net error of four or more cycles. Using the broad brush of cycle accuracy can also cause problems in machines with multiple clock signals — component A being perfect accurate only to the complete clock cycle can leave it as observably inaccurate if component B is [[Higan]] running with a quicker clock. A simple example of this can be found in the ROM Hack "Mario and Luigi: Kola Kingdom QuestBBC Micro," where on real hardwarethe 6522 timer chips run at 1Mhz while the CPU runs at 2Mhz. 6522s generate an interrupt half a cycle after they underflow. Therefore, if the level title text has graphical glitches whereas those glitches do not exist 6522s in a BBC Micro are emulated only in whole-cycle steps, they will observably trigger interrupts a cycle late from the point of view of the CPU. In practice, this can cause some copy protection mechanisms to fail. Impinging upon chip accuracy, some chips, such as the Commodore 64's [[Higanwikipedia:MOS_Technology_SID|SID]]are part digital and part analog. The analog part can be emulated in a discrete fashion, but it is often desirable to take those discrete steps at a multiple of the clock rate. However, the difference is usually not observable to other components in the emulated machine so although this is subcycle accuracy as some part of the state of the chip is known as a precision of greater than one cycle, it doesn't tend to affect the design of the emulator as a whole.
Example of a subcycle accurate emulator is BeesNES. ===Chip Gate-level accuracy===Chip accurate emulation works by simulating each logic chip Gate-level accuracy focuses on operating at the board individuallylevel of logical gates within a digital circuit. Not only does In this take approach, the focus is to replicate the behavior of the system by emulating the interactions and operations of logic gates. This level of abstraction allows for a tremendous amount more efficient imitation of processing power or specialized hardware to run (digital circuits, as in, even emulating something from it does not delve into the 1970s on intricacies of individual transistors. This level of system emulation is suitable for scenarios where a chip accurate level would need Dolphinhigher-level system requirements to run understanding of circuit behavior is sufficient. This method of hardware imitation should not be recommended for general purposes (for example, casual gaming), because of its rather poor performance as a result of the emulator mimicking the desired machine at a good speed)very low level, and as such, but they also require a incredible amount requires loads of effort computational power to makefunction. This  Examples of gate-level emulators are Breaknes and GateBoy. ===Transistor-level accuracy===Transistor-level accuracy represents a more granular emulation accuracy method is almost uselesslevel that delves into the behavior of individual transistors within a digital circuit. Although it is This approach aims to replicate the only way to achieve true 100% hardware simulationelectrical characteristics and interactions of transistors, cycle accurate emulation can already achieve offering a higher degree of accuracy which is virtually indistinguishable from at the real hardwarecost of increased computational complexity, aside from a very limited amount way more than that of edge casesgate-level accuracy. In addition, cycle-This method is the most accurate emulators have much lower system requirements representation of the electrical characteristics and programming difficulty. Currentlyinteractions within a machine's circuit, but due to its extremely demanding nature, the it should not be recommended for most people looking to play their childhood video games not only chip accurate emulators that are usable run on Field Programmable Gate Arraysbecause of its abysmal performance, or FPGAs, which are essentially custom programmable chipsbut also because it requires way too much computational power to execute. Machines dedicated to this This type of hardware emulation exist, such as is great for hardware enthusiasts and homebrew developers who want to get a deep understanding of the functionality and behavior of the WIP Zimba 3000 by kevtrishardware in question at a very detailed level. Other examples  Examples of chip accurate emulation can be found in flash carts such as the SD2SNES, where various addtransistor-on chips level emulators are emulated on the included FPGAMetalNES and Visualnes.
===DICE===
This emulator needs type is unique in that its own section on accuracymethod, because its accuracy method is unique. [http://sourceforge.net/projects/dice/ [DICE] ], emulates arcade machines from the early 1970s. The architecture of these systems is different from a modern architecture, mostly because they don't have a CPU. DICE emulates the discrete logic components of the machines at a circuit level. Although and, although the results are accurate the , you need a fast 64-bit PC to run these arcade games at full speed. It's not as deep as chip-level emulation for other systems because chips are still treated as black boxes, though. ==Perfection?==While it may be theoretically possible to have a 100% perfect emulator, that feat is very rare (if not nearly impossible), even for some highly regarded emulators such as [[higan]] or kevtris's work on the various FPGA-based consoles by Analogue. Just because an emulator claims to be "cycle accurate" or "100% compatible" does not mean that said emulator is flawless. This even includes situations in which all emulator accuracy tests (i.e. [[PS1 Tests]]) are passed, as these tests cannot cover every single edge case, and some of these tests may even fail on real hardware, leading to even more confusion. Some things are nearly impossible to perfectly emulate, such as some of the illegal opcodes of the [[wikipedia:MOS_Technology_6502|6502]], where the results are completely unpredictable on hardware, and different hardware revisions have different results and different illegal opcodes. The closest one could get to writing a perfect emulator would be if someone were to exactly copy an original ASIC map or a decap onto an FPGA, and even then, that isn't always a magic bullet. While any given emulator may not be perfect, that does not mean that the emulator is bad by any means. Writing an accurate emulator is extremely hard work, and while perfection may be nearly impossible at the moment, that doesn't mean that games can't be enjoyed. Work on archival via emulation has come a very long way since the emulators of the 1990s, and things are only getting better from here, with excellent emulators such as the previously mentioned [[higan]] and kevtris's [[FPGA]] cores being available to use right now. In other words, "good enough" goes a long way.
==Controversy==
There are The accuracy debate has very clearly split into two sides when . The ones that don't favor accuracy argue that emulators do not need to be as accurate as possible if it comes can play all the games they need. And because these games tend to be the most recognized alongside the issue of accuracyconsole, there shouldn't really be an interest in making more games work since those do. One side argues A more compelling point is that as long as an emulator plays the majority of games at full speed on most computers and devices without too many obvious glitches, it does not doesn't matter how accurately it actually replicates the original hardware and its many quirks and functions. The faithfulness of the emulator to the console it is 's emulating comes second to its overall ability to play games.  The other side argues ones that favor accuracy explain their view in that when playing a game with inaccurate emulation the experience may sometimes be quite different to the real thing, particularly with games focused on split-second reactions. There is also an emulator entirely different reason: archival. Emulator projects should ultimately strive to simulate recreate the hardware as much as possible, as ; that is 's the only way for it to achieve as much compatibility as possiblebe compatible, as well as and that's the only way to preserve the hardware. Thus, speed Speed and scalability to most devices is a lower priority to accuracy to the real console, both for purposes of compatibility and preservation.
Even within the second side, however, there is some disagreement as to just how much accuracy is actually needed. On most platforms, after obtaining a certain amount of accuracy, going further requires an exponential growth in system requirements, the results of which may not be noticeable to the vast majority of users. Cycle accuracy , in particular , has been hotly debated in regards regard to its usefulness, due to how such an extreme level of accuracy requires a lot of extra processing power for relatively few gains in compatibility.
Simply put, it's a disagreement between wanting 'good enough' or perfection no matter , 'good for all cases', and 'good for the costfuture'.
==Console revisions==
Many consoles have different internal hardware revisions which degrade accuracy or change the consoles' behavior in another way, such as the SNES 1CHIP (various games have minor issues, such as a small mess of pixels at the top of the screen in games such as Super Ghouls 'n Ghosts or Demon's Crest), Genesis Model 3 (fixed a bug that some games such as Gargoyles used), various Commodore 64 revisions (fixed a useful bug that allowed for smooth horizontal scrolling), or PS2 SCPH-750XX (less compatibility with some PS2 games and PS1 games). These specific consoles are not generally emulated in their respective emulators, and those emulator developers tend to focus only on one revision. An exception to this is [[VICE]], which tries to emulate as many different revisions of the Commodore 64 as possible and as accurately as possible.
==Further reading==
*[http://arstechnica.com/gaming/2011/08/accuracy-takes-power-one-mans-3ghz-quest-to-build-a-perfect-snes-emulator/Accuracy takes power: one man’s 3GHz quest to build a perfect SNES emulator] - Byuu (now known as Near) ([[higan]] developer), 2011*[https://www.youtube.com/watch?v=oQZMVo_Fmrs Pokémon glitches and emulation accuracy] - TheZZAZZGlitch
===Accuracy Tests===*[[http:PS1 Tests]]*[[GB//tasvideos.org/EmulatorResources/NESAccuracyTests.html NES Accuracy C Tests]]*[[GBA Tests]]
===TASVideos===*[http://tasvideos.org/EmulatorResources/NESAccuracyTests.html NES Accuracy Tests]*[http://tasvideos.org/EmulatorResources/GBAccuracyTests.html Game Boy Accuracy Tests]*[http://tasvideos.org/EmulatorResources/SNESAccuracyTests.html SNES Accuracy Tests][[Category:FAQs]]
===Projects===*[httphttps://tasvideosgithub.orgcom/aappleby/MetroBoy GateBoy]*[https:/EmulatorResources/SNESAccuracyTestsgithub.html SNES Accuracy Testscom/iaddis/metalnes MetalNES]*[[Categoryhttps:FAQs]//sourceforge.net/projects/dice/files/DICE/ DICE]
11,257
edits

Navigation menu