Beispiel #1
0
/***************************************************************************

  Draw the game screen in the given osd_bitmap.
  Do NOT call osd_update_display() from this function, it will be called by
  the main emulation engine.

***************************************************************************/
void vigilant_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh)
{
	int i;


	if (rear_disable)	 /* opaque foreground */
	{
		for (i = 0;i < 8;i++)
			palette_used_colors[256 + 16*i] = PALETTE_COLOR_USED;
	}
	else
	{
		for (i = 0;i < 8;i++)
			palette_used_colors[256 + 16*i] = PALETTE_COLOR_TRANSPARENT;
	}


	/* copy the background palette */
	for (i = 0;i < 16;i++)
	{
		int r,g,b;


		r = (paletteram[0x400 + 16 * rear_color + i] << 3) & 0xFF;
		g = (paletteram[0x500 + 16 * rear_color + i] << 3) & 0xFF;
		b = (paletteram[0x600 + 16 * rear_color + i] << 3) & 0xFF;

		palette_change_color(512 + i,r,g,b);

		r = (paletteram[0x400 + 16 * rear_color + 32 + i] << 3) & 0xFF;
		g = (paletteram[0x500 + 16 * rear_color + 32 + i] << 3) & 0xFF;
		b = (paletteram[0x600 + 16 * rear_color + 32 + i] << 3) & 0xFF;

		palette_change_color(512 + 16 + i,r,g,b);
	}

	if (palette_recalc())
	{
		fast_memset(dirtybuffer,1,videoram_size);
		rear_refresh = 1;
	}

	if (rear_disable)	 /* opaque foreground */
	{
		draw_foreground(bitmap,0,1);
		draw_sprites(bitmap);
		draw_foreground(bitmap,1,1);
	}
	else
	{
		draw_background(bitmap);
		draw_foreground(bitmap,0,0);
		draw_sprites(bitmap);
		draw_foreground(bitmap,1,0); 
	}
}
Beispiel #2
0
/** Draw this screen */
void
GUIScreen::draw(DrawingContext& gc)
{
  draw_background(gc);
  gui_manager->draw(gc);
  draw_foreground(gc);
}
Beispiel #3
0
static SCREEN_UPDATE( madalien )
{
	madalien_state *state = screen->machine->driver_data<madalien_state>();
	int flip = BIT(input_port_read(screen->machine, "DSW"), 6) && BIT(*state->video_control, 0);

	// bits #0 and #1 define scrolling mode
	//
	// mode 0 - cycle over map section A
	// mode 1 - cycle over map section B
	//
	// mode 2 - transition from B to A
	// mode 3 - transition from A to B
	int scroll_mode = *state->scroll & 3;

	bitmap_fill(bitmap, cliprect, 0);
	draw_edges(screen->machine, bitmap, cliprect, flip, scroll_mode);
	draw_foreground(screen->machine, bitmap, cliprect, flip);

	/* highlight section A (outside of tunnels).
     * also, bit 1 of the state->video_flags register (6A) is
     * combined with the headlight signal through NOR gate 1A,
     * which is used to light up the tunnel when an alien explodes
    */
	if (scroll_mode != 1 || *state->video_flags & 2)
	{
		int x;
		int y;

		int min_x = 0;
		int max_x = 0xff;

		if (!(*state->video_flags & 2))
		{
			if (scroll_mode == 2) min_x = (*state->scroll & 0xfc);
			else if (scroll_mode == 3) max_x = (*state->scroll & 0xfc) - 1;
		}

		if (flip)
		{
			int max_x_save = max_x;
			max_x = 0xff - min_x;
			min_x = 0xff - max_x_save;
		}

		for (y = cliprect->min_y; y <= cliprect->max_y ; y++)
			for (x = min_x; x <= max_x; x++)
				if ((x >= cliprect->min_x) && (x <= cliprect->max_x))
					*BITMAP_ADDR16(bitmap, y, x) |= 8;
	}

	draw_headlight(screen->machine, bitmap, cliprect, flip);

	return 0;
}
Beispiel #4
0
UINT32 madalien_state::screen_update_madalien(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int flip = BIT(ioport("DSW")->read(), 6) && BIT(*m_video_control, 0);

	// bits #0 and #1 define scrolling mode
	//
	// mode 0 - cycle over map section A
	// mode 1 - cycle over map section B
	//
	// mode 2 - transition from B to A
	// mode 3 - transition from A to B
	int scroll_mode = *m_scroll & 3;

	bitmap.fill(0, cliprect);
	draw_edges(screen, bitmap, cliprect, flip, scroll_mode);
	draw_foreground(screen, bitmap, cliprect, flip);

	/* highlight section A (outside of tunnels).
	 * also, bit 1 of the video_flags register (6A) is
	 * combined with the headlight signal through NOR gate 1A,
	 * which is used to light up the tunnel when an alien explodes
	*/
	if (scroll_mode != 1 || *m_video_flags & 2)
	{
		int x;
		int y;

		int min_x = 0;
		int max_x = 0xff;

		if (!(*m_video_flags & 2))
		{
			if (scroll_mode == 2) min_x = (*m_scroll & 0xfc);
			else if (scroll_mode == 3) max_x = (*m_scroll & 0xfc) - 1;
		}

		if (flip)
		{
			int max_x_save = max_x;
			max_x = 0xff - min_x;
			min_x = 0xff - max_x_save;
		}

		for (y = cliprect.min_y; y <= cliprect.max_y ; y++)
			for (x = min_x; x <= max_x; x++)
				if ((x >= cliprect.min_x) && (x <= cliprect.max_x))
					bitmap.pix16(y, x) |= 8;
	}

	draw_headlight(bitmap, cliprect, flip);

	return 0;
}
Beispiel #5
0
static VIDEO_UPDATE( madalien )
{
	int flip = BIT(input_port_read(screen->machine, "DSW"), 6) && BIT(*madalien_video_control, 0);

	// bits #0 and #1 define scrolling mode
	//
	// mode 0 - cycle over map section A
	// mode 1 - cycle over map section B
	//
	// mode 2 - transition from B to A
	// mode 3 - transition from A to B
	int scroll_mode = *madalien_scroll & 3;

	bitmap_fill(bitmap, cliprect, 0);
	draw_edges(bitmap, cliprect, flip, scroll_mode);
	draw_foreground(screen->machine, bitmap, cliprect, flip);

	/* highlight section A (outside of tunnels) */

	if (scroll_mode != 1)
	{
		int x;
		int y;

		int min_x = 0;
		int max_x = 0xff;

		if (scroll_mode == 2)
			min_x = (*madalien_scroll & 0xfc);

		if (scroll_mode == 3)
			max_x = (*madalien_scroll & 0xfc) - 1;

		if (flip)
		{
			int max_x_save = max_x;
			max_x = 0xff - min_x;
			min_x = 0xff - max_x_save;
		}

		for (y = cliprect->min_y; y <= cliprect->max_y ; y++)
			for (x = min_x; x <= max_x; x++)
				if ((x >= cliprect->min_x) && (x <= cliprect->max_x))
					*BITMAP_ADDR16(bitmap, y, x) |= 8;
	}

	draw_headlight(bitmap, cliprect, flip);

	return 0;
}
Beispiel #6
0
/**
 * \brief Draws the map with all its entities on the screen.
 */
void Map::draw() {

  if (is_loaded()) {
    // background
    draw_background();

    // draw all entities (including the hero)
    entities->draw();

    // foreground
    draw_foreground();

    // Lua
    get_lua_context().map_on_draw(*this, *visible_surface);
  }
}
Beispiel #7
0
/* tilemap draw handler */
void ns1_draw_tilemap(struct osd_bitmap *bitmap,struct gfx_object *object)
{
	int layer = object->code;
#if NAMCOS1_DIRECT_DRAW
	if(namcos1_tilemap_used)
#endif
	tilemap_draw( bitmap , playfields[layer].tilemap , 0 );
#if NAMCOS1_DIRECT_DRAW
	else
	{
		if( layer < 4 )
			draw_background(bitmap,layer);
		else
			draw_foreground(bitmap,layer);
	}
#endif
}