i've tried finding stuff on the internet but i can't seem to find anything. I may have overlooked something, but if anyone would point me to a simple tutorial or help me personally i would appreciate it.
(i've done very simple programming in c and c++, but nothing deep)
i know alot about a computer but not much about programming.
thanks, guys.
Have you programmed a video game before?
If you're making an emulator, you will learn the assembly language of the processor you're emulating. Then you will simulate that processor.
You also need to be capable of basic functions on your platform like drawing images to the screen, getting input, and Vsync type functions. Making a simple game like pong would be something to do before attempting an emulator although I would say if you have never made a game before then making an emulator is biting off more than you can chew. While it doesn't have to be making a game, it most easily sums up alot of the skills you would need in making an emulator.
I Googled 'writing a NES emulator', the first result is more than enough to get you started:
http://www.cecs.csulb.edu/~hill/cecs497 ... howto.html
For all people new to emulation, this is a great blog. I wouldnt advise that you start of with a Nes emulator, it's gonna be a very tough challenge, maybe start with a Chip8 emu.
Here's the blog
http://www.codeslinger.co.uk/pages/projects/chip8.html
- The first thing is about the emulator style: will it be scanline-based? Cycle-by-cycle based? That's your first question.
- Next, about the CPU, how often will you run it? Per instruction? Per given number of cycles (to be used in scanline-based PPUs)?
- Next, the doc about the CPU opcodes/instructions step-by-step. Try to create an abstract layer, like a .h file within all the opcodes and operations, flags and labels. Provide PRG access, perhaps hooking functions inside a big CPU context structure.
- The finale is your PPU emulator; otherwise, you rely on CPU logs. It's interesting here to compare your CPU emulation output with another accurate emulator that provides such thing.
I disagree aphex. My first emulator was for NES. I could have done Chip 8 or Gameboy or some arcade game I suppose, but the NES was the system I liked and had all my favorite games.
While emulating the NES reasonably accurately to support most games is alot to ask for a beginner, you have to remember it doesn't take much accuracy to get alot of games to run so a beginner shouldn't be discouraged from starting with NES. Infact I think the NES is an excellent platform to start with.
MottZilla wrote:
I disagree aphex. My first emulator was for NES. I could have done Chip 8 or Gameboy or some arcade game I suppose, but the NES was the system I liked and had all my favorite games.
While emulating the NES reasonably accurately to support most games is alot to ask for a beginner, you have to remember it doesn't take much accuracy to get alot of games to run so a beginner shouldn't be discouraged from starting with NES. Infact I think the NES is an excellent platform to start with.
Well I guess it's more of a personal thing, depending on how much you know about emulation thoery in general. I personaly find emulation most challenging because of the amount of work it takes to get any sort of working output (for me anyway), so starting basic helped me build confidence in that sense
For simplicities sake, I think that people should start where they feel comfortable, for me, that was the Chip8 and I have heard others with the same ideology, so I think it might be a good path to take.
Yeah I would recommend chip8, very little work to do, I think I wrote a chip8 emu in around 2 hours with the opcode and graphics. Chip8 is good for learning how the emulation loop goes and how to draw.
Did CHIP-8 ever get a widely recognized set of mnemonics, or even timings, for its opcodes?
I couldn't find timing info on it, but its opcode is pretty standard, stuff like LD or JMP. There are 2 timers on the machine that can count down from 60 HZ, so rather than doing any timing I just delay the frames to 60 fps per second. It doesn't do IRQ i dont think or i didn't implement it, so timing is rarely needed, and you can write to the graphics whenever you want I think. Yes, it seems like chip8 is poorly documented, but if you just want to see the game screens and manipulate it a little, chip8 is recommended for implementaton because of ease.
The Chip8 has basically no documentation on timing and the Chip8 actually has an instruction for drawing the graphics to the screen, believe it or not, so timing isn't that important.
http://en.wikipedia.org/wiki/CHIP-8
I'm surprised you wrote one in 2 hours though qeed, it took me much longer. Although, I have heard the same from others, that it takes very little time to write a Chip8 emulator... I guess I'm just a little slower than the average emulator author
One thing I always found odd about the Chip8 though, is that it uses 16 bit opcodes, for such a basic system (interpretter actually), that's odd.
lol, that was only possible because i spent near to a year trying to write a nes emu. I guess hard work pays off at some point lol.
It's only now that I'm starting to feel confident with writing emulators, and actually making good progress. Emulation is tough, but that's why I love it, it's a challenge.
Anyway, sorry to hijack the thread jonathonrh, but I'm sure you will find your way with emulation, just keep at it