aboutsummaryrefslogtreecommitdiff
path: root/backends/PalmOS/Src/arm/decompressrle0.cpp
blob: d6ac2d6c80fec936941ba649fe27c94fdb2e2ca9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "native.h"
#include "endianutils.h"

#define MAIN_TYPE	CompressType
#include "macros.h"

UInt32 Screen_decompressRLE0(void *userData68KP) {
// import variables
	SETPTR	(uint8 *	,src	);
	SET32	(uint32		,compSize);
	SETPTR	(uint8 *	,dest	);
// end of import

	uint8 *srcBufEnd = src + compSize;
	while (src < srcBufEnd) {
		uint8 color = *src++;
		if (color) {
			*dest++ = color;
		} else {
			uint8 skip = *src++;
			MemSet(dest, skip, 0);
			dest += skip;
		}
	}
	
	return 0;
}