aboutsummaryrefslogtreecommitdiff
path: root/backends/PalmOS/Src/arm/native.h
blob: a1132d2093a8ff511d5f99d82f1588276713032c (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
#ifndef _ARMNATIVE_H_
#define _ARMNATIVE_H_

#include "PNOLoader.h"

//#define DISABLE_ARM
//#define DEBUG_ARM

#ifndef __PALM_OS__

typedef UInt8 byte;
typedef UInt8 uint8;
typedef Int32 int32;
typedef UInt16 uint16;
typedef unsigned int uint;

#endif

// rsrc
enum {
	RSC_WIDELANDSCAPE = 1,
	RSC_WIDEPORTRAIT,
	RSC_COPYRECT,
	RSC_COSTUMEPROC3,
	RSC_DRAWSTRIP,
	RSC_BLIT
};

enum {
	PNO_COPYRECT = 0,
	PNO_WIDE,
	PNO_COSTUMEPROC3,
	PNO_DRAWSTRIP,
	PNO_BLIT,
	PNO_COUNT
};

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

typedef struct {
	void *proc;
	void *param;

	void	*handle;	// sound handle
	UInt32	size;		// buffer size
	UInt32	slot;
	UInt32 	active,		// is the sound handler active
			set,		// is the buffer filled
			wait;		// do we need to wait for sound completion
	void	*dataP,		// main buffer
			*tmpP;		// tmp buffer (convertion)
} SoundDataType;

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;

#endif