Exemple #1
0
void spacewar_vh_screenrefresh (struct osd_bitmap *bitmap, int full_refresh)
{
    int tk[] = {3, 8, 4, 9, 1, 6, 2, 7, 5, 0};
	int i, pwidth, pheight, key, row, col, sw_option;
	float scale;
	struct osd_bitmap vector_bitmap;
	struct rectangle rect;

    static int sw_option_change;

	if (spacewar_panel == NULL)
	{
        vector_vh_update(bitmap, full_refresh);
        vector_clear_list ();
		return;
	}

	pwidth = spacewar_panel->artwork->width;
	pheight = spacewar_panel->artwork->height;

	vector_bitmap.width = bitmap->width;
	vector_bitmap.height = bitmap->height - pheight;
	vector_bitmap._private = bitmap->_private;
	vector_bitmap.line = bitmap->line;

	vector_vh_update(&vector_bitmap,full_refresh);
    vector_clear_list ();

	if (full_refresh)
		copybitmap(bitmap,spacewar_panel->artwork,0,0,
				   0,bitmap->height - pheight, 0,TRANSPARENCY_NONE,0);

	scale = pwidth/1024.0;

    sw_option = input_port_2_r(0) | ((input_port_1_r(0) << 6) & 0x300);
    sw_option_change ^= sw_option;

	for (i = 0; i < 10; i++)
	{
		if (sw_option_change & (1 << i) || full_refresh)
		{
            key = tk[i];
            col = key % 5;
            row = key / 5;
			rect.min_x = scale * (465 + 20 * col);
			rect.max_x = scale * (465 + 20 * col + 18);
			rect.min_y = scale * (39  + 20 * row) + vector_bitmap.height;
			rect.max_y = scale * (39  + 20 * row + 18) + vector_bitmap.height;

			if (sw_option & (1 << i))
            {
				copybitmap(bitmap,spacewar_panel->artwork,0,0,
						   0, vector_bitmap.height, &rect,TRANSPARENCY_NONE,0);
            }
			else
            {
				copybitmap(bitmap,spacewar_pressed_panel->artwork,0,0,
						   0, vector_bitmap.height, &rect,TRANSPARENCY_NONE,0);
            }

			osd_mark_dirty (rect.min_x, rect.min_y,
                            rect.max_x, rect.max_y, 0);
		}
	}
    sw_option_change = sw_option;
}
Exemple #2
0
static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	zac2650_state *state = machine.driver_data<zac2650_state>();
	int offs;
	const rectangle &visarea = machine.primary_screen->visible_area();

	/* -------------------------------------------------------------- */
	/* There seems to be a strange setup with this board, in that it  */
	/* appears that the S2636 runs from a different clock than the    */
	/* background generator, When the program maps sprite position to */
	/* character position it only has 6 pixels of sprite for 8 pixels */
	/* of character.                                                  */
	/* -------------------------------------------------------------- */
	/* n.b. The original has several graphic glitches as well, so it  */
	/* does not seem to be a fault of the emulation!                  */
	/* -------------------------------------------------------------- */

	state->m_CollisionBackground = 0;   /* Read from 0x1e80 bit 7 */

	// for collision detection checking
	copybitmap(state->m_bitmap,bitmap,0,0,0,0,visarea);

	for(offs=0;offs<0x50;offs+=0x10)
	{
		if((state->m_s2636_0_ram[offs+10]<0xF0) && (offs!=0x30))
		{
			int spriteno = (offs / 8);
			int expand   = ((state->m_s2636_0_ram[0xc0] & (spriteno*2))!=0) ? 2 : 1;
			int bx       = (state->m_s2636_0_ram[offs+10] * 4) - 22;
			int by       = (state->m_s2636_0_ram[offs+12] * 3) + 3;
			int x,y;

			/* Sprite->Background collision detection */
			drawgfx_transpen(bitmap,cliprect, machine.gfx[expand],
					spriteno,
					1,
					0,0,
					bx,by, 0);

			for (x = bx; x < bx + machine.gfx[expand]->width(); x++)
			{
				for (y = by; y < by + machine.gfx[expand]->height(); y++)
				{
					if (visarea.contains(x, y))
						if (bitmap.pix16(y, x) != state->m_bitmap.pix16(y, x))
						{
							state->m_CollisionBackground = 0x80;
							break;
						}
				}
			}

			drawgfx_transpen(bitmap,cliprect, machine.gfx[expand],
					spriteno,
					0,
					0,0,
					bx,by, 0);
		}
	}

	/* Sprite->Sprite collision detection */
	state->m_CollisionSprite = 0;
//  if(SpriteCollision(machine, 0,1)) state->m_CollisionSprite |= 0x20;   /* Not Used */
	if(SpriteCollision(machine, 0,2)) state->m_CollisionSprite |= 0x10;
	if(SpriteCollision(machine, 0,4)) state->m_CollisionSprite |= 0x08;
	if(SpriteCollision(machine, 1,2)) state->m_CollisionSprite |= 0x04;
	if(SpriteCollision(machine, 1,4)) state->m_CollisionSprite |= 0x02;
//  if(SpriteCollision(machine, 2,4)) state->m_CollisionSprite |= 0x01;   /* Not Used */
}
Exemple #3
0
static VIDEO_UPDATE(sliver)
{
	copybitmap      (bitmap, sliver_bitmap_bg, 0, 0, 0, 0, cliprect);
	copybitmap_trans(bitmap, sliver_bitmap_fg, 0, 0, 0, 0, cliprect, 0);
	return 0;
}
Exemple #4
0
UINT32 osborne1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, cliprect);
	return 0;
}