What's new

Qbasic

Cyberman

Moderator
Moderator
pradipna said:
How will I start emulator coding withh C++?
First I recomend spending some time learning C++
Second I recomend reading up on GB information
Third you may wish to read around about how many emulators work.

An emulator runs code for a platform. So you need to do several things in it. One read the code (ROM) for the platform
Two execute that code.
Three you need to have something to fake the hardware such as Keys LCD screen and sound.

Cyb
 

BGNG

New member
Microsoft has made a hiddeous bastardization of BASIC, and it's even worse considering the only mentionable BASIC environment for Windows are Microsoft made. REALBasic may or may not be suitable for emulator programming, but it can be cross-compiled for Windows, Linux and Mac OS.

I'm not aware of any remarkable BASIC compilers for... well, any system, really. Until someone comes out with a version of BASIC that actually does allow for the low-level system manipulation needed for fast emulators and makes considerable optimizations at compile-time, I wouldn't recommend it for emulator authoring.
 

Doomulation

?????????????????????????
BGNG said:
Microsoft has made a hiddeous bastardization of BASIC, and it's even worse considering the only mentionable BASIC environment for Windows are Microsoft made. REALBasic may or may not be suitable for emulator programming, but it can be cross-compiled for Windows, Linux and Mac OS.

I'm not aware of any remarkable BASIC compilers for... well, any system, really. Until someone comes out with a version of BASIC that actually does allow for the low-level system manipulation needed for fast emulators and makes considerable optimizations at compile-time, I wouldn't recommend it for emulator authoring.
Having gotten used to the low level power of c++, I can't recommend any basic to anyone, for any purpose :p
 

Jsr

New member
BGNG said:
I'm not aware of any remarkable BASIC compilers for... well, any system, really. Until someone comes out with a version of BASIC that actually does allow for the low-level system manipulation needed for fast emulators and makes considerable optimizations at compile-time, I wouldn't recommend it for emulator authoring.

A low-level BASIC would be wrong.
After all, BASIC was designed to be easy to learn and use.
 

BGNG

New member
Quite frankly, there's only so many ways to put "If X = 5 Then Y = Y * 3" into Assembly code. From the programmer's end, it's always the same. But one compiler could make good Assembly out of that, and another *coughmicrosoftcough* may be very slow.

There's no reason not to include support for optional use of pointers, interrupts, registers, etc. A beginner has no business with those things, so a beginner needs not use them. But I can see the advantages of things like "If ARM9.Register(13) < &HF0 Then Call SWI(dsWaitForVBlank)"

For homebrew on the emulation scene, BASIC could actually be quite helpful if compiled well.
 

Jsr

New member
BGNG said:
Quite frankly, there's only so many ways to put "If X = 5 Then Y = Y * 3" into Assembly code. From the programmer's end, it's always the same. But one compiler could make good Assembly out of that, and another *coughmicrosoftcough* may be very slow.

There's no reason not to include support for optional use of pointers, interrupts, registers, etc. A beginner has no business with those things, so a beginner needs not use them. But I can see the advantages of things like "If ARM9.Register(13) < &HF0 Then Call SWI(dsWaitForVBlank)"

For homebrew on the emulation scene, BASIC could actually be quite helpful if compiled well.

Possibly, but I still don't see any good reason.
Why not learning C/C++ (or assembly) if you want to create such programs?

Really; if you want to access CPU-registers you should use assembly instead. (Even C don't allow that)
 

Toasty

Sony battery
I think C++ or C (and a little assembly eventually) is probably the way to go for emulation. Opinions vary, but to me, C++ really isn't any harder to program in than Java or VB, aside from somewhat more time-consuming GUI writing in some cases and of course programmer memory management (learn to clean up after yourself if you haven't already ;)). The benefits of C/C++ outweigh the minor development hindrances though, IMO and you'll get a lot more power to do exactly what you want to as efficiently as possible.
 

BGNG

New member
Jsr:
Programming styles vary between different languages. Some people like the logical flow that BASIC exerts with its ability to mangle data types on the fly. Personally, I prefer to code in BASIC because it's more straight-forward. I use C++ for good compiles when there's no suitable BASIC compiler around, but I prefer BASIC.

Toasty:
Again, you're putting emphasis on the language instead of the compiler. I'm half-inspired to make a super-slow C++ compiler that doesn't allow for pointers and a fast BASIC compiler that does just to throw a big wrench in the works. All C++ allows for pointers, you say? Not if the compiler won't take 'em, it won't.

Anyone else:
The power of a programming language only goes as far as the compiler.
__________

EDIT:
A humorous thought just occurred to me: A JavaScript compiler for Nintendo 64. Yeah. F-Zero X with speed.toString(). Wonderful idea.
 
Last edited:

refraction

PCSX2 Coder
wow another language arguement thread, this time defending BASIC :evil:


end of the day BASIC is never gonna have a better compiler than C++ so live with the fact ;p fantasy isnt gonna make the language better.

dont get me wrong BASIC is nice to do cos its, well, basic :p but when it comes to the crunch and reality, you will get more out of programming in C than BASIC anyday
 

Toasty

Sony battery
Sorry, I didn't mean to disagree with you BGNG. I know compiler optimizations are a big factor in the performance of the final executable, no matter what language you use. It's just that C and C++ have very flexible syntax that allows the programmer to specify exactly what he/she wants to do (even to the point of inline assembly if necessary). I'm no expert on BASIC, but from what little I did with it, I just didn't quite feel like I had the control that I had with C/C++. Anyway, it's just my opinion.
 

BGNG

New member
refraction said:
end of the day BASIC is never gonna have a better compiler than C++ so live with the fact ;p fantasy isnt gonna make the language better.
If you were aiming to invalidate your credibility, you nailed it.
 

Top