aboutsummaryrefslogtreecommitdiff
path: root/backends/PalmOS
diff options
context:
space:
mode:
Diffstat (limited to 'backends/PalmOS')
-rw-r--r--backends/PalmOS/Src/i_zodiac.cpp37
1 files changed, 36 insertions, 1 deletions
diff --git a/backends/PalmOS/Src/i_zodiac.cpp b/backends/PalmOS/Src/i_zodiac.cpp
index ef5767fa72..f15d83516f 100644
--- a/backends/PalmOS/Src/i_zodiac.cpp
+++ b/backends/PalmOS/Src/i_zodiac.cpp
@@ -2,5 +2,40 @@
#include "extend.h"
#ifndef DISABLE_TAPWAVE
-// Tapwave code will come here
+
+#include "tapwave.h"
+#include "i_zodiac.h"
+
+// _twBmpV3 = offscreen bitmap, must be set before this call
+Err ZodiacInit(void **ptrP, Int32 w, Int32 h) {
+ Err e;
+
+ TwGfxSurfaceInfoType surface = {
+ sizeof(TwGfxSurfaceInfoType),
+ w, h, w * 2,
+ twGfxLocationAcceleratorMemory,
+ twGfxPixelFormatRGB565_LE
+ };
+
+ e = SysSetOrientation(sysOrientationLandscape);
+ e = TwGfxOpen((TwGfxType **)&_twGfxLib, NULL);
+ e = TwGfxAllocSurface( (TwGfxType *)_twGfxLib,
+ (TwGfxSurfaceType **)&_twSrc,
+ &surface);
+
+ e = TwGfxGetPalmDisplaySurface( (TwGfxType *)_twGfxLib,
+ (TwGfxSurfaceType **)&_twDst);
+
+ return e;
+}
+
+Err ZodiacRelease(void **ptrP) {
+ Err e = errNone;
+
+ TwGfxFreeSurface((TwGfxSurfaceType *)_twSrc);
+ TwGfxClose((TwGfxType *)_twGfxLib);
+
+ return e;
+}
+
#endif