        }
        fclose(fp);
      } else {
-@@ -679,6 +696,14 @@
+@@ -679,6 +691,11 @@
      if (machine == MACHINE_SHARP_SL5500)
        qteRotation = 3;
  
-+    // H3900
-+    if (machine == MACHINE_HP_H3900)
++    // HP IPaq
++    if ( ODevice::inst ( )-> series ( ) == Model_iPAQ )
 +      qteRotation = 3;
-+    
-+    // H5400
-+    if (machine == MACHINE_HP_H5400)
-+      qteRotation = 3;
++
 +    
      // SL-B500 ѥϥå(Ȥꤢ)
      if (machine == MACHINE_SHARP_SLB500)

     default:
       scancode = SDLK_UNKNOWN;
       break;
Index: SDL-1.2.7/src/video/qtopia/SDL_sysvideo.cc
===================================================================
--- SDL-1.2.7.orig/src/video/qtopia/SDL_sysvideo.cc	2005-03-02 22:24:46.873009084 +0100
+++ SDL-1.2.7/src/video/qtopia/SDL_sysvideo.cc	2005-03-02 22:25:01.551935299 +0100
@@ -106,6 +106,9 @@
     MACHINE_SHARP_SLC760,
     MACHINE_SHARP_SLC860,
     MACHINE_SHARP_SL6000,
+    MACHINE_HP_H3600,
+    MACHINE_HP_H3900,
+    MACHINE_HP_H5400,
     MACHINE_MAX
   } machine_t;
 
@@ -119,6 +122,9 @@
     { "Sharp", "SL-C760", 0 },
     { "Sharp", "SL-C860", 0 },
     { "Sharp", "SL-6000", 0 },
+    { "HP", "H3600", 0},
+    { "HP", "H3900", 0},
+    { "HP", "H5400", 0},
   };
 
   /* Name of the environment variable used to invert the screen rotation or not:
@@ -423,6 +429,17 @@
           machine = MACHINE_SHARP_SLC760;
         else if (strstr(buf, "SHARP Boxer") != NULL)
           machine = MACHINE_SHARP_SLC860;
+        else if (strstr(buf, "H3600") != NULL)
+          machine = MACHINE_HP_H3600;
+        else if (strstr(buf, "H3900") != NULL)
+          machine = MACHINE_HP_H3900;
+        else if (strstr(buf, "H5400") != NULL)
+          machine = MACHINE_HP_H5400;
+	else
+          {
+          machine = MACHINE_SHARP_SL5000D;

diff -Ndru SDL-1.2.7_old/src/video/qtopia/Makefile.am SDL-1.2.7/src/video/qtopia/Makefile.am
--- SDL-1.2.7_old/src/video/qtopia/Makefile.am	2005-03-08 15:13:16.000000000 -0200
+++ SDL-1.2.7/src/video/qtopia/Makefile.am	2005-03-08 15:16:17.000000000 -0200
@@ -22,4 +22,4 @@
 # overwrite USER variables
 CXXLD = $(CC)
 CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
-	$(AM_LDFLAGS) $(LDFLAGS) -lsupc++ -o $@
+	$(AM_LDFLAGS) $(LDFLAGS) -lopiecore2 -lsupc++ -o $@
 		$(TAGS_FILES) $(LISP)
diff -Ndru SDL-1.2.7_old/src/video/qtopia/SDL_QWin.cc SDL-1.2.7/src/video/qtopia/SDL_QWin.cc
--- SDL-1.2.7_old/src/video/qtopia/SDL_QWin.cc	2005-03-08 15:13:16.000000000 -0200
+++ SDL-1.2.7/src/video/qtopia/SDL_QWin.cc	2005-03-08 15:16:17.000000000 -0200
@@ -29,8 +29,11 @@
 #include "SDL_QWin.h"
 #include <qapplication.h>
