--- /dev/null
+/**********
+ * 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;
+}
**********/
#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"
}
}
+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;
}