Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Where can I find newbie resources (books, or anything) to write NES (and potentially SEGA and SNES) emulator?

I wouldn't mind if I have to learn from zero (OS, hardware, etc). I think I might have found a side project that I can be passionate about!

UPDATE: Thanks for the replies. I'm having hard time to follow those links since I don't even know where to start. Is there another tutorial that can explain the fundamental of "emulator" first before the NES part kicks in?

PS: I'm planning to use Java for this side-project.



The usual place to start to start an emulator is the CHIP-8 (https://en.wikipedia.org/wiki/CHIP-8), because it's a very easy platform that don't have a lot of the "complicated" stuff that's in more complex hardware.

The overall logic is very simple (read a program into ram, read an opcode from the starting location, do whatever that opcode is supposed to do, go to the next opcode... rinse and repeat) and you can find tons of tutorial online (I liked this one: http://www.multigesture.net/articles/how-to-write-an-emulato...)

It should set your mind on the fact that writing a simple emulator is just doing a fetch/decode/execute (https://en.wikipedia.org/wiki/Instruction_cycle) on some code.

For the documentation, I've found that EmuTalk (www.emutalk.net/forums/30-Emulator-Programming) has tons of interesting links.


Thank you very much!!!!


You can read the source to existing projects (bsnes, SNES9X, gambatte etc.) The Gameboy would probably be the simplest hardware to work on.

> PS: I'm planning to use Java for this side-project.

Emulators typically use repetitive code, less than int-sized math, 2d arrays and pointer manipulation. Java is not good at dealing with any of those, so you might want to find a more fun language. Then again, one thing at a time.


Exactly, one thing at a time. Once I get a good grasp and managed to deliver a working emulator, then I can start thinking about improving/optimize or even port it to another language.

Right now I'm just trying to figure out the basic fundamental concept of "emulation" (what is it, what does it take, how can I write a simple one :)).


I just don't want you to get RSI!


While not NES, one of my students at General Assembly made a Chip-8 emulator/interpreter in JavaScript for their final project.

Chip-8 has 30-something instructions and is relatively simple to implement, and test driving it is pretty easy too. I thought it was a really wonderful first emulation exercise.

http://en.wikipedia.org/wiki/CHIP-8


http://nesdev.com/

Is a fantastic resource. They are helpful and have lots of docs.


Zophar's would be a good place to start

http://www.zophar.net/utilities/nesdev.html


>Is there another tutorial that can explain the fundamental of "emulator" first before the NES part kicks in?

>PS: I'm planning to use Java for this side-project.

One place to start might be to try and write an emulator for the DCPU-16. It's a simple made-up computer that Notch (creator of Minecraft) designed for the game 0x10c.

Although the game was never finished, many people wrote emulators based on the DCPU's specifications[1]; search Github for "DCPU Java" to see several examples in that language.

[1] https://raw.githubusercontent.com/gatesphere/demi-16/master/...


Hah! That's my repo!

Also, the only emulator for anything written in Io, as far as I know :p

Not that it was good, mind you. But I do highly recommend DCPU-16 as an emulation launching point. It's a really easy to understand system :)


Thanks a lot for pointing me at this. While NES is the goal, I definitely need to take baby steps first!


This PDF gives a good high level overview of the NES: http://nesdev.com/NESDoc.pdf


Thanks a lot! I really appreciate this!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: