Writing an arcade game emulator is an awesome learning project, and this tutorial will take you through the entire process in a very detailed way. Want to really learn how a CPU works? Writing an emulator is the best way to learn about it.
You'll need a working knowledge of C, and a knowledge of assembly language might be helpful. If you don't know assembly, writing an emulator is a great way to become knowlegeable about it. You will also need to be comfortable with hexadecimal math (also known as base 16, or simply "hex"). I will give an introduction to this topic as well.
I have chosen to emulate Space Invaders which uses the 8080 processor. Since this game and processor are so popular, there is a lot of information about them widely available on the internet. You'll need it to complete the project.
All the source code for this tutorial is available on github. If you aren't comfortable using git, there is a "Download ZIP" button on the github page that will download an archive of all the code.
Introduction to Binary and Hex
Introduction to Assembly Language
developing on the command line
Displays - more than you ever wanted to know
Making the emulator play for Mac OS X 10.11 El Capitan and XCode 7.
Cocoa Port pt 1 - Setting up the project
Cocoa Port pt 2 - Machine object
Cocoa Port pt 3 - InvadersView
Adopting the emulator for play on iPhone/iOS 9.
iPhone Port pt 1 - Project Setup
iPhone Port pt 2 - Machine Object
iPhone Port pt 3 - ViewController.m
Xcode built-in debugging tools
iPhone Port pt 4 - Touch Handling
Cocoa Port pt 1 - Project Setup
Cocoa Port pt 2 - Machine Object
Post questions or comments on Twitter @realemulator101, or if you find issues in the code, file them on the github repository.