If you're just starting to learn to program, and you want to target the GP2X eventually, learn C/C++. I started out with Pascal, which is basically the same but with a nicer syntax; however, useful versions of Pascal are hard to come by these days, much less with interfaces to libraries and tools you'll need. Plus, if you start with C, you won't have to learn a new syntax when you're starting on the 2X.
I'd very much
like to recommend Python, which is the best language I've yet com across, except: Python takes a lot of work away from you so you don't have to worry about it (garbage collection, to name one). If you start with that, you'll get used to it (even worse, you won't know any different), and you're never going to get a good grasp of the concepts needed to effectively develop software for embedded devices.
On a device like the GP2X, you're right on top of the hardware, and you will need to feel that.
Programming is first of all about problem solving. You're going to need a rational mind. You're going to have to be able to attack a problem top down: I want to draw an image to the screen. What do I need? Ah, I need an image, then I need a screen, then some way to draw to the screen. How do I obtain an image? I could draw it, or load it from a file. How do I get a "screen"? My graphics library will provide me with a handle to it, otherwise I'm going to have to address a raw memory block. How do I obtain the handle to that memory block? Etc.
And this is just a very trivial example. There's
a lot more to actually writing a running game.
You're going to have to ask yourself questions continually, and you'll have to think of a good answer to each one of them. It helps if have experience in this, because a lot of the questions and answers will be similar, and you will remember the answers pretty easily if you've come across the same problem a lot. When you're just starting out, I guess the best way is to look at how other people solved the same problems, copy their answers and modify them to suit your needs.
Remember that you'll actually have to think about code you copy and why it solves your problem. You'll
never ever learn by just copying code. Look at it, try to figure out why it works. Try to figure out why the person you're copying the code from has done it in this way and not another, because usually questions have multiple answers, and one answer is better in one situation and another is better in another. Most of all, think before you write. Don't just try random sequences of code and see if it does what you want. Think about what you want to do, think of a way to do it, and think to yourself why the solution you thought of will do the trick. Did I mention
think in there already?
Finally, for your first program, don't expect to write a full game from scratch. In fact, forget doing anything graphical at all. Write a simple application that prints out a sequence of things. Then write a game higher/lower game where you have to guess a secret number from the computer within 10 tries. Keep increasing the complexity of your projects. Eventually add graphics, which adds an entire twist of its own to coding. Forget emulators, they are
way too hard to write. You'll need an intricate understanding of the hardware and software of both devices, down to he tiniest details. You can try those when you are a master coder
.
Learning to code is a long-term commitment, and you should ask yourself if you're willing to start it. Don't expect to produce anything spectacular in the first few months (although even the small programs sure can give you a great feeling of accomplishment).
And then there's good game design, which is a whole other cup of tea; being good at programming won't automatically make you good at creating a fun game...
Well, hope that didn't discourage you. The best of luck to everyone wanting to try out the exciting world of getting a computer to do what you want it to do