aboutsummaryrefslogtreecommitdiff
path: root/backends/PalmOS/Src/arm/wideportrait.cpp
blob: 7ee0af034a035a4b62752f260b983f6d839327e5 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "native.h"
#include "endianutils.h"
#include "../shared.h"

#define MAIN_TYPE	WideType
#include "macros.h"

UInt32 OSystem_updateScreen_widePortrait(void *userData68KP) {
// import variables
	SETPTR(UInt8 *	,dst)
	SETPTR(UInt8 *	,src)
// end of import

	Coord x, y;
	UInt8 *src2	= src;

	for (x = 0; x < WIDE_HALF_WIDTH; x++) {
		for (y = 0; y < WIDE_HALF_HEIGHT; y++) {
			*dst++ = *src;
			src += WIDE_PITCH;
			*dst++ = *src;
			*dst++ = *src;
			src += WIDE_PITCH;
		}
		src = --src2;
		dst += 20; // we draw 200pix scaled to 1.5 = 300, screen width=320, so next is 20

		for (y = 0; y < WIDE_HALF_HEIGHT; y++) {
			*dst++ = *src;
			src += WIDE_PITCH;
			*dst++ = *src;
			*dst++ = *src;
			src += WIDE_PITCH;
		}
		src = --src2;
		dst += 20;

		MemMove(dst, dst - WIDE_PITCH, 300);	// 300 = 200 x 1.5
		dst += WIDE_PITCH;
	}
	
	return 0;
}