system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5:How are emulators written?

I only have very basic programming knowledge (like CS101-level) and I can't imagine how someone reverse-engineers a console like that. I heard they use programmer manuals sometimes? But I'm not sure about that.
gpt
The entirety of an emulator all at once is overwhelming for anyone.

You write an emulator via divide-and-conquer: you do lots of small bits, and slowly link them together.

The initial way you get the information is through leaked programmer manuals, official instruction set manuals for given processors, and through pain-staking reverse engineering. For instance, if you want to know how the overflow flag is set, but it's not documented, you perform every possible add operation, log the flag results of each, analyze the output and manipulate your own code until you can match your logged data. You do this through lots and lots of educated guesses. The better your deductive reasoning skills, the better you'll be at writing an emulator. Electrical engineering skills really help out for the earliest reverse-engineering efforts in helping you to run code on the hardware and get some initial analysis work done.

After a system is well emulated, you can use the source and debuggers from other emulators. But you're really just emulating an emulator at that point. It's fine if you want to do that, of course.

The biggest requirement for writing your first emulator is being willing to spend potentially a few months staring at a blank video output screen. Your only indication of it being alive will be your CPU debugger printing out hundreds of megabytes of text as you step through instructions.

Once you have some games running, you then spend the next ten or so years analyzing and fixing bugs, only to cause more bugs in the process. So it's a nice, decade-long game of whack-a-mole.