summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/vsystem_spr2.c
blob: 70eea6766a462c9176c681417e2cb01727aafaf1 (plain) (blame)
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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
// Video System Sprites (type 2)
// todo:
//  move various vsystem sprite functions here
//  unify common ones + convert to device

//  this is probably the VS 8904/8905 combo

// Spinal Breakers
// Power Spikes
// Karate Blazers
// Turbo Force
// Aero Fighters (older hardware types)
// World Beach Championships 97 (modern Power Spikes bootleg, not original hw)
// Welltris
// Formula 1 Grand Prix (1)
// Pipe Dream


#include "emu.h"
#include "vsystem_spr2.h"


const device_type VSYSTEM_SPR2 = &device_creator<vsystem_spr2_device>;

vsystem_spr2_device::vsystem_spr2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
	: device_t(mconfig, VSYSTEM_SPR2, "vsystem_spr2_device", tag, owner, clock)
{
}



void vsystem_spr2_device::device_start()
{

}

void vsystem_spr2_device::device_reset()
{

}


int vsystem_spr2_device::get_sprite_attributes(UINT16* ram)
{
	// sprite is disabled
	if (!(ram[2] & 0x0080))
		return 0;

	curr_sprite.oy    =  (ram[0] & 0x01ff);
	curr_sprite.zoomy =  (ram[0] & 0xf000) >> 12;

	curr_sprite.ox =     (ram[1] & 0x01ff);
	curr_sprite.zoomx =  (ram[1] & 0xf000) >> 12;

	curr_sprite.xsize =  (ram[2] & 0x0700) >> 8;
	curr_sprite.flipx =  (ram[2] & 0x0800);

	curr_sprite.ysize =  (ram[2] & 0x7000) >> 12;
	curr_sprite.flipy =  (ram[2] & 0x8000);

	curr_sprite.color =  (ram[2] & 0x000f);
	curr_sprite.pri =    (ram[2] & 0x0010);

	curr_sprite.map =    (ram[3]);

	return 1;
}



template<class _BitmapClass>
void vsystem_spr2_device::turbofrc_draw_sprites_common( UINT16* spriteram3,  int spriteram3_bytes, UINT16* spriteram1, int spriteram1_bytes, int sprite_gfx, int spritepalettebank, running_machine &machine, _BitmapClass &bitmap, const rectangle &cliprect, int chip_disabled_pri )
{
	int attr_start, base, first;
	base = 0;//chip * 0x0200;
	first = 4 * spriteram3[0x1fe + base];

	for (attr_start = base + 0x0200 - 8; attr_start >= first + base; attr_start -= 4)
	{
		int x, y;
// some other drivers still use this wrong table, they have to be upgraded
//      int zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 };


		if (!get_sprite_attributes(&spriteram3[attr_start]))
			continue;


		if ( chip_disabled_pri & !curr_sprite.pri)
			continue;

		if ((!chip_disabled_pri) & (curr_sprite.pri >> 4))
			continue;



		curr_sprite.color += 16 * spritepalettebank;

// aerofgt has this adjustment, but doing it here would break turbo force title screen
//      curr_sprite.ox += (curr_sprite.xsize*curr_sprite.zoomx+2)/4;
//      curr_sprite.oy += (curr_sprite.ysize*curr_sprite.zoomy+2)/4;

		curr_sprite.zoomx = 32 - curr_sprite.zoomx;
		curr_sprite.zoomy = 32 - curr_sprite.zoomy;

		for (y = 0; y <= curr_sprite.ysize; y++)
		{
			int sx, sy;

			if (curr_sprite.flipy)
				sy = ((curr_sprite.oy + curr_sprite.zoomy * (curr_sprite.ysize - y)/2 + 16) & 0x1ff) - 16;
			else
				sy = ((curr_sprite.oy + curr_sprite.zoomy * y / 2 + 16) & 0x1ff) - 16;

			for (x = 0; x <= curr_sprite.xsize; x++)
			{
				int curr;

				if (curr_sprite.flipx)
					sx = ((curr_sprite.ox + curr_sprite.zoomx * (curr_sprite.xsize - x) / 2 + 16) & 0x1ff) - 16;
				else
					sx = ((curr_sprite.ox + curr_sprite.zoomx * x / 2 + 16) & 0x1ff) - 16;

				curr = spriteram1[curr_sprite.map % (spriteram1_bytes/2)];
	
				pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[sprite_gfx],
							 curr,
							 curr_sprite.color,
							 curr_sprite.flipx,curr_sprite.flipy,
							 sx,sy,
							 curr_sprite.zoomx << 11, curr_sprite.zoomy << 11,
							 machine.priority_bitmap,curr_sprite.pri ? 0 : 2,15);
				curr_sprite.map++;
			}

			if (curr_sprite.xsize == 2) curr_sprite.map += 1;
			if (curr_sprite.xsize == 4) curr_sprite.map += 3;
			if (curr_sprite.xsize == 5) curr_sprite.map += 2;
			if (curr_sprite.xsize == 6) curr_sprite.map += 1;
		}
	}
}

