Put an old console cartridge or ROM on a modern computer and nothing happens. The game speaks the processor language of its original console. It expects memory and graphics hardware at particular addresses. It waits for a controller and assumes the screen is drawn at a precise rhythm.
The emulator is the missing console. The ROM is still the game; save states, controller mappings and visual filters are useful layers built around it.
Follow one frame
Six steps happen before you see a sprite move.
- ReadFetch the next guest CPU instruction.
- UnderstandDecode what that instruction means.
- ExecutePerform equivalent work on the host CPU.
- DrawTurn video-chip state into modern pixels.
- MixRecreate the sound hardware’s output.
- SynchronizeKeep every component in the expected order.
The CPU: interpreter or translator?
An interpreter handles one guest instruction at a time. It is straightforward and useful for debugging, but repeated decode work can be slow. A dynamic recompiler translates a block into host instructions and caches it. Future visits reuse the translation.
The difficult cases are self-modifying code, exceptions and exact timing. Faster does not automatically mean more accurate.
The picture is not a video file.
Older games write numbers into video memory and chip registers. Those values describe sprites, tiles, palettes and scanlines. The emulator models the chip and converts its output into a texture a current GPU can display.
A missing ordering rule can cause flicker or invisible objects even when the emulated CPU produced the correct values.
Timing is part of the hardware.
Software may wait for a scanline, race a sound channel or rely on how long memory access takes. Cycle-aware emulation spends more work preserving those relationships. That is why an old, apparently simple console can still be difficult to emulate perfectly.
Words used on this page
A five-term pocket glossary
- Instruction
- One operation in a processor’s machine language.
- Register
- A small, fast storage location inside a processor or device.
- Memory map
- The addresses assigned to memory and hardware controls.
- Scanline
- One horizontal line generated while a display frame is built.
- Guest / host
- The recreated machine is the guest; the real computer running it is the host.
The bridge to VMBook
QEMU applies the same idea to an entire computer.
A general computer adds firmware, disks, storage controllers, network cards and many possible operating systems. QEMU can emulate those parts. If host and guest share a processor architecture—and firmware, permissions and the virtualization backend allow it—WHPX or KVM can let most ordinary guest instructions execute directly. Configured sensitive events still exit to the hypervisor, while devices require virtualization or emulation.
Five questions you can now ask of any emulator
- Can the host CPU execute the guest’s instruction language?
- Which original devices must be recreated?
- Does exact timing affect correct behavior?
- How are input, graphics and sound translated?
- Which state belongs to the guest, and which belongs to the emulator?
This primer explains emulation technology. VMBook does not provide game ROMs or console-support services; use software and firmware only when you have the right to do so.