diff -ru -N xjump-2.7.5/game.c wiixjump/game.c
--- xjump-2.7.5/game.c	1997-10-28 11:22:50.000000000 +0100
+++ wiixjump/game.c	2008-05-08 16:20:30.000000000 +0200
@@ -185,7 +185,7 @@
       Hero.pic ^= 1;
     }
 
-    if( Key[ KEY_UP ] ){
+    if( up() ){
       Hero.jump = abs(Hero.vx)/4+7;
       Hero.vy = -Hero.jump/2-12;
       Hero.pic = 2;
@@ -197,12 +197,12 @@
     floor = 0;
   }
 
-  if( Key[ KEY_LEFT ] ){
+  if( left() ){
     Hero.vx -= acc;
     if( Hero.vx < -32 )
       Hero.vx = -32;
     Hero.dir = 0;
-  }else if( Key[ KEY_RIGHT ] ){
+  }else if( right() ){
     Hero.vx += acc;
     if( Hero.vx > 32 )
       Hero.vx = 32;
@@ -219,7 +219,7 @@
   if( !st ){
     if( Hero.jump ){
       Hero.vy = -Hero.jump/2-12;
-      if( Key[ KEY_UP ] )
+      if( up() )
 	Hero.jump--;
       else
 	Hero.jump = 0;
diff -ru -N xjump-2.7.5/main.c wiixjump/main.c
--- xjump-2.7.5/main.c	1999-08-20 05:47:44.000000000 +0200
+++ wiixjump/main.c	2008-05-08 16:20:30.000000000 +0200
@@ -6,6 +6,7 @@
   (C) Oct 28, 1997  ROYALPANDA
 *****************************************/
 
+#include <stdlib.h>
 #include<stdio.h>
 #include<unistd.h>
 #include<limits.h>
@@ -21,6 +22,7 @@
 
 #include"xjump.h"
 #include"record.h"
+#include "wiimote.h"
 
 #include"picture.xpm"
 #include"icon.xbm"
@@ -540,6 +542,8 @@
 
   option( argc,argv );
 
+  wiimote_init(argc, argv);
+
   seteuid( uid );
 
   game = XtVaCreateManagedWidget( "game",formWidgetClass,Top,NULL );
diff -ru -N xjump-2.7.5/Makefile wiixjump/Makefile
--- xjump-2.7.5/Makefile	2002-01-24 12:44:14.000000000 +0100
+++ wiixjump/Makefile	2008-05-08 16:20:30.000000000 +0200
@@ -27,21 +27,24 @@
 
 ##########################################################
 
-xjump : main.o game.o key.o misc.o record.o resource.o
+xjump : main.o game.o key.o misc.o record.o resource.o wiimote.o
 	$(CC) -o xjump \
-		main.o game.o key.o misc.o record.o resource.o\
-		-lXaw -lXmu -lXt -lXpm -lXext -lX11 $(LDIR)
+		main.o game.o key.o misc.o record.o resource.o wiimote.o\
+		-lXaw -lXmu -lXt -lXpm -lXext -lX11 -lcwiid -lm $(LDIR)
 
-main.o : main.c xjump.h record.h \
+main.o : main.c xjump.h record.h wiimote.h\
 		picture.xpm icon.xbm icon_msk.xbm Makefile
 	$(CC) -c -DRECORD_ENTRY=$(RECORD_ENTRY) main.c $(IDIR)
 
 resource.o : resource.c
 	$(CC) -c resource.c
 
-game.o : game.c xjump.h
+game.o : game.c xjump.h wiimote.h
 	$(CC) -c game.c $(IDIR)
 
+wiimote.o : wiimote.c xjump.h wiimote.h
+	$(CC) -c wiimote.c $(IDIR)
+
 key.o : key.c xjump.h
 	$(CC) -c key.c $(IDIR)
 
diff -ru -N xjump-2.7.5/record.h wiixjump/record.h
--- xjump-2.7.5/record.h	1997-07-17 05:09:03.000000000 +0200
+++ wiixjump/record.h	2008-05-08 16:20:30.000000000 +0200
@@ -6,6 +6,7 @@
   (C) July 16, 1997  ROYALPANDA
 *****************************************/
 
+#include <string.h>
 
 typedef struct {
 
diff -ru -N xjump-2.7.5/wiimote.c wiixjump/wiimote.c
--- xjump-2.7.5/wiimote.c	1970-01-01 01:00:00.000000000 +0100
+++ wiixjump/wiimote.c	2008-05-08 16:20:30.000000000 +0200
@@ -0,0 +1,104 @@
+#include "wiimote.h"
+
+void wiimote_init(int argc, char **argv) {
+  bdaddr_t bdaddr;
+  if (argc > 1) {
+    str2ba(argv[1], &bdaddr);
+  }
+  else {
+    bdaddr = *BDADDR_ANY;
+  }
+
+  printf("Put Wiimote in discoverable mode now (press 1+2)...\n");
+  if (!(wiimote = cwiid_open(&bdaddr, 0))) {
+    fprintf(stderr, "Unable to connect to wiimote\n");
+    exit(-1);
+  }
+  wiimote_update();
+  printf("Battery: %i%%\n", state.battery);
+/*   printf("Battery: %i%%\n", (int)(100.0 * state.battery / CWIID_BATTERY_MAX)); */
+
+  cwiid_get_acc_cal(wiimote, CWIID_EXT_NONE, &cal);
+
+  toggle_bit(led_state, CWIID_LED1_ON);
+  set_led_state(wiimote, led_state);
+
+  toggle_bit(rpt_mode, CWIID_RPT_BTN);
+  set_rpt_mode(wiimote, rpt_mode);
+
+  toggle_bit(rpt_mode, CWIID_RPT_ACC);
+  set_rpt_mode(wiimote, rpt_mode);
+
+}
+
+void wiimote_update(void) {
+  cwiid_get_state(wiimote, &state);
+}
+
+int up(void) {
+/*   wiimote_update(); */
+/*   return (state.buttons & CWIID_BTN_B); */
+
+  wiimote_move();
+  return (wii_move.pitch < -0.3);
+}
+
+int right(void) {
+/*   wiimote_update(); */
+/*   return (state.buttons & CWIID_BTN_RIGHT); */
+
+  wiimote_move();
+  return (wii_move.roll < -0.3);
+}
+
+int left(void) {
+/*   wiimote_update(); */
+/*   return (state.buttons & CWIID_BTN_LEFT); */
+
+  wiimote_move();
+  return (wii_move.roll > 0.3);
+}
+
+void set_led_state(cwiid_wiimote_t *wiimote, unsigned char led_state)
+{
+    if (cwiid_set_led(wiimote, led_state)) {
+        fprintf(stderr, "Error setting LEDs \n");
+    }
+}
+
+void set_rpt_mode(cwiid_wiimote_t *wiimote, unsigned char rpt_mode)
+{
+    if (cwiid_set_rpt_mode(wiimote, rpt_mode)) {
+        fprintf(stderr, "Error setting report mode\n");
+    }
+}
+
+void wiimote_move() {
+  double a_x, a_y, a_z, a;
+  double roll, pitch;
+
+  wiimote_update();
+
+  a_x = ((double)state.acc[CWIID_X] - cal.zero[CWIID_X]) /
+    (cal.one[CWIID_X] - cal.zero[CWIID_X]);
+  a_y = ((double)state.acc[CWIID_Y] - cal.zero[CWIID_Y]) /
+    (cal.one[CWIID_Y] - cal.zero[CWIID_Y]);
+  a_z = ((double)state.acc[CWIID_Z] - cal.zero[CWIID_Z]) /
+    (cal.one[CWIID_Z] - cal.zero[CWIID_Z]);
+  a = sqrt(pow(a_x,2)+pow(a_y,2)+pow(a_z,2));
+
+  roll = atan(a_x/a_z);
+  if (a_z <= 0.0) {
+    roll += M_PI * ((a_x > 0.0) ? 1 : -1);
+  }
+  roll *= -1;
+
+  pitch = atan(a_y/a_z*cos(roll));
+
+  wii_move.acc_x = a_x;
+  wii_move.acc_y = a_y;
+  wii_move.acc_z = a_z;
+  wii_move.acc = a;
+  wii_move.roll = roll;
+  wii_move.pitch = pitch;
+}
diff -ru -N xjump-2.7.5/wiimote.h wiixjump/wiimote.h
--- xjump-2.7.5/wiimote.h	1970-01-01 01:00:00.000000000 +0100
+++ wiixjump/wiimote.h	2008-05-08 16:20:30.000000000 +0200
@@ -0,0 +1,36 @@
+#include <stdlib.h>
+#include <math.h>
+#include <cwiid.h>
+
+#define toggle_bit(bf,b)    \
+    (bf) = ((bf) & b)       \
+           ? ((bf) & ~(b))  \
+           : ((bf) | (b))
+
+struct move_state {
+  double acc_x;
+  double acc_y;
+  double acc_z;
+  double acc;
+  double roll;
+  double pitch;
+};
+
+static cwiid_wiimote_t *wiimote;
+static struct cwiid_state state;
+static struct move_state wii_move;
+static unsigned char led_state = 0;
+static unsigned char rpt_mode = 0;
+static struct acc_cal cal;
+
+void wiimote_init(int, char**);
+void wiimote_update(void);
+void wiimote_move(void);
+
+void set_led_state(cwiid_wiimote_t*, unsigned char);
+void set_rpt_mode(cwiid_wiimote_t*, unsigned char);
+
+int up(void);
+int right(void);
+int left(void);
+
