Checkers on the OLPC

First, is there a checkers Activity? Looking at the Activities page on the OLPC wiki suggests no.   However, with the underlying Linux system, it is possible to configure an application for Linux, and then Sugarize the application to fit on the OLPC.

Where to go from here?  Well, the OLPC is not a terribly fast system.  But it is a vast improvement from systems of yesterday, my yesterday.  Earlier in life, our family computer was the well loved Commodore 64.  There was a treasure trove of games for it.

So, if you search for Commodore 64 and checkers, does anything come up?  Yes! So the trick will be to get VICE running on the OLPC using the Sugar interface.

Commodore 64 UI

The question is, are these games still relevant today?  I like to think that a better question is, are games today as relevant as the ones of yesterday?  Think about it – memory, CPU, and graphics were scarce then.  If you look at the quantity of C64 games, you’ll see that competition was fierce, even during the dawn of computing.  Play Loderunner or Jumpman on the C64 platform, and I assure you, you will be not want to stop.  This is where the pioneering innovation took place.

Build Process

The OLPC (-1) is a 32bit i586 machine, with a 400MHz CPU.  Selecting a build platform is important.  Since the G1G1 program was started in 2007, picking a distribution from around that time would be wise. To build VICE, we’ll use virtualization and Fedora 7 to create a compile host.

Fedora 7 Login

To compile VICE, we’ll use these options:


export LDFLAGS

sh ./configure                                                          


I came up with the above options after trying a few times.  The best place for the install is in /home/olpc.  Applications are called activities.  I put the rpath in place due to the fact we will probably need to add libraries.  After installing it (manually at first), I’ll see if the executable invokes:

[olpc@g1g1 ~]$ cd $HOME/Activities/VICE.activity/bin
[olpc@g1g1 bin]$ ldd x64 | grep "not found" => not found => not found => not found

So it looks as though we need to copy these files into our VICE library rpath.  Running the ldd command once more to check:

[olpc@g1g1 bin]$ ldd x64 | grep "not found" => not found

So the file has a dependency too.  After copying the library into the rpath, it comes back clean.

[olpc@g1g1 bin]$ ldd x64 | grep "not found"
[olpc@g1g1 bin]$

So now, our basic hierarchy looks like this:

[olpc@g1g1 bin]$ cd $HOME/Activities/VICE.activity
[olpc@g1g1 VICE.activity]$ ls -ald *
drwxrwxr-x 2 olpc olpc  4096 2010-09-08 14:48 bin
drwxrwxr-x 3 olpc olpc  4096 2010-09-08 14:30 lib
drwxrwxr-x 5 olpc olpc  4096 2010-09-05 13:47 share

For ease of development, I put the following Makefile in $HOME/Activities/VICE.activity:

[olpc@xo-14-64-13 VICE.activity]$ cat Makefile
ACTIVITY        :=      $(shell basename $(shell pwd) .activity)

        rm -fv $(HOME)/$(ACTIVITY).xo MANIFEST
        find ./ | sed 's,^./,$(ACTIVITY).activity/,g' > MANIFEST
        cd $(HOME)/Activities && zip -9 -r $(HOME)/$(ACTIVITY).xo $(ACTIVITY).activity

So by typing “make” while in $HOME/Activities/VICE.activity, I can then expect an
XO activity in $HOME (in this case $HOME/VICE.xo). As you can see, it also creates a MANIFEST
file as well.

Henceforth, $HOME/Activities/VICE.activity is will now be referred to $SUGAR_BUNDLE_PATH. This variable is set to whatever the running Activity is. In $SUGAR_BUNDLE_PATH, we will need an activity/ directory containing the following files: and VICE.svg (an icon).

[olpc@g1g1 VICE.activity]$ export SUGAR_BUNDLE_PATH=$HOME/Activities/VICE.activity
[olpc@g1g1 VICE.activity]$ cat $SUGAR_BUNDLE_PATH/activity/ 
name = VICE
activity_version = 1
host_version = 1
bundle_id = net.foundationlaboratories.olpc.VICE
icon = VICE
exec = bin/

Obviously we’ll need a “bin/” script as well.

[olpc@g1g1 VICE.activity]$ cat bin/
# Activity launcher for VICE.
# Variables and are taken from the X-1 Activity.  Thank you 
# Bert Freudenberg for this wonderful activity:

export PATH

# pass activity options to libsugarize
while [ -n "$2" ] ; do
    case "$1" in
        -b | --bundle-id)     export SUGAR_BUNDLE_ID="$2" ;;
        -a | --activity-id)   export SUGAR_ACTIVITY_ID="$2" ;;
        -o | --object-id)     export SUGAR_OBJECT_ID="$2" ;;
        -u | --uri)           export SUGAR_URI="$2" ;;
        *) echo unknown argument $1 $2 ;;

# set vars and dirs in case we run in jhbuild 
    && export SUGAR_BUNDLE_PATH=`dirname $0|xargs dirname`
[ -z "$SUGAR_PROFILE" ] 
    && export SUGAR_PROFILE=default

umask 0002

# sugarize
export NET_WM_NAME="VICE C64 Emulator"

x64 -VICIIdsize $*

Comments are closed.