One of the most asked questions that appears about developing a console emulator is where to start. The truth is that this question gets asked so much because it's really an important and variable one. It depends on many things, such as the knowledge of the target system and the programming knowledge. One thing is for sure, without great knowledge on the target system and good to great knowledge on a programming language you won't be able to make the emulator you desire, but you can definitely learn as you need.
The other common question is which programming language to use. I really think that if you just want to do an emulator for fun or learning you can use whatever language you want as they probably are all capable handling such a task. Though I wouldn't like to see the code of an emulator developed in Prolog or Scheme. But then we come to another important side, which relates to how well your emulator behaves. Even if it is possible to make the emulator in any language, it certainly won't run as fast in all of them, and that's the main reason why the most recommended language for this kind of tasks is C/C++. It allows for low level coding which helps to improve the performance of the emulator.
I have always liked C and in the last time have worked a lot with C++ and got to like it too. So that was the language of choice for me. I feel comfortable with it and there's tons of documentation and APIs to help with other tasks (mainly Input, Video and Sound).
So which API do we use for the Video? The truth is that you should use what you think is the fastest and or easier one but trying to do your emulator in such way that is easy to change from one API to another doing the minimal changes. This usually could be done by wrapping the API calls. In my case I've chosen DirectX (which made me code in windows) because I have worked before with both OpenGL and SDL and just little really basic stuff with DirectX and I thought it would be good to learn the most in the process of developing the emulator.
Now.. if you lack the programming skills in an especific language that you choose I will point you to learn that a little better before you try to develop an emulator or it could become a nightmare trying to implement something you half understand with a code you don't know too well what it does.
In the other case.. you should head to information about your target console. How does it works? How many CPU does it have? Sound? GPU? Joypads? Etc.. You won't be emulating a console without all its information. That's where a new problem arises.. you usually can get superficial information about each part of the console, but getting the deep information you sometimes need is quite hard. Luckyly in my case.. the gameboy is well documented, though a couple of details are still missing or I just haven't seen them :)
My primary sources of information are:
http://marc.rawer.de/Gameboy/
http://nocash.emubase.de/pandocs.htm
Ok, ok.. I'm missing something here, I know. Thre are basic guidelines you can follow to develop an emulator. But it has been done by quite a lot of people and I couldn't do a better job at it so I'll just will give you a link.
http://web.archive.org/web/20050414012510/www.pj64.net/emubook/
There you'll get basic information about how a console works. Also.. there's a document by Victor Moya about emulators which is great and has lots of details.
On the next posts I will talk about how I implemented each of the parts that are explained on those documents and when finished the basic explanation I will start adding work logs in a more "technical" way.
Monday, February 23, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment