Next Generation Emulation banner

Newbie to programming

3404 Views 31 Replies 13 Participants Last post by  KillerShots
Not a programming NEWBIE anymore

Hi
I'm new to programming and wanna learn more about emulating.
think any of you can help me out and teach me?
1 - 20 of 32 Posts
Well...

You could try getting experienced in programming first. It's pretty important.

There are quite a few threads in this forums on people wanting to do emulation. Search for them once you learn programming better.
If you are just starting programming, you need to develop your ability first. I know you probably don't want to hear this, but emulation is not a beginner's project.
Do what im doing at the moment, download dev-c++ (a freeware editor and compiler) and work through the tutorials, after the tutorials you will have a basic understanding of c++, after that there are probably a lot of tutorials for emulators floating around on the net.
Guys, you got me quite wrong when i said Newbie, i certainly studied programming to a certain extent. I learned Visual Basic sometime, and still know how programs work, i have quite some experience with programs, and i used to do programming sometime earlier.

But C++ is quite different from VB, and so i woz just wondering if someone around here can help..

Thnx for all the advice however, and i'll try downloading dev-c++ and work it out first and then i'll have a basic idea on C++, thnx Dogmaan, bcrew1375 and Kraelis
There's more to writing an emulator than just programming skills. You'll need to have at least a basic understanding of how the CPU works at a low level, for example. Much in the same way that writing a program that performs complex mathmatical calculations requires a knowledge of mathamatics.

You need to get programming skills nailed down first. C/C++ are very suitable, but most languages will suffice for a basic emulation project (I wrote a Chip8 emulator in Perl). For graphics, I'd recommend having a look at libsdl an excellent cross-platform graphics library.
VisualBasic != C/C++. Take some time, learn C to a fine art. Start with a simple emulator (A chip8 is an excellent choice - very simple). If you still want to tackle emulation after that experience, try something a little larger. If after that point you're still gung-ho, go for the bigger fish.

If emulation is your true passion, don't focus too much on C++ - it won't help you much (and may even get in your way). One of the few times I'd say that :).

SDL is an excellent choice for more than just graphics - helps with timers, threads, input events, networking, and audio. It's almost a replacement for DirectX. It's also industry-accepted (ever wonder what NeverWinter Nights was using? How about Unreal Tournament 2004?). Of course, check around again when you finish your earlier projects - things change quickly. The only thing SDL is NOT well-suited for is multiple-window applications - just can't do it (yet).

Also, there were some earlier threads here (I think it was Zilmar? Z something or other) that had some invaluable hints/clues as to how to write a good emulator. It hasn't been responded to in a while, so look back (it's in this forum).
See less See more
hmmm.......

i seeem to finally understand why the PS2 emulators progressing so slowly....

i'm learning a lot and at a fast speed coz, i havent much to do these days

thnx scottlc, i really appreciate you for your highly commendable recommendation and thnx 2 you all guys for helping me out...

i'll check back in later after i've tackled some of the more sever back pains in the world of programming..


KillerShots - what other programming language would you recommend besides C++, as you say, i've a passion for emulating and so would do anythin to get my hands dirty in the field. As you said , ATM i'm trying out SDL and, i understand what you mean. and also i'll search down the forum for these old threads that you mentioned of

