http://www.perlmonks.org?node_id=518619


in reply to Perl ZX Spectrum Emulator

I used to think that emulators were deep voodoo. Then I tried making one (Game Boy, which is a modified z80 processor). Turns out the hardest part is getting sound to work. If you just want to get the instruction set to work, you just need a big array to represent the memory, map the data into the right spots (cartidge data gets put into a given location in memory, etc.), then start doing each opcode, which basically ammounts to doing some simple operation (add two numbers together and store the result in register ax, etc.).

All the data you need for this is available to the public with a few moments of quality time with Google. The Game Boy is a simple platform, so it's a good place to start. It'll give you an idea of how CPUs work, and it's probably not as hard as you think.

"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.