void vsystem_spr2_device::turbofrc_draw_sprites( UINT16* spriteram3,  int spriteram3_bytes, UINT16* spriteram1, int spriteram1_bytes, int sprite_gfx, int spritepalettebank, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int chip_disabled_pri )
{ turbofrc_draw_sprites_common( spriteram3, spriteram3_bytes, spriteram1, spriteram1_bytes, sprite_gfx, spritepalettebank, machine, bitmap, cliprect, chip_disabled_pri ); }

void vsystem_spr2_device::turbofrc_draw_sprites( UINT16* spriteram3,  int spriteram3_bytes, UINT16* spriteram1, int spriteram1_bytes, int sprite_gfx, int spritepalettebank, running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, int chip_disabled_pri )
{ turbofrc_draw_sprites_common( spriteram3, spriteram3_bytes, spriteram1, spriteram1_bytes, sprite_gfx, spritepalettebank, machine, bitmap, cliprect, chip_disabled_pri ); }


template<class _BitmapClass>
void vsystem_spr2_device::spinlbrk_draw_sprites_common( UINT16* spriteram3,  int spriteram3_bytes, UINT16* spriteram1, int spriteram1_bytes, int sprite_gfx, int spritepalettebank, running_machine &machine, _BitmapClass &bitmap, const rectangle &cliprect, int chip_disabled_pri )
{
	int attr_start, base, first;
	base = 0;//chip * 0x0200;
	first = 4 * spriteram3[0x1fe + base];

	for (attr_start = base + 0x0200-8; attr_start >= first + base; attr_start -= 4)
	{
		int x, y;
// some other drivers still use this wrong table, they have to be upgraded
//      int zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 };


		if (!get_sprite_attributes(&spriteram3[attr_start]))
			continue;


		if ( chip_disabled_pri & !curr_sprite.pri)
			continue;
		if ((!chip_disabled_pri) & (curr_sprite.pri >> 4))
			continue;


		curr_sprite.color += 16 * spritepalettebank;

// aerofgt has this adjustment, but doing it here would break turbo force title screen
//      curr_sprite.ox += (curr_sprite.xsize*curr_sprite.zoomx+2)/4;
//      curr_sprite.oy += (curr_sprite.ysize*curr_sprite.zoomy+2)/4;

		curr_sprite.zoomx = 32 - curr_sprite.zoomx;
		curr_sprite.zoomy = 32 - curr_sprite.zoomy;

		for (y = 0; y <= curr_sprite.ysize; y++)
		{
			int sx, sy;

			if (curr_sprite.flipy)
				sy = ((curr_sprite.oy + curr_sprite.zoomy * (curr_sprite.ysize - y)/2 + 16) & 0x1ff) - 16;
			else
				sy = ((curr_sprite.oy + curr_sprite.zoomy * y / 2 + 16) & 0x1ff) - 16;

			for (x = 0; x <= curr_sprite.xsize; x++)
			{
				int curr;

				if (curr_sprite.flipx)
					sx = ((curr_sprite.ox + curr_sprite.zoomx * (curr_sprite.xsize - x) / 2 + 16) & 0x1ff) - 16;
				else
					sx = ((curr_sprite.ox + curr_sprite.zoomx * x / 2 + 16) & 0x1ff) - 16;

				curr = spriteram1[curr_sprite.map % (spriteram1_bytes/2)];
	
				pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[sprite_gfx],
							 curr,
							 curr_sprite.color,
							 curr_sprite.flipx,curr_sprite.flipy,
							 sx,sy,
							 curr_sprite.zoomx << 11, curr_sprite.zoomy << 11,
							 machine.priority_bitmap,curr_sprite.pri ? 2 : 0,15);
				curr_sprite.map++;
			}

			if (curr_sprite.xsize == 2) curr_sprite.map += 1;
			if (curr_sprite.xsize == 4) curr_sprite.map += 3;
			if (curr_sprite.xsize == 5) curr_sprite.map += 2;
			if (curr_sprite.xsize == 6) curr_sprite.map += 1;
		}
	}
}

