summaryrefslogtreecommitdiff
path: root/hardwire/piecemap.h
blob: 1844663b3947d67632a09f375da4d1ccc162eca2 (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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222

/*
	Define TETRIS mode piece maps

	Object types :

	    SPECIAL	
	    CROSS
	    UPDOWN
	    ACROSS
	    LEFTDOWN
	    RIGHTDOWN
	    LEFTUP
	    RIGHTUP
	    BLANK

*/

#define NO_TETRIS_PIECE		7

#define NO_PIECE_SET		11

#define TOP_PS			0
#define BOT_PS			1
#define LFT_PS			2
#define RGT_PS			3
#define L_R_PS			4
#define U_D_PS			5
#define CRS_PS			6
#define L_U_PS			7
#define L_D_PS			8
#define R_U_PS			9
#define R_D_PS			10

PieceSet	piece_set[NO_PIECE_SET]=
			{
			    {		/* TOP_PS */
			     	4,
				{UPDOWN,CROSS,LEFTDOWN,RIGHTDOWN,BLANK}
			    },

			    {		/* BOT_PS */
			     	4,
				{UPDOWN,CROSS,LEFTUP,RIGHTUP,BLANK}
			    },

			    {		/* LFT_PS */
			     	4,
				{ACROSS,CROSS,RIGHTDOWN,RIGHTUP,BLANK}
			    },

			    {		/* RGT_PS */
			     	4,
				{ACROSS,CROSS,LEFTDOWN,LEFTUP,BLANK}
			    },

			    {		/* L_R_PS */
			     	2,
				{ACROSS,CROSS,BLANK,BLANK,BLANK}
			    },

			    {		/* U_D_PS */
			     	2,
				{UPDOWN,CROSS,BLANK,BLANK,BLANK}
			    },

			    {		/* CRS_PS */
			     	1,
				{CROSS,BLANK,BLANK,BLANK,BLANK}
			    },

			    {		/* L_U_PS */
			     	2,
				{LEFTUP,CROSS,BLANK,BLANK,BLANK}
			    },

			    {		/* L_D_PS */
			     	2,
				{LEFTDOWN,CROSS,BLANK,BLANK,BLANK}
			    },

			    {		/* R_U_PS */
			     	2,
				{RIGHTUP,CROSS,BLANK,BLANK,BLANK}
			    },

			    {		/* R_D_PS */
			     	2,
				{RIGHTDOWN,CROSS,BLANK,BLANK,BLANK}
			    }
			};


Piece	tetris_map[NO_TETRIS_PIECE]=
	    {
		{	/* PIECE 1  - LONG */
		    0,0,
		    {
			{BLANK,		TOP_PS,		BLANK,		BLANK},
			{BLANK,		U_D_PS,		BLANK,		BLANK},
			{BLANK,		U_D_PS,		BLANK,		BLANK},
			{BLANK,		BOT_PS,		BLANK,		BLANK},
		    }
		},
		{	/* PIECE 2  - BOX */
		    0,0,
		    {
			{CRS_PS,	CRS_PS,		BLANK,		BLANK},
			{CRS_PS,	CRS_PS,		BLANK,		BLANK},
			{BLANK,		BLANK,		BLANK,		BLANK},
			{BLANK,		BLANK,		BLANK,		BLANK},
		    }
		},
		{	/* PIECE 3  - TEE */
		    0,0,
		    {
			{BLANK,		TOP_PS,		BLANK,		BLANK},
			{LFT_PS,	CRS_PS,		RGT_PS,		BLANK},
			{BLANK,		BLANK,		BLANK,		BLANK},
			{BLANK,		BLANK,		BLANK,		BLANK},
		    }
		},
		{	/* PIECE 4  - LEFT DOGLEG */
		    0,0,
		    {
			{LFT_PS,	L_D_PS,		BLANK,		BLANK},
			{BLANK,		U_D_PS,		BLANK,		BLANK},
			{BLANK,		U_D_PS,		BLANK,		BLANK},
			{BLANK,		BLANK,		BLANK,		BLANK},
		    }
		},
		{	/* PIECE 5  - RIGHT DOGLEG */
		    0,0,
		    {
			{BLANK,		R_D_PS,		RGT_PS,		BLANK},
			{BLANK,		U_D_PS,		BLANK,		BLANK},
			{BLANK,		U_D_PS,		BLANK,		BLANK},
			{BLANK,		BLANK,		BLANK,		BLANK},
		    }
		},
		{	/* PIECE 6  - LEFT S */
		    0,0,
		    {
			{LFT_PS,	L_D_PS,		BLANK,		BLANK},
			{BLANK,		R_U_PS,		RGT_PS,		BLANK},
			{BLANK,		BLANK,		BLANK,		BLANK},
			{BLANK,		BLANK,		BLANK,		BLANK},
		    }
		},
		{	/* PIECE 7  - RIGHT S */
		    0,0,
		    {
			{BLANK,		R_D_PS,		RGT_PS,		BLANK},
			{LFT_PS,	L_U_PS,		BLANK,		BLANK},
			{BLANK,		BLANK,		BLANK,		BLANK},
			{BLANK,		BLANK,		BLANK,		BLANK},
		    }
		}
	    };


struct
	{
	int	x,y;
	} tetris_off[NO_TETRIS_PIECE][4]=
		{
		    {	/* PIECE 1  - LONG */
		    	{1,1},
		    	{1,1},
		    	{2,1},
		    	{1,2}
		    },
		    {	/* PIECE 2  - BOX */
		    	{0,0},
		    	{2,0},
		    	{2,2},
		    	{0,2}
		    },
		    {	/* PIECE 3  - TEE */
		    	{1,1},
		    	{2,1},
		    	{2,2},
		    	{1,2}
		    },
		    {	/* PIECE 4  - LEFT DOGLEG */
		    	{1,1},
		    	{2,1},
		    	{2,2},
		    	{1,2}
		    },
		    {	/* PIECE 5  - RIGHT DOGLEG */
		    	{1,1},
		    	{2,1},
		    	{2,2},
		    	{1,2}
		    },
		    {	/* PIECE 6  - LEFT S */
		    	{1,1},
		    	{2,1},
		    	{2,2},
		    	{1,2}
		    },
		    {	/* PIECE 7  - RIGHT S */
		    	{1,1},
		    	{2,1},
		    	{2,2},
		    	{1,2}
		    }
		};



int	tetris_height[NO_TETRIS_PIECE]=
		{
		    4,			/* PIECE 1  - LONG */
		    2,			/* PIECE 2  - BOX */
		    2,			/* PIECE 3  - TEE */
		    3,			/* PIECE 4  - LEFT DOGLEG */
		    3,			/* PIECE 5  - RIGHT DOGLEG */
		    2,			/* PIECE 6  - LEFT S */
		    2			/* PIECE 7  - RIGHT S */
		};