示例#1
0
文件: speglsht.c 项目: richard42/mame
UINT32 speglsht_state::screen_update_speglsht(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
    int x,y,dy;

    dy=(m_videoreg&0x20)?(256*512):0; //visible frame

    for(y=0; y<256; y++)
    {
        for(x=0; x<512; x++)
        {
            int tmp=dy+y*512+x;
            PLOT_PIXEL_RGB(x-67,y-5,(m_framebuffer[tmp]>>0)&0xff,(m_framebuffer[tmp]>>8)&0xff,(m_framebuffer[tmp]>>16)&0xff);
        }
    }

    //draw st0016 gfx to temporary bitmap (indexed 16)
    m_bitmap->fill(0);
    m_maincpu->st0016_draw_screen(screen, *m_bitmap, cliprect);

    //copy temporary bitmap to rgb 32 bit bitmap
    for(y=cliprect.min_y; y<cliprect.max_y; y++)
    {
        UINT16 *srcline = &m_bitmap->pix16(y);
        for(x=cliprect.min_x; x<cliprect.max_x; x++)
        {
            if(srcline[x])
            {
                rgb_t color=m_maincpu->m_palette->pen_color(srcline[x]);
                PLOT_PIXEL_RGB(x,y,color.r(),color.g(),color.b());
            }
        }
    }

    return 0;
}
示例#2
0
static SCREEN_UPDATE(speglsht)
{
	speglsht_state *state = screen->machine().driver_data<speglsht_state>();
	int x,y,dy;

	dy=(state->m_videoreg&0x20)?(256*512):0; //visible frame

	for(y=0;y<256;y++)
	{
		for(x=0;x<512;x++)
		{
			int tmp=dy+y*512+x;
			PLOT_PIXEL_RGB(x-67,y-5,(state->m_framebuffer[tmp]>>0)&0xff,(state->m_framebuffer[tmp]>>8)&0xff,(state->m_framebuffer[tmp]>>16)&0xff);
		}
	}

	//draw st0016 gfx to temporary bitmap (indexed 16)
	bitmap_fill(state->m_bitmap,NULL,0);
	st0016_draw_screen(screen, state->m_bitmap, cliprect);

	//copy temporary bitmap to rgb 32 bit bitmap
	for(y=cliprect->min_y; y<cliprect->max_y;y++)
	{
		UINT16 *srcline = BITMAP_ADDR16(state->m_bitmap, y, 0);
		for(x=cliprect->min_x; x<cliprect->max_x;x++)
		{
			if(srcline[x])
			{
				rgb_t color=palette_get_color(screen->machine(), srcline[x]);
				PLOT_PIXEL_RGB(x,y,RGB_RED(color),RGB_GREEN(color),RGB_BLUE(color));
			}
		}
	}

	return 0;
}