Monday, May 4, 2009

GP2X Wiz Development (Bubble Train)

As you may have noticed, I'm a bit excited about the GP2X Wiz. I'm pretty into handheld homebrew development, so the Wiz is of particular interest to me. Judging by posts I've been reading (here and elsewhere) it is of interest to a lot of people.

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.

8 comments:

Danny X said...

Hey bro nice video, im pyched about the GP2X wiz as well, im going crazy.. I wanted to ask you something, does the TV out cables of the old GP2X work on this? it would be nice if i could use my TV as a screen when i got home ^O^

Flavor said...

That's a good question, Danny. I'm going to have to check it out. I do know that the GP2X has the same connector as the Wiz (the cable will fit in), but I don't know (yet) if they have the same functionality.

Danny X said...

wow, That be so kool....I hope it works, I would go out and buy some ^_^

Flavor said...

Danny, I tried it real quick last night, and it didn't work. I'm not 100% sure I had it set up properly, though. I'll get back to you if I find out anything new.

Danny X said...

Hey man its all good, thanks for trying ^_^ makes me a little sad, i hope the send out the GP2X Wiz tv out soon, thank alot for trying again

Anonymous said...

Anyone know what happened to the gp32x.com forums? The main page is up but there forums are gone.

Are there any other good Wiz forums around in English?

Thanks!

Flavor said...

GP32x.com had a bunch of (long-standing) problems with their boards. Hando (the owner) was finally persuaded to update the forum, and since then it's been down. Now, it looks like it came back up, but it must have had problems, because it's back down.

Personally, I'd just wait for it to come back up. I know it's sucky, but I think that's the best place to go for Gamepark discussion.

online generic viagra said...

Hi,
This post is really very interesting... Its great to be here... Thanks very much for the share.