aboutsummaryrefslogtreecommitdiff
path: root/backends/PalmOS
diff options
context:
space:
mode:
authorChris Apers2006-02-26 12:32:07 +0000
committerChris Apers2006-02-26 12:32:07 +0000
commit45e72e7e60883842aaab93ca6e08ba477368d01b (patch)
tree5e0969bdc4e8b8562da58912233f4ca33b4341a4 /backends/PalmOS
parent73af2a69384374ade9c0552d29cea9803db235bf (diff)
downloadscummvm-rg350-45e72e7e60883842aaab93ca6e08ba477368d01b.tar.gz
scummvm-rg350-45e72e7e60883842aaab93ca6e08ba477368d01b.tar.bz2
scummvm-rg350-45e72e7e60883842aaab93ca6e08ba477368d01b.zip
DIA functions required by T3
svn-id: r20909
Diffstat (limited to 'backends/PalmOS')
-rwxr-xr-xbackends/PalmOS/Src/native/oscalls.cpp47
-rwxr-xr-xbackends/PalmOS/Src/native/oscalls.h40
-rwxr-xr-xbackends/PalmOS/Src/native/pace.h102
3 files changed, 189 insertions, 0 deletions
diff --git a/backends/PalmOS/Src/native/oscalls.cpp b/backends/PalmOS/Src/native/oscalls.cpp
new file mode 100755
index 0000000000..4520d81c20
--- /dev/null
+++ b/backends/PalmOS/Src/native/oscalls.cpp
@@ -0,0 +1,47 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2001 Ludvig Strigeus
+ * Copyright (C) 2001-2006 The ScummVM project
+ * Copyright (C) 2002-2006 Chris Apers - PalmOS Backend
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include <PenInputMgr.h>
+#include "pace.h"
+
+GlobalsType global;
+
+
+PACE_CLASS_WRAPPER(Err)
+ StatShow_68k(void) {
+ PACE_PIN_EXEC_NP(pinStatShow, Err)
+}
+
+PACE_CLASS_WRAPPER(Err)
+ StatHide_68k(void) {
+ PACE_PIN_EXEC_NP(pinStatHide, Err)
+}
+
+PACE_CLASS_WRAPPER(Err)
+ PINSetInputAreaState_68k(UInt16 state) {
+ PACE_PARAMS_INIT()
+ PACE_PARAMS_ADD16(state)
+ PACE_PARAMS_END()
+ PACE_PIN_EXEC(pinPINSetInputAreaState, Err)
+}
diff --git a/backends/PalmOS/Src/native/oscalls.h b/backends/PalmOS/Src/native/oscalls.h
new file mode 100755
index 0000000000..ae8f989337
--- /dev/null
+++ b/backends/PalmOS/Src/native/oscalls.h
@@ -0,0 +1,40 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2001 Ludvig Strigeus
+ * Copyright (C) 2001-2006 The ScummVM project
+ * Copyright (C) 2002-2006 Chris Apers - PalmOS Backend
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef _OSCALLS_H_
+#define _OSCALLS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+Err StatShow_68k();
+Err StatHide_68k();
+Err PINSetInputAreaState_68k(UInt16 state);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/backends/PalmOS/Src/native/pace.h b/backends/PalmOS/Src/native/pace.h
new file mode 100755
index 0000000000..a617e8a274
--- /dev/null
+++ b/backends/PalmOS/Src/native/pace.h
@@ -0,0 +1,102 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2001 Ludvig Strigeus
+ * Copyright (C) 2001-2006 The ScummVM project
+ * Copyright (C) 2002-2006 Chris Apers - PalmOS Backend
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef PACE_H
+#define PACE_H
+
+#include <PceNativeCall.h>
+//#include "endianutils.h"
+
+// local definition of the emulation state structure
+typedef struct {
+ UInt32 instr;
+ UInt32 regData[8];
+ UInt32 regAddress[8];
+ UInt32 regPC;
+} EmulStateType;
+
+typedef struct {
+ EmulStateType *emulStateP;
+ Call68KFuncType *call68KFuncP;
+} GlobalsType;
+
+extern GlobalsType global;
+
+// TODO : check this, already defined in ARMlet_Runtime
+//extern EmulStateType *g_emulStateP;
+//extern Call68KFuncType *g_call68KFuncP;
+#define g_emulStateP global.emulStateP
+#define g_call68KFuncP global.call68KFuncP
+
+
+#ifdef __cplusplus
+# define PACE_CLASS_WRAPPER(rv) extern "C" rv
+#else
+# define PACE_CLASS_WRAPPER(rv) rv
+#endif
+#define PACE_CALLBACK_PTR g_call68KFuncP
+#define PACE_EMULSTATE g_emulStateP
+
+#define ALIGN_4BYTE(addr) (((UInt32)(addr) + 3) & 0xFFFFFFFC)
+
+/****** TAKEN FROM PACEInteface.cpp (ARMlet_Runtime) ******/
+// local definition of the emulation state structure
+
+#define PACE_PARAMS_INIT() \
+ UInt8 params[] = {
+
+#define PACE_PARAMS_ADD8(param) \
+ (UInt8)(param), \
+ 0,
+
+#define PACE_PARAMS_ADD16(param) \
+ (UInt8)((UInt16)(param) >> 8), \
+ (UInt8)(param),
+
+#define PACE_PARAMS_ADD32(param) \
+ (UInt8)((UInt32)(param) >> 24), \
+ (UInt8)((UInt32)(param) >> 16), \
+ (UInt8)((UInt32)(param) >> 8), \
+ (UInt8)(param),
+
+#define PACE_PARAMS_END() \
+ };
+
+// PIN
+#define PACE_PIN_EXEC_NP(pinTrap, returnType) \
+ PACE_EMULSTATE->regData[2] = pinTrap; \
+ return ((returnType)((PACE_CALLBACK_PTR)( \
+ static_cast<void *>(PACE_EMULSTATE), \
+ PceNativeTrapNo(sysTrapPinsDispatch), \
+ NULL, 0)));
+
+#define PACE_PIN_EXEC(pinTrap, returnType) \
+ PACE_EMULSTATE->regData[2] = pinTrap; \
+ return ((returnType)((PACE_CALLBACK_PTR)( \
+ static_cast<void *>(PACE_EMULSTATE), \
+ PceNativeTrapNo(sysTrapPinsDispatch), \
+ &params, \
+ sizeof(params))));
+
+#endif \ No newline at end of file