aboutsummaryrefslogtreecommitdiff
path: root/backends/PalmOS/Src/arm/decompressrle7.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/PalmOS/Src/arm/decompressrle7.cpp')
-rwxr-xr-xbackends/PalmOS/Src/arm/decompressrle7.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/backends/PalmOS/Src/arm/decompressrle7.cpp b/backends/PalmOS/Src/arm/decompressrle7.cpp
new file mode 100755
index 0000000000..49976d6a95
--- /dev/null
+++ b/backends/PalmOS/Src/arm/decompressrle7.cpp
@@ -0,0 +1,27 @@
+#include "native.h"
+#include "endianutils.h"
+
+#define MAIN_TYPE CompressType
+#include "macros.h"
+
+UInt32 Screen_decompressRLE7(void *userData68KP) {
+// import variables
+ SETPTR (UInt8 * ,src );
+ SET32 (UInt32, compSize);
+ SETPTR (UInt8 * ,dest );
+// end of import
+
+ uint8 *compBufEnd = src + compSize;
+ while (src < compBufEnd) {
+ uint8 code = *src++;
+ if ((code > 127) || (code == 0))
+ *dest++ = code;
+ else {
+ code++;
+ MemSet(dest, code, *src++);
+ dest += code;
+ }
+ }
+
+ return 0;
+}