void vsystem_spr2_device::spinlbrk_draw_sprites( UINT16* spriteram3,  int spriteram3_bytes, UINT16* spriteram1, int spriteram1_bytes, int sprite_gfx, int spritepalettebank, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int chip_disabled_pri )
{ spinlbrk_draw_sprites_common( spriteram3, spriteram3_bytes, spriteram1, spriteram1_bytes, sprite_gfx, spritepalettebank, machine, bitmap, cliprect, chip_disabled_pri ); }

void vsystem_spr2_device::spinlbrk_draw_sprites( UINT16* spriteram3,  int spriteram3_bytes, UINT16* spriteram1, int spriteram1_bytes, int sprite_gfx, int spritepalettebank, running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, int chip_disabled_pri )
{ spinlbrk_draw_sprites_common( spriteram3, spriteram3_bytes, spriteram1, spriteram1_bytes, sprite_gfx, spritepalettebank, machine, bitmap, cliprect, chip_disabled_pri ); }



// like above but no secondary indirection?
void vsystem_spr2_device::welltris_draw_sprites( UINT16* spriteram, int spritepalettebank, running_machine &machine, bitmap_ind16 &bitmap,const rectangle &cliprect)
{
	static const UINT8 zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 };
	int offs;
	const rectangle &visarea = machine.primary_screen->visible_area();

	/* draw the sprites */
	for (offs = 0; offs < 0x200 - 4; offs += 4)
	{
		if (!get_sprite_attributes(&spriteram[offs]))
			continue;

		curr_sprite.map&=0x1fff;
		curr_sprite.ysize++;
		curr_sprite.xsize++;
		curr_sprite.color += (0x10 * spritepalettebank);

		int zoomed = (curr_sprite.zoomx | curr_sprite.zoomy);
		int xt, yt;


		/* compute the zoom factor -- stolen from aerofgt.c */
		curr_sprite.zoomx = 16 - zoomtable[curr_sprite.zoomx] / 8;
		curr_sprite.zoomy = 16 - zoomtable[curr_sprite.zoomy] / 8;

		/* wrap around */
		if (curr_sprite.ox > visarea.max_x) curr_sprite.ox -= 0x200;
		if (curr_sprite.oy > visarea.max_y) curr_sprite.oy -= 0x200;

		/* normal case */
		if (!curr_sprite.flipx && !curr_sprite.flipy) {
			for (yt = 0; yt < curr_sprite.ysize; yt++) {
				for (xt = 0; xt < curr_sprite.xsize; xt++, curr_sprite.map++) {
					if (!zoomed)
						drawgfx_transpen(bitmap, cliprect, machine.gfx[1], curr_sprite.map, curr_sprite.color, 0, 0,
								curr_sprite.ox + xt * 16, curr_sprite.oy + yt * 16, 15);
					else
						drawgfxzoom_transpen(bitmap, cliprect, machine.gfx[1], curr_sprite.map, curr_sprite.color, 0, 0,
								curr_sprite.ox + xt * curr_sprite.zoomx, curr_sprite.oy + yt * curr_sprite.zoomy,
								0x1000 * curr_sprite.zoomx, 0x1000 * curr_sprite.zoomy, 15);
				}
				if (curr_sprite.xsize == 3) curr_sprite.map += 1;
				if (curr_sprite.xsize == 5) curr_sprite.map += 3;
				if (curr_sprite.xsize == 6) curr_sprite.map += 2;
				if (curr_sprite.xsize == 7) curr_sprite.map += 1;
			}
		}

		/* curr_sprite.flipxped case */
		else if (curr_sprite.flipx && !curr_sprite.flipy) {
			for (yt = 0; yt < curr_sprite.ysize; yt++) {
				for (xt = 0; xt < curr_sprite.xsize; xt++, curr_sprite.map++) {
					if (!zoomed)
						drawgfx_transpen(bitmap, cliprect, machine.gfx[1], curr_sprite.map, curr_sprite.color, 1, 0,
								curr_sprite.ox + (curr_sprite.xsize - 1 - xt) * 16, curr_sprite.oy + yt * 16, 15);
					else
						drawgfxzoom_transpen(bitmap, cliprect, machine.gfx[1], curr_sprite.map, curr_sprite.color, 1, 0,
								curr_sprite.ox + (curr_sprite.xsize - 1 - xt) * curr_sprite.zoomx, curr_sprite.oy + yt * curr_sprite.zoomy,
								0x1000 * curr_sprite.zoomx, 0x1000 * curr_sprite.zoomy, 15);
				}
				if (curr_sprite.xsize == 3) curr_sprite.map += 1;
				if (curr_sprite.xsize == 5) curr_sprite.map += 3;
				if (curr_sprite.xsize == 6) curr_sprite.map += 2;
				if (curr_sprite.xsize == 7) curr_sprite.map += 1;
			}
		}

		/* curr_sprite.flipyped case */
		else if (!curr_sprite.flipx && curr_sprite.flipy) {
			for (yt = 0; yt < curr_sprite.ysize; yt++) {
				for (xt = 0; xt < curr_sprite.xsize; xt++, curr_sprite.map++) {
					if (!zoomed)
						drawgfx_transpen(bitmap, cliprect, machine.gfx[1], curr_sprite.map, curr_sprite.color, 0, 1,
								curr_sprite.ox + xt * 16, curr_sprite.oy + (curr_sprite.ysize - 1 - yt) * 16, 15);
					else
						drawgfxzoom_transpen(bitmap, cliprect, machine.gfx[1], curr_sprite.map, curr_sprite.color, 0, 1,
								curr_sprite.ox + xt * curr_sprite.zoomx, curr_sprite.oy + (curr_sprite.ysize - 1 - yt) * curr_sprite.zoomy,
								0x1000 * curr_sprite.zoomx, 0x1000 * curr_sprite.zoomy, 15);
				}
				if (curr_sprite.xsize == 3) curr_sprite.map += 1;
				if (curr_sprite.xsize == 5) curr_sprite.map += 3;
				if (curr_sprite.xsize == 6) curr_sprite.map += 2;
				if (curr_sprite.xsize == 7) curr_sprite.map += 1;
			}
		}

		/* x & curr_sprite.flipyped case */
		else {
			for (yt = 0; yt < curr_sprite.ysize; yt++) {
				for (xt = 0; xt < curr_sprite.xsize; xt++, curr_sprite.map++) {
					if (!zoomed)
						drawgfx_transpen(bitmap, cliprect, machine.gfx[1], curr_sprite.map, curr_sprite.color, 1, 1,
								curr_sprite.ox + (curr_sprite.xsize - 1 - xt) * 16, curr_sprite.oy + (curr_sprite.ysize - 1 - yt) * 16, 15);
					else
						drawgfxzoom_transpen(bitmap, cliprect, machine.gfx[1], curr_sprite.map, curr_sprite.color, 1, 1,
								curr_sprite.ox + (curr_sprite.xsize - 1 - xt) * curr_sprite.zoomx, curr_sprite.oy + (curr_sprite.ysize - 1 - yt) * curr_sprite.zoomy,
								0x1000 * curr_sprite.zoomx, 0x1000 * curr_sprite.zoomy, 15);
				}
				if (curr_sprite.xsize == 3) curr_sprite.map += 1;
				if (curr_sprite.xsize == 5) curr_sprite.map += 3;
				if (curr_sprite.xsize == 6) curr_sprite.map += 2;
				if (curr_sprite.xsize == 7) curr_sprite.map += 1;
			}
		}
	}
}



