News for hackers. Stuff that matters.
Re:Nes emulator written in go by hello_moto on Monday March 23, 2015 @02:16AM (#9249692)
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.

Re:Nes emulator written in go by Spittie on Monday March 23, 2015 @08:30AM (#9250496)
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.

Re:Nes emulator written in go by hello_moto on Monday March 23, 2015 @02:29PM (#9252563)
Thank you very much!!!!
Re:Nes emulator written in go by astrange on Monday March 23, 2015 @03:06AM (#9249771)
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.

Re:Nes emulator written in go by hello_moto on Monday March 23, 2015 @03:14AM (#9249783)
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 :)).

Re:Nes emulator written in go by astrange on Monday March 23, 2015 @03:30AM (#9249815)
I just don't want you to get RSI!
Re:Nes emulator written in go by tibbon on Monday March 23, 2015 @09:51AM (#9250842)
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

Re:Nes emulator written in go by mjibson on Monday March 23, 2015 @02:35AM (#9249728)
http://nesdev.com/

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

Re:Nes emulator written in go by benbruscella on Monday March 23, 2015 @02:37AM (#9249731)
Zophar's would be a good place to start

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

Re:Nes emulator written in go by edmccard on Monday March 23, 2015 @07:41AM (#9250370)
>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/...

Re:Nes emulator written in go by gatesphere on Monday March 23, 2015 @12:39PM (#9251772)
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 :)

Re:Nes emulator written in go by hello_moto on Monday March 23, 2015 @02:30PM (#9252569)
Thanks a lot for pointing me at this. While NES is the goal, I definitely need to take baby steps first!
Re:Nes emulator written in go by fogleman on Monday March 23, 2015 @10:47AM (#9251197)
This PDF gives a good high level overview of the NES: http://nesdev.com/NESDoc.pdf
Re:Nes emulator written in go by hello_moto on Monday March 23, 2015 @02:29PM (#9252565)
Thanks a lot! I really appreciate this!