How does emulator work
You can emulate consoles without vastly superior hardware, which is a massive boon. You need to download the game files which are contained in files called ROMs. Yet this is pretty much hypothetical. If you want to run an emulator, which ones should you use? The NES is one of the most influential consoles of all time. It was where legendary characters like Mario, Link, and more made their debuts or hit their potential.
However, it does have some nice additional tools that you can use if you want to get technical, such as debugging software. If you really want to get technical with your emulation, then Mesen is an awesome choice. This software supports some arcane features like overclocking the emulated hardware, rewinding gameplay, and video filters. MAME is a really good choice if you want accurate emulation.
Higan is another fantastic choice for the Master System but is not quite as accurate when it comes to emulation. While the NES and the Master System provided the jump-off for classic franchises, the bit era provided better graphics and more potential. For our money, the best Genesis emulator out there is Kega Fusion. Not only does this awesome bit of software let you emulate the Genesis, but it also lets you emulate the Game Gear and Sega CD too. Using it is simple: install it, grab a ROM, and get ready to rock!
What about the SNES, then? Higan, the emulator that we mentioned earlier, works terrifically for emulating SNES games too! When it comes to Nintendo 64 emulators, the cream of the crop is Project This community-made emulator crowdsources bugfixes which means it runs pretty perfectly. It also supports save states and graphical mods too, if you want to give classic games a lick of modern paint. There is a load of great emulators for these generations but here are the best ones.
The other side to processor emulation is the way in which you interact with hardware. This really has two sides:. Certain platforms -- especially older consoles like the NES, SNES, etc -- require your emulator to have strict timing to be completely compatible.
Interrupts are the primary mechanism that the CPU communicates with hardware. Generally, your hardware components will tell the CPU what interrupts it cares about. This is pretty straightforward -- when your code throws a given interrupt, you look at the interrupt handler table and call the proper callback.
Take the case of a hard-drive. This part is generally very straightforward. The actual interface of the device is a bit more complex. This is generally some combination of memory mapped registers e. For a hard-drive, you may have a memory mapped area where you place read commands, writes, etc, then read this data back. I'd go into more detail, but there are a million ways you can go with it.
If you have any specific questions here, feel free to ask and I'll add the info. I think I've given a pretty good intro here, but there are a ton of additional areas. I'm more than happy to help with any questions; I've been very vague in most of this simply due to the immense complexity. It's been well over a year since this answer was submitted and with all the attention it's been getting, I figured it's time to update some things.
Perhaps the most exciting thing in emulation right now is libcpu , started by the aforementioned Michael Steil. It's got huge potential, and I think it'll do great things for emulation. I haven't spent much time there, but it looks like they have a lot of great resources. A guy named Victor Moya del Barrio wrote his thesis on this topic. A lot of good information on pages. You can download the PDF here. If you don't want to register with scribd , you can google for the PDF title, "Study of the techniques for emulation programming".
There are a couple of different sources for the PDF. Any processor typically has a well-written specification that describes states, interactions, etc.
If you did not care about performance at all, then you could easily emulate most older processors using very elegant object oriented programs. For example, an X86 processor would need something to maintain the state of registers easy , something to maintain the state of memory easy , and something that would take each incoming command and apply it to the current state of the machine. If you really wanted accuracy, you would also emulate memory translations, caching, etc.
In fact, many microchip and CPU manufacturers test programs against an emulator of the chip and then against the chip itself, which helps them find out if there are issues in the specifications of the chip, or in the actual implementation of the chip in hardware. For example, it is possible to write a chip specification that would result in deadlocks, and when a deadline occurs in the hardware it's important to see if it could be reproduced in the specification since that indicates a greater problem than something in the chip implementation.
Of course, emulators for video games usually care about performance so they don't use naive implementations, and they also include code that interfaces with the host system's OS, for example to use drawing and sound. In fact, it's even more amazing that you could just download a set of every SNES game ever or any Atari game ever, considering that when these systems were popular having free access to every cartridge would have been a dream come true.
I know that this question is a bit old, but I would like to add something to the discussion. Most of the answers here center around emulators interpreting the machine instructions of the systems they emulate.
UltraHLE, one of the most famous emulators ever created, emulated commercial Nintendo 64 games with decent performance on home computers at a time when it was widely considered impossible to do so. For the first time, I saw articles about emulators in print magazines where before, I had only seen them discussed on the web. The concept of UltraHLE was to make possible the impossible by emulating C library calls instead of machine level calls.
Something worth taking a look at is Imran Nazar's attempt at writing a Gameboy emulator in JavaScript. Practically speaking, you're generally looking to write for speed and fidelity of emulation. This is because software on the target system will may run more slowly than the original hardware on the source system. That may constrain the choice of programming language, compilers, target system etc.
Further to that you have to circumscribe what you're prepared to emulate, for example its not necessary to emulate the voltage state of transistors in a microprocessor, but its probably necessary to emulate the state of the register set of the microprocessor.
Generally speaking the smaller the level of detail of emulation, the more fidelity you'll get to the original system. Finally, information for older systems may be incomplete or non-existent. So getting hold of original equipment is essential, or at least prising apart another good emulator that someone else has written!
Yes, you have to interpret the whole binary machine code mess "by hand". Not only that, most of the time you also have to simulate some exotic hardware that doesn't have an equivalent on the target machine.
The simple approach is to interpret the instructions one-by-one. That works well, but it's slow. A faster approach is recompilation - translating the source machine code to target machine code. This is more complicated, as most instructions will not map one-to-one. Instead you will have to make elaborate work-arounds that involve additional code. But in the end it's much faster. Read on and you'll find out how amazing emulation really is.
PlayStation games don't work on your Windows system because those games are not designed to run on a normal computer. PlayStation devices are very specific in their physical makeup, containing unique hardware that Windowsor any other computer operating systemdoesn't know how to use. That's why you need an emulator. Emulation software aims to run a program designed for one kind of system on another system.
The programs that make this happen are known as emulators. While the details and inner workings vary between emulators, in the end, they attempt to achieve the same outcome: to make software run on different hardware. Emulators work hard to get a foreign program running. In short, an emulator is a piece of software that "acts" like a piece of hardware.
In most cases, this means simulating all of the capabilities of a hardware component as a software component. Not only that, the hardware components that are emulated as software must perform without bugs, or else the emulator won't work properly. The difficulty in turning advanced and unique pieces of hardware into functioning software is why emulators for modern gaming consoles take a long time to develop.
It takes a lot of hard work and effort to get the emulation process working, because modern hardware, like a PlayStation 4 or an Xbox One, is exceedingly complex.
Going back to the PlayStation example, an emulator must mimic a special sound chip, graphics card, central processing unit, and so on, without even considering the emulation of peripheral components like CD drivers. The most difficult piece of hardware to emulate is usually the central processing unit CPU.
The CPU is a core component of every computer, from smartphones to video game consoles. In many ways, the CPU is the most important computer component regarding emulation, as every other component links to it directly. Not all CPUs are the same. The main way CPUs differ from each other is in their instruction sets. A CPU instruction set determines how a computer carries out the commands a program gives it.
An emulator will target a system that has a different instruction set from the host machine. Hardware abstraction is a way of hiding the intricate details of controlling hardware. Instead, it provides a set of actions that a developer commonly uses and does all the little details automatically. An example is how storage drive interfaces came about. An HLE takes advantage of hardware abstraction by figuring out what the command s are intended to do in the emulated environment, and letting the host hardware do the rest.
Java code is not actually compiled and run natively on the host machine, but instead, the host machine runs an emulator of a theoretical Java machine. NET framework also run in this fashion. This way of running an application is commonly known as just-in-time JIT compiling. Software-based emulation, however, requires intimate knowledge of the system or its parts, which may not be possible if documentation for it is scarce.
It also requires a system much more powerful than the original to run applications at the same speed. High-level emulation, on the other hand, allows a system with complex hardware to be emulated on something only a bit more powerful.
0コメント