
J2ME - PhoneMe Gp2x porting by Zaxxon

Release and Readme instructions by Eclipse (so you know who you wanna hurt for the horrible english)


- HOW TO INSTALL AND RUN A GAME

Copy the PhoneMe directory on the root of your SD. 
Inside that directory you will find two .gpe example files to be edited, there are no games in the release but just search around for a .jar game you want to try.
The files are made for a game called Diamond.jar, search it around if you want to be sure to use a game that surely works.

Then 

1) Copy your .jar file inside the phoneME directory and edit the Install_Diamond.gpe to make it fit your game.
You have to change the .jar filename if different and the log filename if you want to change it

cd /mnt/sd/phoneME/bin/arm
./installMidlet ../../Diamond.jar > ../../Diamond.installed.txt
sync
cd /usr/gp2x
exec ./gp2xmenu

2) Launch Install_Diamond.gpe (or the one you renamed), then using the gp2x ebook reader or a text editor open the .txt log.
It may show something like that:

The suite was succesfully installed, ID: 2

What you need is that ID number, in this case 2.
If the file contains error messages probably something goes wrong, check the edited file or try another game.

3) Use the obtained ID to make a .gpe file to run the game, like the Diamond.gpe included, like this

export J2ME_GP2X_JOYU=50
export J2ME_GP2X_JOYUL=49
export J2ME_GP2X_JOYL=52
export J2ME_GP2X_JOYDL=55
export J2ME_GP2X_JOYD=56
export J2ME_GP2X_JOYDR=57
export J2ME_GP2X_JOYR=54
export J2ME_GP2X_JOYUR=51
export J2ME_GP2X_START=-6
export J2ME_GP2X_SELECT=-7
export J2ME_GP2X_LEFT=-22
export J2ME_GP2X_RIGHT=48
export J2ME_GP2X_BUTA=-13
export J2ME_GP2X_BUTB=-14
export J2ME_GP2X_BUTX=-15
export J2ME_GP2X_BUTY=-16
export J2ME_GP2X_VOLU=35
export J2ME_GP2X_VOLD=42
export J2ME_GP2X_JOYC=53
cd /mnt/sd/phoneME/bin/arm
./runMidlet 2
sync
cd /usr/gp2x
exec ./gp2xmenu

As you can see, we passed 2 as argument at runMidlet.

All those ambient variables are needed to bind the gp2x keys for the game, names are self explanatory: J2ME_GP2X_JOYU for UP, J2ME_GP2X_JOYDR for joystick Down-Right (only in F100), and so on.
Here's the list of values you can use

KEYMAP_KEY_INVALID      = 0
KEYMAP_KEY_BACKSPACE    = 8
KEYMAP_KEY_POUND        = 35
KEYMAP_KEY_ASTERISK     = 42
KEYMAP_KEY_0            = 48
KEYMAP_KEY_1            = 49
KEYMAP_KEY_2            = 50
KEYMAP_KEY_3            = 51
KEYMAP_KEY_4            = 52
KEYMAP_KEY_5            = 53
KEYMAP_KEY_6            = 54
KEYMAP_KEY_7            = 55
KEYMAP_KEY_8            = 56
KEYMAP_KEY_9            = 57
KEYMAP_KEY_SPACE        = 32
KEYMAP_KEY_UP           = -1
KEYMAP_KEY_DOWN         = -2
KEYMAP_KEY_LEFT         = -3
KEYMAP_KEY_RIGHT        = -4
KEYMAP_KEY_SELECT       = -5
KEYMAP_KEY_SOFT1        = -6
KEYMAP_KEY_SOFT2        = -7
KEYMAP_KEY_CLEAR        = -8
KEYMAP_KEY_SEND         = -10
KEYMAP_KEY_END          = -11
KEYMAP_KEY_POWER        = -12 
KEYMAP_KEY_GAMEA        = -13
KEYMAP_KEY_GAMEB        = -14
KEYMAP_KEY_GAMEC        = -15
KEYMAP_KEY_GAMED        = -16
KEYMAP_KEY_GAME_UP      = -17
KEYMAP_KEY_GAME_DOWN    = -18
KEYMAP_KEY_GAME_LEFT    = -19
KEYMAP_KEY_GAME_RIGHT   = -20
KEYMAP_KEY_DEBUG_TRACE1 = -21
KEYMAP_KEY_SCREEN_ROT   = -22

It's better to always bind KEYMAP_KEY_SCREEN_ROT (-22) on a key because a lot of games for mobile are made for vertical screens. Also keep in mind that to make a playable keys configuration using the gp2x for vertical games.

Sadly, on F200 there are only 4 keys for the pad so the diagonals and the joystick click are not bindables.

- WHAT TYPES OF GAMES RUNS BETTER?

Search around for 320x240 or 240x320 games, like the ones for the N95 mobile.


HOW TO COMPILE YOUR OWN VERSION

1) Download the original PhoneMe sources from Sun: http://download.java.net/mobileembedded/phoneme/feature/phoneme_feature-mr2-rel-src-b23-08_may-2007.zip

2) Make in your own home directory a new one called "phoneME".

3) Copy there the PhoneME sources, you need to have a "phoneme_feature" subdirectory.

4) Unzip the patch inside "phoneME" to have the file "GP2X_phoneME.patch".

5) From console, inside "phoneME" digit patch -p1 GP2X_phoneME.patch.

6) Make executable the script "compile.sh" using the command chmod a+x compile.sh.

7) Run the script with ./compile.sh.

8) cross your fingers and wait

9) At the end the only directories you need to copy on the SD are
~/phoneME/phoneme_feature/build_output/midp/appdb
~/phoneME/phoneme_feature/build_output/midp/bin
~/phoneME/phoneme_feature/build_output/midp/lib
 
- THIS PROJECTS NEEDS YOU!

Unluckly Zaxxon have no time to do other releases, so this code needs mantainers, if you're interested in this project and you think you can improve it, try to do a release! All the gp2x community will be grateful to your efforts.