void vsystem_spr2_device::f1gp_draw_sprites( int gfxrgn, UINT16* sprvram, UINT16* sprcgram, int sprcgram_bytes, running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int primask )
{
	int attr_start, first;
	UINT16 *spram = sprvram;

	first = 4 * spram[0x1fe];

	for (attr_start = 0x0200 - 8; attr_start >= first; attr_start -= 4)
	{
		int x, y;
		/* table hand made by looking at the ship explosion in attract mode */
		/* it's almost a logarithmic scale but not exactly */
		static const int zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 };


		if (!get_sprite_attributes(&spram[attr_start]))
			continue;

		curr_sprite.zoomx = 16 - zoomtable[curr_sprite.zoomx] / 8;
		curr_sprite.zoomy = 16 - zoomtable[curr_sprite.zoomy] / 8;

		for (y = 0; y <= curr_sprite.ysize; y++)
		{
			int sx, sy;

			if (curr_sprite.flipy) sy = ((curr_sprite.oy + curr_sprite.zoomy * (curr_sprite.ysize - y) + 16) & 0x1ff) - 16;
			else sy = ((curr_sprite.oy + curr_sprite.zoomy * y + 16) & 0x1ff) - 16;

			for (x = 0; x <= curr_sprite.xsize; x++)
			{
				int curr;

				if (curr_sprite.flipx) sx = ((curr_sprite.ox + curr_sprite.zoomx * (curr_sprite.xsize - x) + 16) & 0x1ff) - 16;
				else sx = ((curr_sprite.ox + curr_sprite.zoomx * x + 16) & 0x1ff) - 16;

				curr = sprcgram[curr_sprite.map % (sprcgram_bytes / 2)];

				pdrawgfxzoom_transpen(bitmap,cliprect,machine.gfx[gfxrgn],
						curr,
						curr_sprite.color,
						curr_sprite.flipx,curr_sprite.flipy,
						sx,sy,
						0x1000 * curr_sprite.zoomx,0x1000 * curr_sprite.zoomy,
						machine.priority_bitmap,
//                      pri ? 0 : 0x2);
						primask,15);
				curr_sprite.map++;
			}

			if (curr_sprite.xsize == 2) curr_sprite.map += 1;
			if (curr_sprite.xsize == 4) curr_sprite.map += 3;
			if (curr_sprite.xsize == 5) curr_sprite.map += 2;
			if (curr_sprite.xsize == 6) curr_sprite.map += 1;
		}
	}
}

