mirror of
https://github.com/holub/mame
synced 2025-07-01 16:19:38 +03:00
first implementation of PAINT command (for now only 4bpp and 8bpp supported and the pattern is not supported)
This commit is contained in:
parent
7b13f5ba98
commit
c783bad331
@ -840,6 +840,116 @@ void line(INT16 sx, INT16 sy, INT16 ex, INT16 ey, INT16 col)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void paint(int sx, int sy, int col)
|
||||||
|
{
|
||||||
|
int getpixel;
|
||||||
|
dot(sx,sy,0,col);
|
||||||
|
|
||||||
|
getpixel = get_pixel(sx+1,sy);
|
||||||
|
switch ((HD63484_reg[0x02/2] & 0x700) >> 8)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
getpixel = (getpixel << 12) | (getpixel << 8) | (getpixel << 4) | (getpixel << 0);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
getpixel = (getpixel << 8) | (getpixel << 0);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
logerror ("Graphic bit mode not supported\n");
|
||||||
|
}
|
||||||
|
if ((getpixel != col) && (getpixel != edg))
|
||||||
|
{
|
||||||
|
sx++;
|
||||||
|
paint(sx,sy,col);
|
||||||
|
sx--;
|
||||||
|
}
|
||||||
|
|
||||||
|
getpixel = get_pixel(sx-1,sy);
|
||||||
|
switch ((HD63484_reg[0x02/2] & 0x700) >> 8)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
getpixel = (getpixel << 12) | (getpixel << 8) | (getpixel << 4) | (getpixel << 0);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
getpixel = (getpixel << 8) | (getpixel << 0);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
logerror ("Graphic bit mode not supported\n");
|
||||||
|
}
|
||||||
|
if ((getpixel != col) && (getpixel != edg))
|
||||||
|
{
|
||||||
|
sx--;
|
||||||
|
paint(sx,sy,col);
|
||||||
|
sx++;
|
||||||
|
}
|
||||||
|
|
||||||
|
getpixel = get_pixel(sx,sy+1);
|
||||||
|
switch ((HD63484_reg[0x02/2] & 0x700) >> 8)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
getpixel = (getpixel << 12) | (getpixel << 8) | (getpixel << 4) | (getpixel << 0);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
getpixel = (getpixel << 8) | (getpixel << 0);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
logerror ("Graphic bit mode not supported\n");
|
||||||
|
}
|
||||||
|
if ((getpixel != col) && (getpixel != edg))
|
||||||
|
{
|
||||||
|
sy++;
|
||||||
|
paint(sx,sy,col);
|
||||||
|
sy--;
|
||||||
|
}
|
||||||
|
|
||||||
|
getpixel = get_pixel(sx,sy-1);
|
||||||
|
switch ((HD63484_reg[0x02/2] & 0x700) >> 8)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
getpixel = (getpixel << 12) | (getpixel << 8) | (getpixel << 4) | (getpixel << 0);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
getpixel = (getpixel << 8) | (getpixel << 0);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
logerror ("Graphic bit mode not supported\n");
|
||||||
|
}
|
||||||
|
if ((getpixel != col) && (getpixel != edg))
|
||||||
|
{
|
||||||
|
sy--;
|
||||||
|
paint(sx,sy,col);
|
||||||
|
sy++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void HD63484_command_w(UINT16 cmd)
|
static void HD63484_command_w(UINT16 cmd)
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
@ -1106,9 +1216,7 @@ static void HD63484_command_w(UINT16 cmd)
|
|||||||
}
|
}
|
||||||
else if (fifo[0] == 0xc800) /* PAINT */
|
else if (fifo[0] == 0xc800) /* PAINT */
|
||||||
{
|
{
|
||||||
// int i;
|
paint(cpx,cpy,cl0);
|
||||||
// for (i=-2; i<90; i++)
|
|
||||||
// line(cpx,cpy+i,cpx+60,cpy+i,0x0000);
|
|
||||||
}
|
}
|
||||||
else if ((fifo[0] & 0xfff8) == 0xcc00) /* DOT */
|
else if ((fifo[0] & 0xfff8) == 0xcc00) /* DOT */
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user