Exemple #1
0
static SCREEN_UPDATE( laserbat )
{
    laserbat_state *state = screen->machine().driver_data<laserbat_state>();
    int y;
    bitmap_t *s2636_1_bitmap;
    bitmap_t *s2636_2_bitmap;
    bitmap_t *s2636_3_bitmap;

    tilemap_draw(bitmap, cliprect, state->m_bg_tilemap, 0, 0);

    /* update the S2636 chips */
    s2636_1_bitmap = s2636_update(state->m_s2636_1, cliprect);
    s2636_2_bitmap = s2636_update(state->m_s2636_2, cliprect);
    s2636_3_bitmap = s2636_update(state->m_s2636_3, cliprect);

    /* copy the S2636 images into the main bitmap */
    for (y = cliprect->min_y; y <= cliprect->max_y; y++)
    {
        int x;

        for (x = cliprect->min_x; x <= cliprect->max_x; x++)
        {
            int pixel1 = *BITMAP_ADDR16(s2636_1_bitmap, y, x);
            int pixel2 = *BITMAP_ADDR16(s2636_2_bitmap, y, x);
            int pixel3 = *BITMAP_ADDR16(s2636_3_bitmap, y, x);

            if (S2636_IS_PIXEL_DRAWN(pixel1))
                *BITMAP_ADDR16(bitmap, y, x) = S2636_PIXEL_COLOR(pixel1);

            if (S2636_IS_PIXEL_DRAWN(pixel2))
                *BITMAP_ADDR16(bitmap, y, x) = S2636_PIXEL_COLOR(pixel2);

            if (S2636_IS_PIXEL_DRAWN(pixel3))
                *BITMAP_ADDR16(bitmap, y, x) = S2636_PIXEL_COLOR(pixel3);
        }
    }

    if (state->m_sprite_enable)
        drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],
                         state->m_sprite_code,
                         state->m_sprite_color,
                         0,0,
                         state->m_sprite_x - 6,state->m_sprite_y,0);

    return 0;
}
Exemple #2
0
static SCREEN_UPDATE_IND16( laserbat )
{
	laserbat_state *state = screen.machine().driver_data<laserbat_state>();
	int y;

	state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0);

	/* update the S2636 chips */
	bitmap_ind16 &s2636_1_bitmap = s2636_update(state->m_s2636_1, cliprect);
	bitmap_ind16 &s2636_2_bitmap = s2636_update(state->m_s2636_2, cliprect);
	bitmap_ind16 &s2636_3_bitmap = s2636_update(state->m_s2636_3, cliprect);

	/* copy the S2636 images into the main bitmap */
	for (y = cliprect.min_y; y <= cliprect.max_y; y++)
	{
		int x;

		for (x = cliprect.min_x; x <= cliprect.max_x; x++)
		{
			int pixel1 = s2636_1_bitmap.pix16(y, x);
			int pixel2 = s2636_2_bitmap.pix16(y, x);
			int pixel3 = s2636_3_bitmap.pix16(y, x);

			if (S2636_IS_PIXEL_DRAWN(pixel1))
				bitmap.pix16(y, x) = S2636_PIXEL_COLOR(pixel1);

			if (S2636_IS_PIXEL_DRAWN(pixel2))
				bitmap.pix16(y, x) = S2636_PIXEL_COLOR(pixel2);

			if (S2636_IS_PIXEL_DRAWN(pixel3))
				bitmap.pix16(y, x) = S2636_PIXEL_COLOR(pixel3);
		}
	}

	if (state->m_sprite_enable)
		drawgfx_transpen(bitmap,cliprect,screen.machine().gfx[1],
		        state->m_sprite_code,
				state->m_sprite_color,
				0,0,
				state->m_sprite_x - 6,state->m_sprite_y,0);

	return 0;
}
Exemple #3
0
UINT32 malzak_state::screen_update_malzak(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	const rgb_t *palette = m_palette->palette()->entry_list_raw();
	int sx, sy;
	int x,y;

	bitmap.fill(rgb_t::black);

	m_trom->screen_update(screen, bitmap, cliprect);

	// playfield - not sure exactly how this works...
	for (x = 0; x < 16; x++)
		for (y = 0; y < 16; y++)
		{
			sx = ((x * 16 - 48) - m_malzak_x) * 2;
			sy = ((y * 16) - m_malzak_y) * 2;

			if (sx < -271*2)
				sx += 512*2;
			if (sx < -15*2)
				sx += 256*2;

			m_gfxdecode->m_gfx[0]->zoom_transpen(bitmap,cliprect, m_playfield_code[x * 16 + y], 2, 0, 0, sx, sy, 0x20000, 0x20000, 0);
		}

	/* update the S2636 chips */
	bitmap_ind16 &s2636_0_bitmap = m_s2636_0->update(cliprect);
	bitmap_ind16 &s2636_1_bitmap = m_s2636_1->update(cliprect);

	/* copy the S2636 images into the main bitmap */
	{
		int y;

		for (y = cliprect.min_y; y <= cliprect.max_y / 2; y++)
		{
			int x;

			for (x = cliprect.min_x; x <= cliprect.max_x / 2; x++)
			{
				int pixel0 = s2636_0_bitmap.pix16(y, x);
				int pixel1 = s2636_1_bitmap.pix16(y, x);

				if (S2636_IS_PIXEL_DRAWN(pixel0)) {
					bitmap.pix32(y*2, x*2) = palette[S2636_PIXEL_COLOR(pixel0)];
					bitmap.pix32(y*2+1, x*2) = palette[S2636_PIXEL_COLOR(pixel0)];
					bitmap.pix32(y*2, x*2+1) = palette[S2636_PIXEL_COLOR(pixel0)];
					bitmap.pix32(y*2+1, x*2+1) = palette[S2636_PIXEL_COLOR(pixel0)];
				}

				if (S2636_IS_PIXEL_DRAWN(pixel1)) {
					bitmap.pix32(y*2, x*2) = palette[S2636_PIXEL_COLOR(pixel1)];
					bitmap.pix32(y*2+1, x*2) = palette[S2636_PIXEL_COLOR(pixel1)];
					bitmap.pix32(y*2, x*2+1) = palette[S2636_PIXEL_COLOR(pixel1)];
					bitmap.pix32(y*2+1, x*2+1) = palette[S2636_PIXEL_COLOR(pixel1)];
				}
			}
		}
	}

	return 0;
}