86

Speaking from my personal experience of writing a PET emulator, a C64 emulator and a Sinclair Spectrum emulator,, here are the issues I had: Getting the Speed Right It's no good just making a processor go as fast as it can because, frequently, application code depends on timing. For old 8-bit machines, it's easy to write an emulator that runs at many times ...


74

Note: This answer mainly focuses on the NES, since that's what I'm most familiar with. Yes; this is called static recompilation or static binary translation, and it is theoretically possible -- jamulator by Andrew Kelly does it. However, recompilation can be incredibly difficult (to the point that falling back to interpretation at runtime may be required ...


43

There are several aspects to consider to answer your question. The x86 architecture is backwards-compatible with the first CPU of the line, the 8086 (and its sibling, the 8088). What this means is that, when a modern Intel (or AMD) processor boots up, it starts in a mode which is compatible with the 8086 — if the motherboard's BIOS support is good enough, ...


42

The 6502 CPU is just one piece of the puzzle Emulators emulate entire machines, not merely CPUs. Even the likes of QEMU emulate an entire generic computer. It helps if you think of the Apple II and NES not as singular units but as networks of components. The CPU, graphics unit, RAM and so on all have communications to each other and do so at a very fast ...


37

The way I understand it, ROMs are like virtual games, Not really. ROMs are a piece of hardware storing a bit image. Like a disk, a tape or a punch card. It holds an image of the game's software. and emulators are like virtual game consoles, or handhelds. Basically yes. What I don't understand is how there are ROMs for arcade games, which don't have ...


37

I'm putting CHIP-8 forward. This system is essentially a virtual machine developed for some reason. There are games written for the CHIP-8. It has a few opcodes, a stack, a couple of timers, and a low resolution bitmapped display, but it's simple enough that the first few emulators fit in a few kilobytes on early 8-bit computers. There are more than a few ...


34

There was x86 emulation on Windows NT, on MIPS, Alpha, and PowerPC — in fact, more than x86 emulation, PC emulation. The Alpha release of Windows NT was quite famous at the time for using a binary translator rather than a “plain” emulator, FX!32; it would run x86 programs, keeping track of which parts of the binaries were actually used, and then translate ...


31

The nicest DOS emulator for macOS is Boxer, which is a macOS-specific version of DOSBox. Not only is it free, it's free software (or open source if you prefer); its source code is available and freely modifiable. There is currently no “official” 64-bit build, which means the distributed application won’t work on the latest versions of macOS, but there are 64-...


31

The Nintendo 64 ROM is only 2KB in size and apparently easy to emulate. It seems to only check the validity of the inserted cartridge's ROM and set up a limited environment. Nintendo 64 cartridges are self-sufficient; they don't need any services provided by a common “BIOS”. In fact they even contain the code used to drive the audio and graphics co-...


31

Note of course that I'm not a lawyer, this is not legal advice etc. The laws that apply here are "intellectual property" laws: copyright, patent law and perhaps trademark law. Emulators themselves aren't a gray area; some companies have tried to make them perceived as such. If you can write an emulator without violating anyone's copyright, then you're OK; ...


31

There are many answers to this and none might satisfy you. First of all, an Emulator doesn't just do a CPU, but a machine. The same way you can't run an NES game on an Apple II. So while one may do multiple ones, different can do the hob as well. Furthermore, there are different target platforms. Linux isn't Windows which again isn't MacOS and so on. Like ...


31

The best description of this problem that I've seen was written by Byuu, one of the developers of the bsnes emulator. That's about as authoritative as they come, but I'll try to summarize it here. Modern software development is a completely different world than retro consoles. There were no reusable game engines or manufacturer-provided APIs. Everything ...


29

It's not possible. VirtualBox only supports emulating IBM-compatible x86 and x86-64 systems. The Commodore 64 uses a 6510 CPU and a wildly different architecture. In order to run Commodore 64 software, you need a dedicated C64 emulator such as VICE.


28

The 8086 is source-code compatible with the 8080 (the other way around is not true). This means that most assembly code written for the 8080 can be assembled so that 8086 instructions are emitted. The only exceptions would be self-modifying code or code that relies on interrupts, which are handled differently on both processors. In fact, some assemblers, ...


27

The first change is to patch this code: 00fc0196 266E003E movea.l $3e(a6), a3 00fc019a B7FC00080000 cmpa.l #$80000, a3 00fc01a0 622C bhi.s $fc01ce.l 00fc01a2 B7FC00040000 cmpa.l #$40000, a3 00fc01a8 6524 bcs....


27

The CD media for OSR (OEM Service Releases) are generally all the same; there is no unique code on the disc. Imagine what a problem this would be for commercial users with multiple machines to support - they wouldn't want to archive multiple copies of the media. Making the key unique to the disk doesn't add any protection if the disc image is easily ...


24

You'll need to manipulate the memory address 0xFF02, and shift the data (MSB first) into 0xFF01, as stated below. If there is no cable - ergo, no gameboy connected - then 0xFF is received, in 0xFF01. From Serial Data Transfer (Link Cable) Communication between two Gameboys happens one byte at a time. One Gameboy acts as the master, uses its internal ...


23

CDs are made by pressing, having a new master made is expensive so the content of the disk would rarely be changed, certainly not for a single copy. Yes there are recordable CDs now but they were not common at the time windows 95 was released, cost more in bulk than pressing and generally have worse longevity. Even for media that is not pressed making a ...


23

C:\msdos\DISKS\144UPG1.IMG C:\msdos\DISKS\144UPG2.IMG C:\msdos\DISKS\144UPG3.IMG From your listing, I believe these are 1.44 MB images of the installation floppies. In that case, installation is simple: Create the virtual machine you intend to install MS-DOS on. In the "Settings" dialog for the VM, select the "Storage" tab. Click on the "Empty" line ...


23

As cbmeeks said, you're much better off with a FPGA or CPLD. It's going to be nearly impossible to emulate an NES ROM with a microcontroller. A Raspberry Pi would be fast enough, but not with an operating system. It's possible to run code directly on a Raspberry Pi without an OS, like a microcontroller. You don't even need to worry about cycle timing to ...


22

For an emulator to be "cycle accurate" means the interactions between the components are timed accurately enough so that the emulation behaves the same way as the original machine for any given input. I mean "input" in the general sense -- both external inputs such as keyboards, joysticks, buttons, etc. and the program (or programs) being run, the data ...


22

Almost all computer systems have multiple different devices operating in parallel. For example, the CPU is typically running parallel to the video generation hardware. This can be very difficult to emulate accurately, as interactions between different devices require that the emulation of each device proceeds in sync with the rest. Each device may be ...


21

Preface As Stephen rightly points out in his comment, SheepShaver only emulates PowerPC, and so it is not a valid suggestion for your 68K-based question. From SheepShaver's home page However, you still need a copy of MacOS and a PowerMac ROM image to use SheepShaver. If you attempt to use a 68K based ROM, with SheepShaver, then you should get the error:...


21

There are a number of ways to use Multics today. One option is to run it locally under an emulator. The source code that's available should run (under emulation) on most Linux systems, Mac OS X, and Windows, even the RasPi. See the Multicians site for details (a cookbook is available). Another option is to telnet (or ssh) to a public access system. I don'...


21

PCem aims to be an accurate emulator, and its 8086/8088 timings are accurate. It can emulate a wide variety of hardware, and can model specific PCs with their ROMs (such as the original IBM PC, the Amstrad 1640, and many others). It is available for Linux and Windows. Its 8086 emulation is implemented in src/808x.c — you can see there that it keeps track of ...


20

I wrote my first emulators somewhere in the mid-to-late '90s, my first cycle-accurate emulator circa 2000 and have managed to outdo even that, writing a clock-sign-transition-accurate emulator — accurate to the half-cycle. Two problems usually recur: each component's proper implementation may be not only obtuse but possibly unknown; and ensuring that the ...


20

The other answers already covered a lot, but there is something else that is important but which hasn't already been addressed in detail: Despite appearances to the contrary, arcade machines are quite frequently not built with unique hardware. For example, the hardware originally designed for Galaga was used for several additional games, including well ...


19

A few 16-bit processors can run 8-bit code: the NEC V20 series. The V20 and V30 are the ones you might encounter in a PC. The V20 is a pin-compatible substitute for the 8088, and the V30 for the 8086. These processors have a BRKEM instruction (in Intel's notation it would most likely be 'INTEM') which switches to the 8080 instruction set and jumps to an ...


19

I'm the author of an emulator of a whole bunch of platforms, so I'm going to go ahead and commit a heresy: accurate emulation of old systems isn't a difficult task. It's just an expensive one. It's expensive in terms of processing. Which means that a lot of the more historical emulators make conscious approximations in order to hit their performance budgets....


18

You can, provided that you have a cartridge reader that you can plug to the computer that runs the emulator. One such reader is Retrode; if you google "nes cartridge reader" you will find references to more similar products, even DIY kits.


Only top voted, non community-wiki answers of a minimum length are eligible