// the same but for an 8-bit system..
void vsystem_spr2_device::draw_sprites_pipedrm( UINT8* spriteram, int spriteram_bytes, int flipscreen, screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int draw_priority )
{
	static const UINT8 zoomtable[16] = { 0,7,14,20,25,30,34,38,42,46,49,52,54,57,59,61 };
	const rectangle &visarea = screen.visible_area();
//	UINT8 *spriteram = spriteram;
	int offs;

	/* draw the sprites */
	for (offs = 0; offs < spriteram_bytes; offs += 8)
	{
		int data2 = spriteram[offs + 4] | (spriteram[offs + 5] << 8);
		int priority = (data2 >> 4) & 1;

		/* turns out the sprites are the same as in aerofgt.c */
		if (priority == draw_priority)
		{
			if (!get_sprite_attributes((UINT16*)&spriteram[offs]))
				continue;
			
			curr_sprite.ysize++;
			curr_sprite.xsize++;
			curr_sprite.oy -= 6;
			curr_sprite.ox -= 13;


			
			int xt, yt;


			int zoomed = (curr_sprite.zoomx | curr_sprite.zoomy);

			/* compute the zoom factor -- stolen from aerofgt.c */
			curr_sprite.zoomx = 16 - zoomtable[curr_sprite.zoomx] / 8;
			curr_sprite.zoomy = 16 - zoomtable[curr_sprite.zoomy] / 8;

			/* wrap around */
			if (curr_sprite.ox > visarea.max_x)
				curr_sprite.ox -= 0x200;
			if (curr_sprite.oy > visarea.max_y)
				curr_sprite.oy -= 0x200;

			/* flip ? */
			if (flipscreen)
			{
				curr_sprite.oy = visarea.max_y - curr_sprite.oy - 16 * curr_sprite.ysize - 4;
				curr_sprite.ox = visarea.max_x - curr_sprite.ox - 16 * curr_sprite.xsize - 24;
				curr_sprite.flipx=!curr_sprite.flipx;
				curr_sprite.flipy=!curr_sprite.flipy;
			}

			/* normal case */
			if (!curr_sprite.flipx && !curr_sprite.flipy)
			{
				for (yt = 0; yt < curr_sprite.ysize; yt++)
					for (xt = 0; xt < curr_sprite.xsize; xt++, curr_sprite.map++)
						if (!zoomed)
							drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[2], curr_sprite.map, curr_sprite.color, 0, 0,
									curr_sprite.ox + xt * 16, curr_sprite.oy + yt * 16, 15);
						else
							drawgfxzoom_transpen(bitmap, cliprect, screen.machine().gfx[2], curr_sprite.map, curr_sprite.color, 0, 0,
									curr_sprite.ox + xt * curr_sprite.zoomx, curr_sprite.oy + yt * curr_sprite.zoomy,
									0x1000 * curr_sprite.zoomx, 0x1000 * curr_sprite.zoomy, 15);
			}

			/* curr_sprite.flipxped case */
			else if (curr_sprite.flipx && !curr_sprite.flipy)
			{
				for (yt = 0; yt < curr_sprite.ysize; yt++)
					for (xt = 0; xt < curr_sprite.xsize; xt++, curr_sprite.map++)
						if (!zoomed)
							drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[2], curr_sprite.map, curr_sprite.color, 1, 0,
									curr_sprite.ox + (curr_sprite.xsize - 1 - xt) * 16, curr_sprite.oy + yt * 16, 15);
						else
							drawgfxzoom_transpen(bitmap, cliprect, screen.machine().gfx[2], curr_sprite.map, curr_sprite.color, 1, 0,
									curr_sprite.ox + (curr_sprite.xsize - 1 - xt) * curr_sprite.zoomx, curr_sprite.oy + yt * curr_sprite.zoomy,
									0x1000 * curr_sprite.zoomx, 0x1000 * curr_sprite.zoomy, 15);
			}

			/* curr_sprite.flipyped case */
			else if (!curr_sprite.flipx && curr_sprite.flipy)
			{
				for (yt = 0; yt < curr_sprite.ysize; yt++)
					for (xt = 0; xt < curr_sprite.xsize; xt++, curr_sprite.map++)
						if (!zoomed)
							drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[2], curr_sprite.map, curr_sprite.color, 0, 1,
									curr_sprite.ox + xt * 16, curr_sprite.oy + (curr_sprite.ysize - 1 - yt) * 16, 15);
						else
							drawgfxzoom_transpen(bitmap, cliprect, screen.machine().gfx[2], curr_sprite.map, curr_sprite.color, 0, 1,
									curr_sprite.ox + xt * curr_sprite.zoomx, curr_sprite.oy + (curr_sprite.ysize - 1 - yt) * curr_sprite.zoomy,
									0x1000 * curr_sprite.zoomx, 0x1000 * curr_sprite.zoomy, 15);
			}

			/* x & curr_sprite.flipyped case */
			else
			{
				for (yt = 0; yt < curr_sprite.ysize; yt++)
					for (xt = 0; xt < curr_sprite.xsize; xt++, curr_sprite.map++)
						if (!zoomed)
							drawgfx_transpen(bitmap, cliprect, screen.machine().gfx[2], curr_sprite.map, curr_sprite.color, 1, 1,
									curr_sprite.ox + (curr_sprite.xsize - 1 - xt) * 16, curr_sprite.oy + (curr_sprite.ysize - 1 - yt) * 16, 15);
						else
							drawgfxzoom_transpen(bitmap, cliprect, screen.machine().gfx[2], curr_sprite.map, curr_sprite.color, 1, 1,
									curr_sprite.ox + (curr_sprite.xsize - 1 - xt) * curr_sprite.zoomx, curr_sprite.oy + (curr_sprite.ysize - 1 - yt) * curr_sprite.zoomy,
									0x1000 * curr_sprite.zoomx, 0x1000 * curr_sprite.zoomy, 15);
			}
		}
	}
}