I really appreciate all this and thank you all for helping me out
See less See more
Instead of C++, use C. Still high-level enough to not drown in the simple things, and low-level enough to do anything you may need without shoving you into the object-oriented world for no good reason (there just isn't one for emulation). For the really intensive sections you may want to drop down to assembly to optimize the crud out of it. For example, most (if not all) CPU instructions should be re-implemented in assembly, not C.

I've got to warn you, though... while Assembly for a playstation or an N64 does not look difficult... when you see assembly for the X86 you may run and hide under the nearest rock... I did ;).

Good luck!
Assembly isn't that tough. It's actually easier than C in some ways since there aren't as many syntax rules to worry about. If you're looking to write any portion of your emulator in ASM, I'd reccomend using NASM. It's a quite good assembler, and it's free to boot ;).

Oh, and KillerShots, you really don't want to start the whole "is there an advantage to using C++ in an emulator instead of C" debate again. While I do agree with you, this is the excact thing the last "how to program an emulator" thread derailed on...
__Xzyx987X said:
Assembly isn't that tough. It's actually easier than C in some ways since there aren't as many syntax rules to worry about. If you're looking to write any portion of your emulator in ASM, I'd reccomend using NASM. It's a quite good assembler, and it's free to boot ;).

Oh, and KillerShots, you really don't want to start the whole "is there an advantage to using C++ in an emulator instead of C" debate again. While I do agree with you, this is the excact thing the last "how to program an emulator" thread derailed on...
Plus NASM is cross platform. Last time it was an issue of whether C++ was slower than C. To be honest, hardware emulation is a procedural process and does not benifit from object oriented code.
umm i am a programmer of sorts and have been taking college classes lately, started off with c and within first month was out of our book doing my own projects(man teacher was more than welcome to help me if i needed help since i was done with anything he ever gave us anyways lol) but enough of that, if i remember correctly isn't C much faster in a way than C++? i know looking back i have looked through some of the major game engines like Quake 3 which seems to use C in large amounts(all i noticed was stuff being renamed from the original C stuff)
The speed difference is not as noticable on modern machines as you may have seen in past years. The strength of C++ is its class structure and its object-oriented methodology. Very nice stuff in most cases, but neither feature is useful in emulation. If your main focus is in emulation, why learn object-oriented methodologies and possibly corrupt the procedural methodologies required for emulation? Having a good grasp of both is good and will get you a good job but that takes a lot of time.
You guys can we please end this debate right now, you're only opening up a can of worms which has been opened every single time a thread of this type has been started. I'm no admin, but I've seen this exact thing 5-6 times now, and its a little worn out, so let's just drop it.
I tried to stop it earlier, but it didn't do any good :p.
zenogais said:
You guys can we please end this debate right now, you're only opening up a can of worms which has been opened every single time a thread of this type has been started. I'm no admin, but I've seen this exact thing 5-6 times now, and its a little worn out, so let's just drop it.
Nobody is arguing that C is faster or better than C++. The point is that processors operate in a procedural fashion, and object oriented semantics just don't apply as nicely to emulation as they would for other projects. If you do use C++, you'd find yourself most likely using few C++ features and mostly features that are available in ANSI C anyway.

But one thing I neglected to mention earlier is that if you really have to use assembly procedures, write fallback C routines for issues of portability across different architectures.
Well, it all really depends on what you want to emulate and what type of hardware you want it to run on.

In the old days BASIC and ASM Assembly language were necessities for programming projects. ASM by itself has been significant for game console emulation for as long as I can remember.

I remember people saying that writing an emulator entirely in C would never be a viable alternative because of performance issues. (Not to mention VB and Java)


ASM is still likely a good thing to learn, especially for projects running on x86 hardware. (I would believe that goes double for PS2 projects)
whoa!!!

one day i check in and find no reps, but now.... whew! wa da heck nyways....

hmmm.... i get that all programming languages are hard to learn... can someone suggest a website which offers tutorials for emulation which uses SDL and (or) OpenGL?

At the same time whats the major difference in using OpenGL and SDL for emulation??
What would be a better alternative to enhance both speed and graphics?

I have had a good look at emulators and find that most of them uses SDL. but for what reasons?????
SDL uses OpenGL for 3D graphics. It does not provide it by itself. Just think of OpenGL as a sub-component of SDL, but an independent sub-component (it stands just fine on its own). On the other hand, OpenGL only offers graphics support, while SDL covers just about everything except 3D graphics (unless you also use OpenGL).

The reason most emulators may be using SDL is because it provides cross-platform support for just about every game-related function that may be operating system specific. Threads, timers, audio, video, networking - all use the exact same functions and syntax whatever your operating system happens to be if you use SDL. If you're not following (it may be complicated for people unfamiliar with libraries), it basically means your emulator will also work on other systems - not just limited to windows.
scottlc said:
Nobody is arguing that C is faster or better than C++. The point is that processors operate in a procedural fashion, and object oriented semantics just don't apply as nicely to emulation as they would for other projects. If you do use C++, you'd find yourself most likely using few C++ features and mostly features that are available in ANSI C anyway.

But one thing I neglected to mention earlier is that if you really have to use assembly procedures, write fallback C routines for issues of portability across different architectures.
I'd definately agree with you, for basic emulators most people end up using few C++ features. The ones that can be used for just about every level emulator (vectors, lists, iterators, strings, exception handling, file streams) are quite helpful though. I'd say most of the advanced features though don't scale well to emulators, but then again they weren't created with emulators specifically in mind. All I'm saying is don't pass judgement on C++ or any other language as an emulation tool because you don't use it, as we've already seen its possible to create an emulator in just about any language out there.
1 - 20 of 32 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top