What's new

Questions on beginning Emulator coding.

Basic

New member
Hello emutalk community,

My name is Mike, and I'm a bit confused as where to start. I've spent a good deal of time reading some topics, but I have some questions. I have never programmed an emulator, but would like to target the Chip-8 system, as that is what I see being recommended.

1.) First off, what tools do I want to use. I am experienced in C and FreeBasic, and am familiar with the OpenGL API.

2.) From what I've read, it's recommended to use C, and I fully agree with that. However, where does assembly come into play, or does it even need to? Will HLA(High Level Assembler suffice?), or is pure assembly the way to go?

3.) Is there a good step by step tutorial, or open source project(In C preferably) that I can look through to begin understanding emulators. I've read Michael Abroack's documentation briefly and a few other sources to get me started.

4.) How do the guru's find documentation or how to make emulators for N64/PSX/etc.? :)

Thanks for any help provided,
Mike
 

Doomulation

?????????????????????????
1) C/C++ is a very good language. There's free compilers and IDEs out there. Dev-c++ or Microsoft's Visual Studio Express may be good ones, I think...
2) For Chip8, you won't need any assembly at all.
3) There are many emulators with source available written in C/C++ for Chip8, as well as docs. Dave Winter's Doc is hailed as the best doc for chip8. Docs are also available on the forum, if you just search a little (emulators too).
 
OP
B

Basic

New member
Yeah, I've got both Visual Studio Express, and MinGw compilers for C and C++.

I've done a lot of searching, but I can't find a good step by step guide as to how to apply programming towards starting an emulator. Is there a good basic framework of source code I can download somewhere, that's well documented?

From what I understand, an emulator basically...
1.) opens the file
2.) Searchs for registers, interrupts, etc.
3.) Parses/Interprets all of the code
4.) Runs the code

Is this somewhat correct as to what steps/processes I'll need in my emulator?

Thanks for any help.
 

Garstyciuks

New member
Chip8 is a very simple to emulate, it doesn't require any parsing. You can interpret all the chip8 opcodes on the go. You can check out the code of other chip8 emulators. Some of them are posted in the chip8 thread.

You basically need to know how to decode the information of an opcode (determining which kind of opcode it is, the registers that should be used, etc...) and doing the stuff required by it. If you are able to do that, all is left is to add an user interface to your emulation core.
 
OP
B

Basic

New member
Wow, okay. So it's as simple as decoding the information of a built in opcode, and then saying "do this now", and then moving onto the next line.

Cool, I will continue reading into that massive thread. ;)
 
OP
B

Basic

New member
I have downloaded all of the necessary emulators that I think I will be able to learn from(13 of them!).

One final question:

Do you think it'd benefit me more to actually program a game for chip-8, before actually emulating it?

Thanks
 

Exophase

Emulator Developer
I have downloaded all of the necessary emulators that I think I will be able to learn from(13 of them!).

One final question:

Do you think it'd benefit me more to actually program a game for chip-8, before actually emulating it?

Thanks

I think you'll have a much easier time writing the emulator than writing a game for it.
 

Garstyciuks

New member
I think it's opposite. If you were trying to write a chip8 game, it would benefit you more if you program a chip8 emulator first. :)
 

Top