What's new

Neat emulator programming tutorial

blueshogun96

A lowdown dirty shame
I noticed that there are lot's of noobs asking for an emulator programming tutorial. Lucky for them I remembered to bring it today :)

In order to understand it, you need a good knowledge of C/C++ programming. It's quite in-depth and very explanitory. So far, this one is the best one I have seen. Hope you all like it.
 

Toasty

Sony battery
Neat. A good read for someone who's read the beginner tutorials, has a little experience and is ready to get a bit more advanced.
 

Toko

New member
Didn't look how old this is but o well, why isn't there any tutorials for C# to make emulators.

C# is faster that VB and Delphi, it should be a good way to make a emulator right? That's all I know.
 

ShizZy

Emulator Developer
Because everybody hates C# who's ever learned C first, (mostly) and C is much better for coding emulators. So the people who program emulators all mostly prefer C/C++, because that's what they learned on. (And it's just plain better - Speed is of the essence in emulation)
 
OP
blueshogun96

blueshogun96

A lowdown dirty shame
I agree with ShizZie. But I guess it's fine if you are just doing a simple 8-bit system. But for more recent consoles/arcade machines, C is the way to go. C++ works too, but I personally don't reccomend it. Yours (and others) opinions may vary.
 

ector

Emulator Developer
C++ is just fine, if you don't overuse OO. The main principle behind the design of C++ is "don't pay for what you don't use, vs C".

Dolphin is written in C++ :)

C# is just fine for 8-bit systems, maybe even some 16-bit systems, but emulation is one of those cases where being close to the hardware really helps speed a lot.
 
OP
blueshogun96

blueshogun96

A lowdown dirty shame
That's a nice tutorial. Thanks for the link man :icecream:

EDIT:

@ ector: Yeah, I should have given an example. Nestopia, for instance. :p
 
Last edited:

Blargg

New member
If you're looking for ways to optimize an interpretation-based CPU emulator, I've written a page describing some techniques I came up with when writing several 8-bit CPU emulators in C (NES 6502, Game Boy Z-80, SNES SPC-700).

Blargg's 6502 Emulation Notes
 

Doomulation

?????????????????????????
C# is moving toward high level languages. It is primarely concerned on the .NET platform, which is slower than native, and it doesn't natively support such low level architecture such as C/C++. Plus to mention that using .NET with native includes a lot of overhead, making it still slower.

C# is a fine language, and is evolving as well, but when you need that "extra power", you need C/C++, and emulators need that "extra power."
 

tye stik

Super Nintendo Wizard
Thanks alot blueshogun96, zilmar, and Blaarg. I've been looking for some high quality documentation on emulator creation. I really appreciate this.
 

MC Eukal

New member
This is a really nice thread. Maybe somebody is writing an emulator and this dude is having a blog?

It is always a good idea to share the results, concepts and problems with emu-developing and sum it up into a book/article/whatever appropriate, so that new generations of little emu-makers won't run into it again. That would be really cool! :happy:

Thanks to zilmar and Blargg for writing their thoughts down and for blueshogun96 starting this thread!
 
Last edited:

ShizZy

Emulator Developer
I'm going to keep a blog-esque journal for my next emulator, which will probably be either a NES, SMS, SMD, or most preferably a SNES. I'll upload source with each post as well. We'll see how it goes.
 

tye stik

Super Nintendo Wizard
I'm going to keep a blog-esque journal for my next emulator, which will probably be either a NES, SMS, SMD, or most preferably a SNES. I'll upload source with each post as well. We'll see how it goes.

Cool. I'd be interested in seeing the development of a SNES emu.
 
OP
blueshogun96

blueshogun96

A lowdown dirty shame
@ tye stik and MC Eukal: anytime :)
btw: an emu blog is a nice idea :) why didn't I think of that. I'll definetly do that for my Sega Titan Video emulator (which atm is a future project. So far all I managed to do was start working on the M68000 core).

ShizZie said:
I'm going to keep a blog-esque journal for my next emulator, which will probably be either a NES, SMS, SMD, or most preferably a SNES. I'll upload source with each post as well. We'll see how it goes.
Good luck with your SNES emu. I'll tell you this now, I'd say one of the hardest parts about SNES is sound, IMO.

EDIT: Here's a doc on the 65c02 of you are interested :)
http://www.zophar.net/tech/files/6502ref.html
EDIT2: forgot about this one
http://www.zophar.net/tech/snes.html
 
Last edited:

ShizZy

Emulator Developer
As for future projects, if anyone would like to work on one with me, or needs help, let me know. I havn't picked up another emulation project yet, and I'm sure I wouldn't be able to handle anything too advanced entirelly on my own.

I'm getting really excited about SNES... even though I know it's really pushing my abilities as a programmer. The thing with most of these systems is that they've already all been done by everybody and their dogs. I wish I could step into newer grounds...
 

TheImpaler

New member
ShizZie said:
As for future projects, if anyone would like to work on one with me, or needs help, let me know. I havn't picked up another emulation project yet, and I'm sure I wouldn't be able to handle anything too advanced entirelly on my own.

I'm getting really excited about SNES... even though I know it's really pushing my abilities as a programmer. The thing with most of these systems is that they've already all been done by everybody and their dogs. I wish I could step into newer grounds...

Well a console I was tempted to try out was the X68000 console. But I found out I had no skill lol. There seems to be good emulators out, but I think there could be better. I have so many projects "on hold" but maybe you could try it.
 

Sagon

New member
ShizZie said:
I'm getting really excited about SNES... even though I know it's really pushing my abilities as a programmer. The thing with most of these systems is that they've already all been done by everybody and their dogs. I wish I could step into newer grounds...

My ultimate goal of starting coding emulators is a creation of Sega Saturn emulator, right now only one developing emulator exist - SSF, so Saturn is pretty fresh and new ground for emu coding, but now i don't have enogh experience to handle project like that, so i'll try something simpler like Sega Genesis. But maybe you want to create Saturn emu...
 

Top