Possible Duplicate:
How do emulators work and how are they written?
I'd like to try writing a basic gameboy emulator, or maybe even NES. I know the basics of C and I'm fairly good at Java, so I know the necessary basics of programming. What I don't know though, is how people process all the data into a C program and create an emulator out of it. I know I should learn from source, but it's kind of hard to see a bunch of lines of code without knowing why they're there and what they're supposed to do. Where am I supposed to start if I wanted to learn how to write such an emulator?
I've searched the internet, but I've only found unclear tutorials that contain too many errors to figure out by myself. Where am I supposed to start?