Hi, I finally did it - I got git (the glulx interpreter) to compile for android.
I know you have a version of twisty that works (mostly), but for games that don’t work in it due to the incomplete nature of its GLK, this should run them properly, besides picture display. It is nearly identical to the PC version of git with glkterm - the only change I made was to alter the non-POSIX function that converts local time to GMT time to a POSIX compliant one, so the android NDK would build it. This change is totally behind the scenes and should not be noticeable. I plan to upload a patch next time I get a chance on the computer I compiled it on, so that I am compliant with GPL.
For this to work out of the box, you need a rooted droid device and a terminal app (When I tested this in google’s android emulator, I used the program “terminal IDE”).
It should be possible to do this without rooting, but you’d have to adapt my script for running git to reflect the different paths you chose.
For convenience, the new version of the download INCLUDES ncurses and almost every terminal type definition you could possibly need, and it’s programs, like the ever-useful ‘clear’.
get a terminal app. I have had problems with “terminal emulator” on larger screens, so try “terminal IDE”.
root your phone, and enter your terminal program. type ‘su’ and allow the program to take root priveleges.
Install busybox or some other version of tar for android. I found my copy of busybox here, but it’s probably outdated:
move that file into your /system/xbin directory and run ‘chmod 06755 /system/xbin/busybox’ before continuing.
Get git-droid.tar onto your droid phone, move it (still in the tarball) to /system/
in your terminal, as root, do the following:
cd /system busybox tar xf git-droid.tar rm git-droid.tar
Get a glulx game on your droid device, and cd into it’s folder in terminal. You no longer need to be root.
If necessary, you may also include parameters for git before the game file name.
I chose to name it ‘ifgit’ here because it would interfere with the git source code repository tool included in busybox otherwise.
That’s it! enjoy!
Original, outdated instructions:
[spoiler]1. download the program and dependencies ( either from attached file or https://dl.dropboxusercontent.com/u/67595621/git-droid.tar.gz ) and extract it (windows users: 7-zip should work. OS X users: run ‘tar zxf git-droid.tar.gz’. linux users: you know what to do.)
move all of the files onto your SD card, or in some other way get the files to your droid phone.
Open your terminal on your droid phone, and cd to wherever you put the files. inside the ‘git-droid’ directory is the full structure you need to put the files into. make it so the files in ‘etc’ go inside your phones ‘/etc/’ directory, and the ones in ‘system/xbin’ go in your ‘system/xbin’ directory.
once you have finished this, ‘cd’ into /system/xbin and run ‘chmod +x git-interpreter’ and ‘chmod +x ifgit’.
Now, in order to run this, get your favorite glulx game and cd into the directory it is in. Run ‘ifgit game.gblorb’ or whatever your game is called.
IT MIGHT work better if you are having problems if you use one of the terminal setups found here:
github.com/zielmicha/emacs-andr … e/terminfo
I recommend trying vt100 or xterm.
Anyway, to use vt100, you have to edit the ‘ifgit’ file, which is a script that sets up your terminal environment for curses (the library I used). Replace the line ‘export TERM=linux’ with ‘export TERM=vt100’. for xterm, you do the same thing.[/spoiler]
I do not actually own a droid phone - I did all of this in linux with a cross-compiler for android, and tested it on google’s android emulator. This version is only aimed at ARM based droid devices, but with (i hope) minimal effort I could port it to x86 android. I know it doesn’t support graphics or sounds and it’s pretty clunky in a terminal on a phone, but I figured it was better than nothing.
I recommend ‘Terminal IDE’ over “terminal emulator” for this. For me on large screens terminal emulator is pretty crappy.
Screenshot from android emulator:
HUGE IMAGE, so wrapped in spoiler tags
This is using the glulx version of zork found at the bottom of this page:
My only patch to source code in glkterm was because of the non-POSIX timegm() function call that the android NDK doesn’t support.
In cgdate.c , everytime you see the following line:
timestamp = timegm(&tm);
Replace it with the following lines:
tz = getenv("TZ");
timestamp = mktime(&tm);
To compile ncurses for android, I had to make one change:
in include/ncurses_cfg.h :
replace the following line:
#define HAVE_LOCALE_H 1
//#define HAVE_LOCALE_H 1