aboutsummaryrefslogtreecommitdiff
path: root/backends/PalmOS/Src/arm/native.h
blob: bbbc4ab0ea381ff6a69364d2f27b2fb76f9029a2 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
#ifndef _ARMNATIVE_H_
#define _ARMNATIVE_H_

#include "arm/pnodefs.h"

#ifndef __PALM_OS__

typedef UInt8 byte;
typedef UInt8 uint8;
typedef Int32 int32;
typedef UInt32 uint32;
typedef Int16 int16;
typedef UInt16 uint16;
typedef unsigned int uint;

#endif

typedef struct {
	UInt32 funcID;
	void *dataP;
} PnoType;

typedef UInt32 (PnoProc)(void *);

enum {
	COMMON_COPYRECT = 0,
	COMMON_WPORTRAIT,
	COMMON_WLANDSCAPE,
//	COMMON_SNDBUFFER
};

enum {
	QUEEN_BLIT = 0
};

enum {
	SCUMM_DRAWSTRIP = 0,
	SCUMM_PROC3
};

enum {
	SWORD1_SCREENDRAW = 0,
	SWORD1_DRAWSPRITE,
	SWORD1_FASTSHRINK,
	SWORD1_RENDERPARALLAX,
	SWORD1_DECOMPTONY,
	SWORD1_DECOMPRLE7,
	SWORD1_DECOMPRLE0
};

// types
typedef struct {
	void *srcP;
	void *dstP;
	UInt32 length;
} ARMPa1SndType, *ARMPa1SndPtr;

typedef struct {
	void *dst;
	void *src;
} WideType;

typedef struct {
	void *dst;
	const void *buf;
	UInt32 pitch, _offScreenPitch;
	UInt32 w, h;
} CopyRectangleType;

typedef struct {
	const byte *scaletable;
	byte mask, shr;
	byte repcolor;
	byte replen;
	int scaleXstep;
	int x, y;
	int scaleXindex, scaleYindex;
	int skip_width;
	byte *destptr;
	const byte *mask_ptr;
	int imgbufoffs;
} V1CodecType;

typedef struct {
	const byte *scaletable;
	int32 mask, shr;
	int32 repcolor;
	int32 replen;
	int32 scaleXstep;
	int32 x, y;
	int32 scaleXindex, scaleYindex;
	int skip_width;
	byte *destptr;
	const byte *mask_ptr;
} V1Type;

typedef struct {
	void *v1; // struct v1 *
	const byte *revBitMask;	
	
	const byte *_srcptr;
	int _height;

	byte _scaleIndexX;		// to be redefined, return it from the function
	byte _scaleIndexY;
	byte _scaleX;
	byte _scaleY;
	int32 _numStrips;

	int _out_pitch;
	int _out_w;
	int _out_h;

	byte *_shadow_table;
	byte *_palette;
	byte _shadow_mode;
} CostumeProc3Type;

typedef struct {
	int width;
	int height;
	
	const byte *src;
	byte *dst;
	const byte *text;
	
	int _vm_screenWidth;
	uint16 vs_pitch;
	uint16 _textSurface_pitch;
} DrawStripType;

// Queen
typedef struct {
	uint8 *dstBuf;
	const uint8 *srcBuf;
	uint16 dstPitch;
	uint16 srcPitch;
	uint16 w;
	uint16 h;
	byte xflip;
	byte masked;
} BlitType;

// Sword1
typedef struct {
	uint8 *data;
	uint32 *lineIndexes;
	uint8 *_screenBuf;
	uint16 _scrnSizeX;
	uint16 scrnScrlX;
	uint16 scrnScrlY;
	uint16 paraScrlX;
	uint16 paraScrlY;
	uint16 scrnWidth;
	uint16 scrnHeight;
} ParallaxType;

typedef struct {
	uint8 *sprData;
	uint8 *dest;
	uint16 sprHeight;
	uint16 sprWidth;
	uint16 sprPitch;
	uint16 _scrnSizeX;
} DrawSpriteType;

typedef struct {
	uint8 *src;
	uint8 *dest;
	uint16 _scrnSizeX;
	uint16 _scrnSizeY;
} DrawType;

typedef struct {
	uint8 *src;
	uint8 *dest;
	uint32 width;
	uint32 height;
	uint32 scale;
} FastShrinkType;

typedef struct {
	uint8 *src;
	uint32 compSize;
	uint8 *dest;
} CompressType;

typedef struct {
	int32 samples;
	int32 len;
	int16 *buffer;
	const byte *_ptr;
	int32 is16Bit;
	int32 isUnsigned;
	int32 isLE;
} ReadBufferType;

// Warning : all the struct MUST be 4byte align and even
// from one member to another

#endif