PDA

View Full Version : Its all about Switching Sides!!



tbag
October 5th, 2002, 03:38
Ok iv had my fair share of Visual Basic im switching to Microsoft Visual C++ 6.0 :cool:

Now does anyone wanna explain to me a bit about setting strings and values in C++ and calling those strings etc.. to the screen?

or

Does anyone know any good sites for starting emulation in C++?

I have about 4-6 hours free a day when i get home from school to work on Emulation :D

bjz
October 5th, 2002, 08:35
"Does anyone know any good sites for starting emulation in C++?"

www.cplusplus.com
www.cprogramming.com

learn the language first.

tbag
October 5th, 2002, 09:10
Thanks bjz those are some really useful sites i owe you one and people said C++ was hard its not that hard after looking at those sites tutorials etc...

In a way in some areas Visual Basic is harder especially in emulation ;) instead of writing 0x12000 or whatever in Visual Basic its &H12000 damn its so much easier not having to type in extra crap :)

Cyberman
October 6th, 2002, 22:31
Originally posted by tbag
Thanks bjz those are some really useful sites i owe you one and people said C++ was hard its not that hard after looking at those sites tutorials etc...

In a way in some areas Visual Basic is harder especially in emulation ;) instead of writing 0x12000 or whatever in Visual Basic its &H12000 damn its so much easier not having to type in extra crap :)
Hmmmm well anyhow.. VC++ is rather a PITA but it's still better than VB to do it in. Geesh .. now you listen to us huh? ;)

Cyb

tbag
October 7th, 2002, 02:12
Heh yeah say anyone know what i should emulate first?

Ive looked at a PS2 Emulator source and well GBA Emulators are more complicated then PS2 Emulators but that would be because there not fully emulated only partially ;)

mesman00
October 7th, 2002, 04:51
umm, are you sure a PS2 emu is easier to write than a GBA emu.

tbag
October 7th, 2002, 04:59
Looking at NSX2 Emulator its not as advanced as Tom Happ's Cowbite Emulator but like i said PS2 Emu's only run Demos!

Flare
October 7th, 2002, 18:08
? ? ? ;)

Cyberman
October 8th, 2002, 00:17
Originally posted by tbag
Heh yeah say anyone know what i should emulate first?

Ive looked at a PS2 Emulator source and well GBA Emulators are more complicated then PS2 Emulators but that would be because there not fully emulated only partially ;)
I suggest something simple first.

Like how about plugin for PSX2 memcards?

Sony uses Magic Gate encryption apparently to prevent people from doing what they did with the PSX cards. IE proliferate a bunch of dupes and edit cards and trade card images etc. (as in CBFD bunch of @$!@#! @#$@ ).

This essentially makes it impossible to have compatible cards with Sony's and them be cheaper.. why you say? Well kind of simple Magic Gate is Patented by Sony you HAVE to get a license agreement.. so if you make a memory card for the PS2 that's compatible.. you have to license it and thus you can't make money Clever huh?

As far as I can tell there is no reason for the magic gate encryption unless it's because of the network adapter etc and protecting information used on the card.. from God only knows what they think it needs protecting from.

Anyhow something simple.. STRONG RECOMENDATION. The GBA is much simpler to emulate by the way.

Why do you think they can emulate it already and it came out AFTER the PS2? :)
Cyb

LD.
October 8th, 2002, 01:47
Why not start even simpler and emulate the original Gameboy?

cooliscool
October 8th, 2002, 01:52
write a TI-83 emu. :)

tbag
October 8th, 2002, 02:57
Yeah ive been looking into Gameboys but im confused on the Docs i have they dont tell enough info :(

But ive got a open source GB emulator and all it contains is Build CPU with heaps of opcodes and just uses DirectDraw to draw the screen and its got barely any code and works fine...

bjz
October 8th, 2002, 05:43
get your damn mind on straight boy, dont start with anything emu related, learn the language in and out first.

tbag
October 8th, 2002, 07:29
I tend to pickup on things rather quickly :)

Lachp30
October 9th, 2002, 07:35
Find a emulator that has gone open source, look it over and see if you can make any sence of it. It helped me when I was first looking into emu coding.

