GP2X I'm Very Stupid, Please Set Me Straight


Joined
Dec 7, 2005
Messages
242
I'm obviously a retard. Not complete, but close.

what *exactly* does a windows user need to start programming for this system?
both very minimum, and preferred tools.
I half expected to find this as a sticky, or an obvious website--but at this point I'm looking too hard to be able to find one anyway.

I've been rolling around for a decent amount of time and I have absolutely no idea what to do with the official gp2x sdk. since then I've aimlessly stumbled around SDL and GCC, some kind of "minimal library" not even knowing really if I even need them or what. Most of me expected the GP2X dev kit to be rather obvious, an all-in-one total solution--though for all I know, I suppose it is...

Also, what does it take to port sourcecode? Say a windows program using SDL libs.

Is there a simple site with a tutorial or guide for any of this. I'm not *totally* new to programming, but as far as anything along these lines, I'm pretty close. I'd like to know how far I have to go to start messing around. I'm poking with notepad, now what?

also as far as testing, how is this done? My GP2X is on the slow boat from asia, can I test in windows?
 
You will need the following to develop for the GP2X: notepad and a paint package. That's it...


Setting up the compiler in Windows:

(This is based on Guyfawkes's GP2X User Guide, just simplified a bit with the URLs. If you're reading this after the day I posted it, it's probably a good idea to get Guyfawkes's guide instead of following this):

Do the following:

1. Download the GP2X DevKit:
http://kent.dl.sourceforge.net/sourceforge...tGP2X-win32.exe
2. Install it to C:\devkitgp2x\
3. Download MinSys:
http://kent.dl.sourceforge.net/sourceforge...MSYS-1.0.10.exe
4. Install it. When it pops up a console window asking you [yn], tell it no (unless you know what it means!)
5. Press Windows Key+Pause/Break, go to Advanced, Environment Variables, System Variables, double click Path, and stick this on the end: ;C:\msys\1.0\bin;c:\devkitGP2x\bin\
6. OK to all dialogs
7. Download this file:
http://gp2x.org/gp2x/libs/gp2xlibs.tar.gz
8. Navigate down into it, extract the 6 directories to your C:\devkit2x\ and say Yes to all prompts to overwrite.
9. Download this:
http://www.emuholic.com/arm-linux-sdl-config.rar
10. Extract it to c:\devkit2x\bin\
11. Download Guyfawkes's demo project: http://www.emuholic.com/demo.rar
12. Extract it to a folder somewhere, open a cmd window (Start, Run, cmd, OK), cd to the folder and type MAKE
14. (No bad luck here!) It probably worked! There should now be a GPE file in the demo project folder. This is a GP2X executable file.

Testing: You have to test the files on your GP2X. I'm sure you can test it using SDL somehow, but I haven't got a clue how because I'm new to the GP2X+SDL too :)

Porting: From what I've heard, most SDL stuff can be ported quite easily.

Er, so I've not been of any use I imagine. Oh well.
 
Well I'm no expert, but here goes:

Do you know how to program in C/C++?

Have you ever programed cross-platform before?
(with SDL I hear its not that bad...)

According to my understanding if a program is written carefully in C++ using ONLY SDL as its one depencancy, it can be cross-compiled to the ARM-linux architecture and run just like on windoze.

IMHO I think C/C++ is a really poor cross-platform language.

