GP2X Do Developers Hide Their Secrets???


NeOCidE

Still Fresh
Joined
Oct 4, 2005
Messages
65
Hi everyone, first time poster.......long time follower :)

I have just recently ordered my GP2X, so i'm looking forward to that puppy.
Aswell has looking forward to homebrew games and emu's I would really love to hopefully one day make/port an emu or even write my own game.

What I want to know is, why is it so hard to find tutorials on teaching people to port/ make emulators?? I mean, lets say for example I'm an elite C++ coder, this wouldn't mean I could just code an emu or even port one. I so dearly want to not only play games, but actually contribute to the scene aswell. Is there any info out there that is available, that can actually teach us where to actually start porting/ writing an emulator.

Personally I would like to start with something from way back when i.e space invaders or Pacman.

It's really killing me seeing what the amazing devs are up to, you know, porting snes, amiga, quake1. Please please please, offer me some guideance so I too can get into contributing. I think alot of people on here would also like to know this, but don't quite ask in the same manner :)

I cannot think of anything more exciting than bringing some kind of program alive on your handheld. I just hope one day I an do it.

Thanks for all your harwork devs, and thanks to everyone here for a decent community!

Dave
 
I have also been wondering this, what is the difference between a PC and a GP32 source code?
 
NeOCidE posted on Oct 5 2005 at 05:46 AM said:
Personally I would like to start with something from way back when i.e space invaders or Pacman.

Dave

For now, if you can write something with SDL, SDL_image and SDL_mixer then it should run on the GP2X without any hassles. Check out http://www.libsdl.org/
 
Last edited by a moderator:
theoddbot posted on Oct 4 2005 at 08:51 PM said:
NeOCidE posted on Oct 5 2005 at 05:46 AM said:
Personally I would like to start with something from way back when i.e space invaders or Pacman.

Dave

For now, if you can write something with SDL, SDL_image and SDL_mixer then it should run on the GP2X without any hassles. Check out http://www.libsdl.org/


Thanks any help to us curious peeps is much appreciated!!
 
Last edited by a moderator:
There are no 'how to port and emulator' tutorials because there is no set way to do it! If there was, you could write an automated script that did it!

There is a post in the gp32 development forums by Grim Reaper (I believe) detailing how he ported MAME.
EDIT: here it is though it is not how he ported it, only how to compile it. I'm sure I read about it though :blink:

I have never attempted it before, but the difficulty level of doing it completely lies with the original code, and how easy that is to follow, and how it has been constructed.

Basically you need to:
1) Get the original source code
2) Search and convert any code that won't compile (because of differences in the original compiler/development environment etc) to the compiler you are using. The most work is probably any ASM in the source.
3) Go through each of these sections and replace the old host machine code (probably PC) with code that can run on the new host machine (gp32 or gp2x):
- i) File access (loading/saving ROMS, savestates, highscores etc)
- ii) Sound output - must be gpx2 specific obviously
- iii) Graphical output - Instead of a window, you need to write code to convert and display it using the framebuffer.
- iv) Input - Need to map any input to the gp2x controls
4) Need to custom build a menu with gp2x specific options as well as the original emulator options (in case of gp32, his is clock speed, screen type, 8/16 bit, sound options etc).

As you can tell, if the original coder has done a code job, and abstracted each section above into a nice module/procedure/class it should be easy enough to swap one for the other. Original code comments would help no end too.

Any emu coders - am I on the right track?
 
Last edited by a moderator:
Thanks pea!! Sounds complex, but then again, I wouldn't expect anything different. I'll try and snoop out some source code on space invaders then :)
on the old Intel 8080.
 
Space Invaders presents you with a super simple example.

Graphics hardware is just 1 bit

sound hardware was analogue, thus just use samples.

8080 will work with a z80 core.
 
NeOCidE posted on Oct 5 2005 at 06:03 AM said:
Thanks pea!! Sounds complex, but then again, I wouldn't expect anything different. I'll try and snoop out some source code on space invaders then :)
on the old Intel 8080.

Bah, you don't need the source code to write space invaders, let your mind run free :)
 
Last edited by a moderator:
pea posted on Oct 4 2005 at 09:06 PM said:
It is complex and time consuming (usually) thats why those devs we all love are the heros around here :).

Your not kidding! What these devs do for the community goes far beyond what we could ever wish for. I don't think we could ever possibly express our gratitude for the enjoyment they bring back to us. Not many modern day games compare to the playability/enjoyment IMO than the past years.
 
Last edited by a moderator:
theoddbot posted on Oct 4 2005 at 09:08 PM said:
NeOCidE posted on Oct 5 2005 at 06:03 AM said:
Thanks pea!! Sounds complex, but then again, I wouldn't expect anything different. I'll try and snoop out some source code on space invaders then :)
on the old Intel 8080.

Bah, you don't need the source code to write space invaders, let your mind run free :)
LOLOL :D
 
Last edited by a moderator:
here's a request if your up for it. Atari 2600 emulation is not very good on the GP32 believe it or not, you would make many people happy if you could clean up the emulators so they worked better.
 
Without reading the thread yet..

There are some old FAQs on writing emus if you look around. I know I wrote one years ago, even, too :)

Your'e not an elite C++ coder if you don't know about porting; porting is pretty easy on the scale of things.

Writing an emu is also not hard, but it is usually tedious, depending how much source material you have (copying an existing emu, or writing a new one from scratch.)

An elite coder knows to look for some code and dive in; porting is easy, so give it a whirl; after you've got a simpel port under your belt, you could begin writing your own emu after you see the flow of things. ie: Emu workflow is fairly typical across emus.

(There are not so many emu authors around that its a big topic that gets books written about it.. but writing a CPU emulator is nearly always done the same way, and building an emu around them is also patternistic.)

Try porting ColEm; its very easy.. took me an horu to port it to GP32 and Palm OS, and Palm OS is _hostile_ :)

jeff
 
Not many writes emus, it's very hard and emus are not popular among the makers of the emulated hardware and they are the big guys so it's not surpricing that you can't find any instructions on it.

If you are not an elite coder then I suggest you start on far smaler projects or you are gonna stop on the emulator long before you get anywhere near finished.

As mentioned you should start with ports, remakes or even writing your own game or application. If you can get a hold on source code and the media for an existing game, preferable a simple one, then porting that might be a good learning project. Or just look at an existing game and try to do a remake instead. Space invaders is quite an easy game to remake. After a remake you can always make an enhanced version and then your off on your way to become a game developer.

Developing/remaking and emulation/porting are 2 quite different aproatches where the 1st one is far more creative while the 2nd one requires more analytical skills. Developing and emulation are definatly the hardest things you can get into.
 
Thanks guys, I really do believe you have given us some really sound advice there! I'm in no way or even claim to be a good programmer let alone elite. I just hope to be able to code somwthing that will be of some worth to the community one day, just if anything to say thanks and give something back in.

Dave
 
Back
Top