Lockie

tbag
October 9th, 2002, 08:17
I have but the thing im confused about is in the Opcodes for the gameboy the emulator has noone of these opcodes.. nor any of the registers etc..??

Cyberman
October 9th, 2002, 15:57
Originally posted by tbag
I tend to pickup on things rather quickly
It's not possible to pick up C++ and consider yourself an intermediate programer in 3 6 9 or 12 months.. beginner yes.. no way on intermediate. It's not possible, not because you can't pick it up or any such thing, it's a very BIG language and you can do a LOT of things in it you may never use. OOP is NOT visual basic. VB is designed to be EASY and SIMPLISTIC. C++ and C are NOT, they are designed to be as low level as possible or as complex as possible depending on your need. If you didn't know VB is written in C++ that's how they have all those cool abilities to add things and add in Active X components.

C++ is OOP, which is an extension of structured programing. In C++ your program consists of messages sent between objects where the object do most if not all the work. Lets talk EMU now. Say you want to emulate a GBC, you have a number of objects you should make now. A form for the layout of the EMU, (1 objecT), menus for the EMU (several objects there), in fact a typical windows program has 100's of objects just in setting up the GUI. Next the processor (modified Z80). That's an object as well. Memory? Another object. Cartridge memory? Yet another object... Bottom line is it's not as simple as taking a bunch of lego blocks and putting them together. Fortunately with VC++ or BCB a lot of the work has been done for you. BCB would be much easier to use though. Also for graphics it's not too bad, you have to grab your 'frame buffer' created by the emulated GBC and convert it too a bitmap. I'm wondering if dynamic recompilation would improve speed a lot on emulating it.. not that one needs speed.


Originally posted by tbag
I have but the thing im confused about is in the Opcodes for the gameboy the emulator has noone of these opcodes.. nor any of the registers etc..??
It's a modified Z80?
you have 8 8 bit registers
A B C D E F H L (I forget the other threw out the z80 references I had :) )
you have an R register too for refresh control of dynamic ram.
4 16 bit registers
X Y PC S
Also register pairs
AF BC DE HL
Additionally you have alternate registers
A' F' B' C' D' E' H' L'
these are for context switching in interrupts to allow you not to have to push everything on the stack.

IO has 256 address memory 65536 unless they are supporting the segmented Z180 (which is more complicated).

I suggest making a 'CPU' that emulates the z80 as closely as possible. Then look at the particulars unique to the CPU the GBC has, and 'inherit' the Z80 into the new CPU object.

Good luck!

Cyb

tbag
October 10th, 2002, 07:57
Hmm thanks that helps a bit :)

Got any other Docs on the Z80 GB version as all of mine are really old and i beleive there in-accurate i know the ones of Zophar.net but the ones there that i looked at were in accurate to the emulator of the GB i have so.. uhh unless its the emulator ehehe ;)

The Khan Artist
October 10th, 2002, 22:34
What are you looking at? GNUBoy? Or TGB Dual? Or is there another open-source GB emu I don't know of?

tbag
October 11th, 2002, 03:00
Hash its at www.zophar.net/gb.htm or gb.html cant remember ;)

Cyberman
October 11th, 2002, 22:44
Originally posted by tbag
Hash its at www.zophar.net/gb.htm or gb.html cant remember ;)
I suggest looking at the TGBC etc. These are open source and can give you lots of inspiration.. I've already done quite a bit based on Griever by Qimm with the FF8 Save state mods. Jenova from Qimm gave me a lot as well. I have an exception error with memory currently with the DLL for my Jenova plugin.. perhaps later I'll figure out what the problem is (sigh). Anyhow.. I was thinking of a simple GBC emulator myself a while back, just haven't done much toward doing that. So many things :)

Cyb

Flare
November 6th, 2002, 18:07
Originally posted by cooliscool
write a TI-83 emu. :)

never heard:plain:

mesman00
November 6th, 2002, 20:42
TI-83 is a graphing calculator

cooliscool
November 6th, 2002, 22:39
Originally posted by mesman00
TI-83 is a graphing calculator

Ahh yes, gotta love Texas and their instruments. ;)