Java, Python, Lua, Basic are better for many mixed systems but are not as fast/efficient.
(Isn't someone porting one of those interpreter things?)

Anyhow I think you will need a GCC (or compatible compiler, like mingw) and the SDL libraries (especially the development headers!).

http://andrew.textux.com/tutorials/tut1/tutorial1.html
http://www.cpp-home.com/tutorial.php?154_1

Try those.
 
Series-8 posted on Dec 9 2005 at 05:30 PM said:
Java, Python, Lua, Basic are better for many mixed systems but are not as fast/efficient.
(Isn't someone porting one of those interpreter things?)

Python/PyGame has already been ported. Check the file archive.
 
Last edited by a moderator:
taras posted on Dec 10 2005 at 12:40 AM said:
PS. Since when has Basic been better than C cross-platform ?!
Well, Basic can be ported to every system it supports without anything being needed done! Windows, Windows, and Windows!
 
Last edited by a moderator:
taras posted on Dec 10 2005 at 01:29 AM said:
Er at so I've not been of any use I imagine. Oh well.
What a great response. Two helpful responses and not one reference to the search button. That's what a community is all about. I was expecting more stuff like this :
christ sake, if you cant be arsed to figure it yourself then you've no hope of gaining the skill to code anything worthwhile...
How encouraging to see your two replies.
 
Last edited by a moderator:
thank you so much for your help. No, I've never done anything with c/c++. I've done a rather lot of mainframe/midrange work and more basic than I care to remember. But I figure I can hack out a text-based trading game, and build upon that.

I never would have thought about the user guide. It's hardly user guide material. But I do have it working--at least I got the demo to compile. looks like it's time to buy a book. oh, and what about all these other libraries?

Thank you again.
as far as the search button, I could spend quite some time searching when I don't especially know what info I need. That one page of the user guide would be really helpful as a sticky. I imagine this comes up often, in one form or another.

Honestly I expected more hand-holding from GPH itself. Something with arguement popups, and half a dozen working game examples of code. I had far more user-friendly experiences with GBA of all things.
 
Give it a few months until everyone has their GP2Xs and some proper tutorial guides will pop up. I might do one if I can work it out :)

With the GP32, Rico did a really useful guide which got a lot of people started I think - a basic guide to how to use bitblt, clear the screen and move a sprite. Something along those lines would be great - the rest (scoring, collision detection, menus...) is pretty easy to work out for anyone with a bit of programming background.

Also, a great intro to C is "C Programming In Easy Steps" by Mike McGrath. It explains all the core concepts.
 
See this wiki page for my guide on getting started on GP2X development with Visual C++ 2005 Express. No MSys or Unix shell-a-likes required, plus you get to use a great IDE. The guide does not show how to use SDL, but that's because I'm using Rlyeh's Minimal Lib.
 
Goity posted on Dec 10 2005 at 01:00 AM said:
Well, Basic can be ported to every system it supports without anything being needed done! Windows, Windows, and Windows!

You can shove Basic on one of those Parallax Basic Microcontroller things...
 
Last edited by a moderator:
Reaperman93010 posted on Dec 10 2005 at 01:03 AM said:
what *exactly* does a windows user need to start programming for this system?
both very minimum, and preferred tools.

I understand your frustration and struggled to get up and running, but with some help (on a similar forum) http://www.derekscholte.nl/GP2XForum/viewtopic.php?t=142 I managed to get up and running.

I installed devkitGP2X after following the wiki instructions and after some messing about with paths got it to compile the demo project http://www.emuholic.com/demo.rar into a gpe file.

Then I installed Bloodshed Dev-C++ which is an IDE and removes the need to build nasty makefiles (I'm pretty rubbish at compiling as I don't really understand it!) and so long as I remember to put "-lmingw32 -lsdlmain -lsdl" in the linker parameters for each project that uses SDL, I can compile exactly the same code into a Windows .exe.

So long as you're sticking with SDL and stay away from GP2X specific instructions (if there are any!) you should be able to create and test your code in Bloodshed Dev-C++, then compile the same code using devkitGP2X to build your .gpe file.

(I've never run one of my projects on the device as I don't have one yet, but I am able to compile exactly the same code without errors to both an exe and a gpe, so I'm assuming somewhat as to the outcome, but the theory is sound!)
 
Last edited by a moderator:
I do like the handholding compiler and code completion with bloodshed dev-c++--this is more what I'm looking for. however its usefulness seems somewhat limited. there seems to be no way to generate gpe files directly through it, meaning I'm stuck wondering what the heck a makefile is. also even with the linker parameters, the demo.c fails on the first line of code. which isn't encouraging...

I still haven't picked up a c++ book, but if I don't get over the language barrier as far as setting up the my ide's, compilers, libs (and figuring out what they and 1000 other things I don't understand are), then I won't be much less lost.

idea: I suppose what completely lost folks like me will end up doing is grabbing a book and building off demo.c until we learn better.

honestly what I expected from GPH is nothing less than an all-in-one tool. Something that allows me to code, compile and test (on and off hardware) in a single install package, and I'm not sure why such a thing is too much to ask from a device asking so much from its users.
 
Reaperman93010 posted on Dec 11 2005 at 03:01 AM said:
Its usefulness seems somewhat limited. there seems to be no way to generate gpe files directly through it, meaning I'm stuck wondering what the heck a makefile is.
Me too! I found it useful to compile my C into an executable to test the game logic and to finally see my sprites moving around. There is a way (I'm told) that you can tell the IDE to use a different linker to compile into a .gpe file. I never actually got it doing this, but I write and test my code in Bloodshed DevC++, then simply use devkitGP2X to compile exactly the same code into a gpe file (I'm using SDL for video/audio)

I still don't understand how a makefile works, but when I need to, I'll be back asking questions - in the meantime, I don't need to know just yet and there's more than enough to be worrying about just now....

Reaperman93010 posted on Dec 11 2005 at 03:01 AM said:
...also even with the linker parameters, the demo.c fails on the first line of code. which isn't encouraging...
What error messages are you getting?
Post them here, and if anyone else is having the same problem, when the solution comes, it will appear here for them too....

Reaperman93010 posted on Dec 11 2005 at 03:01 AM said:
honestly what I expected from GPH is nothing less than an all-in-one tool. Something that allows me to code, compile and test (on and off hardware) in a single install package, and I'm not sure why such a thing is too much to ask from a device asking so much from its users.
Don't be so hard on GH! The device has come a long way since it's design just a few months ago! At the end of the day, they've created a cracking piece of kit and tried to stick to commonly available hardware that is already well documented. I can't pretend to understand most of what I read on the various forums, but it's communities such as this one that offer the best support. The manufacturers are still concentrating on getting the hardware right while developers eager to get their hands on it have been demanding it to be released so they can get coding - give GP some slack! There may be an all-in-one package on its' way but it's more likely to come out of the user community first. If you want to be at the cutting edge, try things out and report back here; there's little support just now, but half the fun is finding things out.
 
Last edited by a moderator:
blinky465 posted on Dec 12 2005 at 09:31 PM said:
Sorry for the double post - I forget where I got my DevC++ setup instructions, but here's a link:
http://www.bloodshed.net/dev/SetDevCPPArm.pdf

Also, I seem to remember having to download mingw32 separately and copying it into a folder inside the "devcpp" folder.

More links:
http://wiki.gp2x.org/wiki/Using_GCC_natively_in_Windows
http://mingw.org/
http://bloodshed.net/
i get the same problem everytime :( cannot find -lSDLmain, can anyone help me?
 
Last edited by a moderator:
Back
Top