4 ms·
> how people start with game emulators? I had some Computer Organization and Architecture classes in university, and a previously-existing burning desire to un
by khedoros1 3y ago
> how people start with game emulators?
I had some Computer Organization and Architecture classes in university, and a previously-existing burning desire to understand emulation. I decided that the NES would be a good target; it was the oldest game hardware that I had personal interest in. In 2008, I found as much info as I could about how to structure an emulator, and technical documents about the NES, and started building. I got something basic working in a couple months, and came back to it every couple of years, either to add functionality or experiment with optimizations.
> what are the basic concepts?
A CPU goes through a repeating fetch->decode->execute loop, and mostly communicates with the rest of the system over a "bus", which has some number of address lines (in the NES, 16 address lines provide access to 2^16 or 65,536 addresses), some number of data lines (in the NES, 8 lines for 8-bit values), and some number of control lines (read/write, ready, and others that vary system-to-system). Different devices are connected at different address ranges. They could be RAM, ROM, I/O hardware, etc. So when a CPU is booting, the system is usually designed to expose some ROM at the first address the CPU fetches from.
> what is the easiest hello-world game to start w/?
Chip-8, probably. Space Invaders is a good one too; simple, but using a CPU related to those in a lot of other systems, and a bit less of a toy-scale system than Chip-8.