1 // license:BSD-3-Clause
2 // copyright-holders:Nicola Salmoria
3 #include "emu.h"
4 #include "taito_helper.h"
5
6 /* These scanline drawing routines, currently used by the pc080sn, tc0080vco, tc0150rod and tc0480scp devices, were lifted from Taito F3: optimise / merge ? */
7
8
taitoic_drawscanline(bitmap_ind16 & bitmap,const rectangle & cliprect,int x,int y,const u16 * src,bool transparent,u32 orient,bitmap_ind8 & priority,u8 pri,u8 primask)9 void taitoic_drawscanline( bitmap_ind16 &bitmap, const rectangle &cliprect, int x, int y,
10 const u16 *src, bool transparent, u32 orient, bitmap_ind8 &priority, u8 pri, u8 primask)
11 {
12 u16 *dsti = &bitmap.pix(y, x);
13 u8 *dstp = &priority.pix(y, x);
14 int length = cliprect.width();
15
16 src += cliprect.min_x;
17 dsti += cliprect.min_x;
18 dstp += cliprect.min_x;
19 if (transparent)
20 {
21 while (length--)
22 {
23 u32 spixel = *src++;
24
25 if (spixel < 0x7fff)
26 {
27 *dsti = spixel;
28 *dstp = (*dstp & primask) | pri;
29 }
30
31 dsti++;
32 dstp++;
33 }
34 }
35 else /* Not transparent case */
36 {
37 while (length--)
38 {
39 *dsti++ = *src++;
40 *dstp = (*dstp & primask) | pri;
41 dstp++;
42 }
43 }
44 }
45