]> asedeno.scripts.mit.edu Git - pssh.git/commitdiff
My 2007-03-18 release:
authorAlejandro R. Sedeño <asedeno@mit.edu>
Sun, 18 Mar 2007 18:55:04 +0000 (18:55 +0000)
committerAlejandro R. Sedeño <asedeno@mit.edu>
Sun, 18 Mar 2007 18:55:04 +0000 (18:55 +0000)
* Fix up/down on the 5-way navigator for the Treo 700p.
* Begin exporting code from formsres to native arm.

arm/Makefile
arm/crypto/rand.c
arm/export-list
arm/forms/form_armcalls.c [new file with mode: 0644]
forms/terminalform.c

index 4afaf1d0cdd3433a2d1f51f1042edfdab0770516..7d369de075172dd9d14c8dcf906e9eceb6ed8a74 100644 (file)
@@ -59,11 +59,17 @@ VT100_SRCS = $(addprefix vt100/, \
        vt100.c vt100_armcalls.c terminal.c \
 )
 
+# form stuff
+FORM_SRCS = $(addprefix forms/, \
+       form_armcalls.c \
+)
+
+
 # Palm data
 DATA_SRCS = data/prefs.c
 
 # Everything ARM
-C_SRCS = $(VT100_SRCS) $(DATA_SRCS) $(UTIL_SRCS) $(CRYPTO_SRCS) $(SSH_SRCS) $(PEAL_SRCS)
+C_SRCS = $(VT100_SRCS) $(DATA_SRCS) $(UTIL_SRCS) $(CRYPTO_SRCS) $(FORM_SRCS) $(SSH_SRCS) $(PEAL_SRCS)
 ASM_SRCS = crypto/rand_time.S
 SRCS = $(C_SRCS) $(ASM_SRCS)
 
index 894e74cb85913dca61719770723e58d38a27301b..563779e84719eada8c9a1401a38bbf502e8dbe09 100644 (file)
@@ -137,7 +137,7 @@ void RAND_init(void)
         if (!rng) rng = fortuna_create();
 
         if (useARMTime == -1) {
-            // use ARM time code on Tungsten C only
+            // use ARM time code on Tungsten C or Treo 650
             uint32_t companyID = 0;
             uint32_t deviceID = 0;
             FtrGet(sysFtrCreator, sysFtrNumOEMCompanyID, &companyID);
@@ -146,7 +146,7 @@ void RAND_init(void)
            {
                 useARMTime = 1;
            }
-           else if (deviceID == 'H102')
+           else if (companyID == 'hspr' && deviceID == 'H102')// Treo 650
            {
                 useARMTime = 2;
            }
index 38341f83b9ff348819ab22d10d63dcb6dfe74d0c..b0fda3ed0fd2e6aabdb85020baba275a13bbdc7a 100644 (file)
@@ -92,3 +92,5 @@ zlib_compress_block_stub
 zlib_decompress_init_stub
 zlib_decompress_cleanup_stub
 zlib_decompress_block_stub
+
+CheckDeviceTreo_stub
\ No newline at end of file
diff --git a/arm/forms/form_armcalls.c b/arm/forms/form_armcalls.c
new file mode 100644 (file)
index 0000000..5801391
--- /dev/null
@@ -0,0 +1,59 @@
+/**********
+ * Copyright (c) 2007 Alejandro R Sedeno.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ **********/
+
+#include "includes.h"
+#include "pealstub.h"
+
+/*
+void dbg_beep(int, int);
+void dbg_beep(int hz, int ms)
+{
+     SndCommandType snd;
+     UInt16 volume = PrefGetPreference(prefGameSoundVolume);
+     snd.cmd = sndCmdFreqDurationAmp;
+     snd.reserved = 0;
+     snd.param1 = hz; // frequency in Hz
+     snd.param2 = ms; // duration in ms
+     snd.param3 = volume; // volume [0..sndMaxAmp]
+     SndDoCmd(NULL, &snd, false);
+}
+*/
+
+uint32_t CheckDeviceTreo_stub(uint32_t *);
+uint32_t CheckDeviceTreo_stub(uint32_t *param)
+{
+     uint32_t companyID = 0;
+     uint32_t deviceID = 0;
+     FtrGet(sysFtrCreator, sysFtrNumOEMCompanyID, &companyID);
+     FtrGet(sysFtrCreator, sysFtrNumOEMDeviceID, &deviceID);
+
+     if (((companyID == 'hspr') &&
+         (deviceID == 'H101' || deviceID == 'H102')) ||
+        (companyID == 'Palm' && deviceID == 'D052'))
+     {
+         return 1;
+     }
+     return 0;
+}
index b82e165414fc4b262b90de26bff372d6af18c71c..e9f60beb0b6d702112c20f527237d6ab3f8c194a 100644 (file)
@@ -23,7 +23,9 @@
  **********/
 
 #include "includes.h"
-#include "about.h"
+#include "armstubs.h"
+#include "peal.h"
+#include "forms/about.h"
 #include "formutils.h"
 #include "data/connectionlist.h"
 #include "data/prefs.h"
@@ -1465,26 +1467,22 @@ static void SetScrollBar(FormPtr frmP, SetScrollBarEventType *se)
     }
 }
 
+uint32_t CheckDeviceTreo(void)
+{
+    static void *sym = NULL;
+    if (!sym) sym = PealLookupSymbol(arm_module, __FUNCTION__ "_stub");
+    if (!sym) fatal("no ARM symbol %s", __FUNCTION__ "_stub");
+    return (uint32_t) PealCall(arm_module, sym, NULL);
+       
+}
 
 static void CheckDevice(void)
 {
-    UInt32 deviceID;
-    UInt32 companyID;
-    UInt32 version;
-
     static Boolean deviceChecked = false;
-
     if (deviceChecked) return;
 
-
-    // Look for Treo 600 and 650 (for keyboard tweaks)
-    if (FtrGet(sysFtrCreator, sysFtrNumOEMDeviceID, &deviceID) == 0  &&
-        FtrGet(sysFtrCreator, sysFtrNumOEMCompanyID, &companyID) == 0)
-    {
-        deviceTreo6x0 = (companyID == 'hspr'  &&  
-                         (deviceID == 'H101' || deviceID == 'H102'));
-    }
-        
+    // Look for Treo 600, 650, 700p (for keyboard tweaks)
+    deviceTreo6x0 = CheckDeviceTreo();
     deviceChecked = true;
 }