Many of the people that will be getting a GP2X Wiz are, like me, excited about developing and porting games and applications to the Wiz. In previous posts, I've talked about the official commercial titles that are coming for the Wiz, and I've also discussed some of the homebrew/freeware titles (like games, emulators, etc.). I'm sure there are people that will buy a Wiz because they are interested in the commercial titles or the freeware titles. Today's post, though, is more aimed at those people that want a Wiz so they can develop their own games and applications to run on the Wiz.
Bubble Train (as seen in the video above) is a game developed by a couple of guys named Adam and Craig. Here is their Bubble Train website. It's a very fun puzzle game that is comparable to Zuma or Luxor, but the great part is that it's free (and open-source).
Bubble Train was written using SDL for all the input, graphics, audio, etc., so the code is very portable. In 2006, I put in the effort to make the game playable on the GP2X. To do this, I had to change a lot of the game to be viewable on the GP2X's small screen (which was a different resolution than the original game was intended to be played on). I also had to change the input method to use the joystick instead of a mouse (this was before there was stylus input on the GP2X). I redid all of the graphics, added lots of music tracks, and added/changed some gameplay features. The outcome was good enough to win 1st place in the GBAX 2006 Coding Competition. I must re-iterate that the original game was not mine, and without the appeal of a fun game like the original PC version of Bubble Train, there would have been no chance of the GP2X version winning.
Fast-forward back to the present. The GP2X Wiz test unit has just arrived, and the official release is hot on its tail. I want to see if I can get Bubble Train to work on the Wiz. I could go into gory detail about how many sleepless nights it spend, or I could tell you the truth.
The truth is that taking GP2X code and porting it to the Wiz is almost a no-brainer. In fact, I don't think it would even be called porting. I am actually hesitant to describe how straight-forward it is, because then it'll seem like I didn't do anything.
First, I copied my GP2X Makefile to Makefile.wiz. Then I took out the static linking option. I had to change a few other things because I was now working on a different machine that had the Open2X toolchain (as opposed to DevKitGP2X that I originally used). After that, most of my time was spent debugging. Now that I am using shared objects that live on the actual Wiz (instead of static linking like I would do on the GP2X), I was at the mercy of what was already on the Wiz.
On many of my GP2X games, I use a script to start the game and then exit back to the gmenu2x when the game finishes (or crashes). To do some really simple debugging, I added "> out.txt 2> err.txt" to the end of the script line that runs Bubble Train. That made all the output go to files on the SD card. What I found was that libxml2.so.2 was a shared object that wasn't getting loaded properly (and it would cause the game not to run). To remedy this, I copied libxml2.so.2 from my Open2X development toolchain directory to my SD card (where my Bubble Train binary lives).
After that, everything worked. To my (ecstatic) surprise, even all the mouse input now used the stylus. That was the worst problem with the original GP2X version of Bubble Train. I emulated the mouse using the joystick, and moving around the menus was very clunky. Now, you can just tap away with the stylus, and it's awesome.
So, that was that. You can see by the YouTube video that it's all running rather nicely. There is one other thing that I wanted to touch on while I'm discussing developing for the Wiz. From what I can gather, GPH is going to set up a GP2X Wiz app store something like the Apple app store for the iPhone. This will give people a central place to download games/emulators/applications/etc. and also give developers a place to showcase their creations. I think this is a great step toward creating a community where people can easily share and find amateur creations.