コード例 #1
0
ファイル: m20.c プロジェクト: Archlogic/libretro-mame
UINT32 m20_state::screen_update_m20(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	int x,y,i;
	UINT8 pen;
	UINT32 count;

	bitmap.fill(m_palette->black_pen(), cliprect);

	count = (0);

	for(y=0; y<256; y++)
	{
		for(x=0; x<512; x+=16)
		{
			for (i = 0; i < 16; i++)
			{
				pen = (m_p_videoram[count]) >> (15 - i) & 1;

				if (screen.visible_area().contains(x + i, y))
					bitmap.pix32(y, x + i) = m_palette->pen(pen);
			}

			count++;
		}
	}
	return 0;
}
コード例 #2
0
ファイル: joystand.c プロジェクト: j105rob/mame
UINT32 joystand_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect )
{
	int layers_ctrl = -1;

#ifdef MAME_DEBUG
	if (machine().input().code_pressed(KEYCODE_Z))
	{
		int msk = 0;
		if (machine().input().code_pressed(KEYCODE_Q))  msk |= 1;
		if (machine().input().code_pressed(KEYCODE_W))  msk |= 2;
		if (machine().input().code_pressed(KEYCODE_A))  msk |= 4;
		if (machine().input().code_pressed(KEYCODE_S))  msk |= 8;
		if (msk != 0) layers_ctrl &= msk;
	}
#endif

	m_bg1_tmap->set_scrollx(0, 0);
	m_bg1_tmap->set_scrolly(0, 0);

	m_bg2_tmap->set_scrollx(0, m_scroll[0] - 0xa);
	m_bg2_tmap->set_scrolly(0, m_scroll[1]);

	draw_bg15_tilemap();
		
	bitmap.fill(m_palette->black_pen(), cliprect);
	if (layers_ctrl & 4)	copybitmap_trans(bitmap, m_bg15_bitmap[0], 0, 0, 1, 0, cliprect, BG15_TRANSPARENT);
	if (layers_ctrl & 8)	copybitmap_trans(bitmap, m_bg15_bitmap[1], 0, 0, 0, 0, cliprect, BG15_TRANSPARENT);
	if (layers_ctrl & 1)	m_bg1_tmap->draw(screen, bitmap, cliprect, 0, 0);
	if (layers_ctrl & 2)	m_bg2_tmap->draw(screen, bitmap, cliprect, 0, 0);

	popmessage("S0: %04X S1: %04X EN: %04X OUT: %04X", m_scroll[0], m_scroll[1], m_enable[0], m_outputs[0]);
	return 0;
}
コード例 #3
0
UINT32 intrscti_state::screen_update_intrscti(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int y,x;
	int count;

	bitmap.fill(m_palette->black_pen(), cliprect);

	count = 0;
	for (y=0;y<32;y++)
	{
		for (x=0;x<32;x++)
		{
			int dat;
			dat = m_vram[count];
			m_gfxdecode->gfx(0)->transpen(m_palette,bitmap,cliprect,dat/*+0x100*/,0,0,0,x*8,y*8,0);
			count++;
		}
	}

	count = 0x400;
	for (y=0;y<32;y++)
	{
		for (x=0;x<32;x++)
		{
			int dat;
			dat = m_vram[count];
			m_gfxdecode->gfx(0)->transpen(m_palette,bitmap,cliprect,dat+0x100,0,0,0,x*8,y*8,0);
			count++;
		}
	}

	return 0;
}
コード例 #4
0
ファイル: quizpun2.cpp プロジェクト: Octocontrabass/mame
uint32_t quizpun2_state::screen_update_quizpun2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int layers_ctrl = -1;

#ifdef MAME_DEBUG
	if (machine().input().code_pressed(KEYCODE_Z))
	{
		int msk = 0;
		if (machine().input().code_pressed(KEYCODE_Q))  msk |= 1;
		if (machine().input().code_pressed(KEYCODE_W))  msk |= 2;
		if (msk != 0) layers_ctrl &= msk;
	}
#endif

	int bg_scroll = (m_scroll & 0x3) >> 0;
	int fg_scroll = (m_scroll & 0xc) >> 2;

	m_bg_tmap->set_scrolly(0, bg_scroll * 0x100);
	m_fg_tmap->set_scrolly(0, fg_scroll * 0x100);

	if (layers_ctrl & 1)    m_bg_tmap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
	else                    bitmap.fill(m_palette->black_pen(), cliprect);

	if (layers_ctrl & 2)    m_fg_tmap->draw(screen, bitmap, cliprect, 0, 0);

//  popmessage("BG: %x FG: %x", bg_scroll, fg_scroll);

	return 0;
}
コード例 #5
0
ファイル: dunhuang.cpp プロジェクト: bradhugh/mame
UINT32 dunhuang_state::screen_update_dunhuang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int layers_ctrl = -1;

#if DUNHUANG_DEBUG
if (machine().input().code_pressed(KEYCODE_Z))
{
	int msk = 0;
	if (machine().input().code_pressed(KEYCODE_Q))  msk |= 1;
	if (machine().input().code_pressed(KEYCODE_W))  msk |= 2;
	if (msk != 0) layers_ctrl &= msk;
}
#endif

	bitmap.fill(m_palette->black_pen(), cliprect);

	switch (m_layers)
	{
		case 0x04:  // girl select: bg over fg
			if (layers_ctrl & 2)    m_tmap2->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
			if (layers_ctrl & 1)    m_tmap->draw(screen, bitmap, cliprect, 0, 0);
			break;
		case 0x05:  // dips: must hide fg
			if (layers_ctrl & 1)    m_tmap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
			break;
		case 0x07:  // game,demo: fg over bg
		default:
			if (layers_ctrl & 1)    m_tmap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
			if (layers_ctrl & 2)    m_tmap2->draw(screen, bitmap, cliprect, 0, 0);
			break;
	}

	return 0;
}
コード例 #6
0
ファイル: twins.cpp プロジェクト: SailorSat/cabmame
uint32_t twins_state::screen_update_spider(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int y,x,count;
	static const int xxx=320,yyy=204;

	bitmap.fill(m_palette->black_pen());

	count=0;
	uint8_t *videoram = (uint8_t*)m_videoram;
	for (y=0;y<yyy;y++)
	{
		for(x=0;x<xxx;x++)
		{
			bitmap.pix16(y, x) = videoram[BYTE_XOR_LE(count)];
			count++;
		}
	}

	count = 0;
	videoram = (uint8_t*)m_videoram2;
	for (y=0;y<yyy;y++)
	{
		for(x=0;x<xxx;x++)
		{
			uint8_t pixel = videoram[BYTE_XOR_LE(count)];
			if (pixel) bitmap.pix16(y, x) = pixel;
			count++;
		}
	}

	return 0;
}
コード例 #7
0
ファイル: galaxi.cpp プロジェクト: bradhugh/mame
UINT32 galaxi_state::screen_update_galaxi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	m_bg3_tmap->set_scrollx(m_bg3_xscroll);
	m_bg3_tmap->set_scrolly(m_bg3_yscroll);

	int layers_ctrl = -1;

#ifdef MAME_DEBUG
	if (machine().input().code_pressed(KEYCODE_R))  // remapped due to inputs changes.
	{
		int msk = 0;
		if (machine().input().code_pressed(KEYCODE_T))  msk |= 1;
		if (machine().input().code_pressed(KEYCODE_Y))  msk |= 2;
		if (machine().input().code_pressed(KEYCODE_U))  msk |= 4;
		if (machine().input().code_pressed(KEYCODE_I))  msk |= 8;
		if (machine().input().code_pressed(KEYCODE_O))  msk |= 16;
		if (msk != 0) layers_ctrl &= msk;
	}
#endif


	if (layers_ctrl & 1)    m_bg1_tmap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
	else                bitmap.fill(m_palette->black_pen(), cliprect);
	if (layers_ctrl & 2)    m_bg2_tmap->draw(screen, bitmap, cliprect, 0, 0);
	if (layers_ctrl & 4)    m_bg3_tmap->draw(screen, bitmap, cliprect, 0, 0);
	if (layers_ctrl & 8)    m_bg4_tmap->draw(screen, bitmap, cliprect, 0, 0);

	if (layers_ctrl & 16)   m_fg_tmap->draw(screen, bitmap, cliprect, 0, 0);

	return 0;
}
コード例 #8
0
ファイル: taitowlf.c プロジェクト: Archlogic/libretro-mame
UINT32 taitowlf_state::screen_update_taitowlf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	int x,y,count;

	bitmap.fill(m_palette->black_pen(), cliprect);

	count = (0);

	for(y=0;y<256;y++)
	{
		for(x=0;x<512;x++)
		{
			UINT32 color;

			color = (m_bootscreen_rom[count] & 0xff);

			if(cliprect.contains(x+0, y))
				bitmap.pix32(y, x+0) = m_palette->pen(color);

			count++;
		}
	}

	return 0;
}
コード例 #9
0
ファイル: guab.cpp プロジェクト: Robbbert/store1
uint32_t guab_state::screen_update_guab(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	m_tms34061->get_display_state();

	/* If blanked, fill with black */
	if (m_tms34061->m_display.blanked)
	{
		bitmap.fill(m_palette->black_pen(), cliprect);
		return 0;
	}

	for (int y = cliprect.min_y; y <= cliprect.max_y; ++y)
	{
		uint8_t *src = &m_tms34061->m_display.vram[256 * y];
		uint16_t *dest = &bitmap.pix16(y);

		for (int x = cliprect.min_x; x <= cliprect.max_x; x += 2)
		{
			uint8_t pen = src[x >> 1];

			/* Draw two 4-bit pixels */
			*dest++ = m_palette->pen(pen >> 4);
			*dest++ = m_palette->pen(pen & 0x0f);
		}
	}

	return 0;
}
コード例 #10
0
ファイル: astrcorp.c プロジェクト: jiangzhonghui/mame
UINT32 astrocorp_state::screen_update_astrocorp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
    if (m_screen_enable & 1)
        copybitmap(bitmap, m_bitmap, 0,0,0,0, cliprect);
    else
        bitmap.fill(m_palette->black_pen(), cliprect);

    return 0;
}
コード例 #11
0
ファイル: apc.c プロジェクト: dinkc64/mame
UINT32 apc_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect )
{
	bitmap.fill(m_palette->black_pen(), cliprect);

	/* graphics */
	m_hgdc2->screen_update(screen, bitmap, cliprect);
	m_hgdc1->screen_update(screen, bitmap, cliprect);

	return 0;
}
コード例 #12
0
ファイル: cabaret.cpp プロジェクト: SailorSat/cabmame
uint32_t cabaret_state::screen_update_cabaret(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	bitmap.fill(m_palette->black_pen(), cliprect);

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

	m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);

	return 0;
}
コード例 #13
0
ファイル: supduck.cpp プロジェクト: qwijibo/mame
uint32_t supduck_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	bitmap.fill(m_palette->black_pen(), cliprect);

	m_back_tilemap->draw(screen, bitmap, cliprect, 0, 0);
	m_fore_tilemap->draw(screen, bitmap, cliprect, 0, 0);

	m_spritegen->draw_sprites(bitmap, cliprect, m_gfxdecode, 3, m_spriteram->buffer(), m_spriteram->bytes(), flip_screen(), 1 );

	m_text_tilemap->draw(screen, bitmap, cliprect, 0, 0);
	return 0;
}
コード例 #14
0
ファイル: jchan.cpp プロジェクト: stengun/mame
UINT32 jchan_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int x,y;
	UINT16* src1;
	UINT16* src2;
	UINT16* dst;
	UINT16 pixdata1;
	UINT16 pixdata2;

	bitmap.fill(m_palette->black_pen(), cliprect);

	screen.priority().fill(0, cliprect);

	m_view2_0->kaneko16_prepare(bitmap, cliprect);

	for ( int i = 0; i < 8; i++ )
	{
		m_view2_0->render_tilemap_chip(screen,bitmap,cliprect,i);
	}

	m_sprite_bitmap_1->fill(0x0000, cliprect);
	m_sprite_bitmap_2->fill(0x0000, cliprect);

	m_spritegen1->skns_draw_sprites(*m_sprite_bitmap_1, cliprect, m_sprite_ram32_1, 0x4000, memregion("gfx1")->base(), memregion ("gfx1")->bytes(), m_sprite_regs32_1 );
	m_spritegen2->skns_draw_sprites(*m_sprite_bitmap_2, cliprect, m_sprite_ram32_2, 0x4000, memregion("gfx2")->base(), memregion ("gfx2")->bytes(), m_sprite_regs32_2 );

	// ignoring priority bits for now - might use alpha too, check 0x8000 of palette writes
	for (y=0;y<240;y++)
	{
		src1 = &m_sprite_bitmap_1->pix16(y);
		src2 = &m_sprite_bitmap_2->pix16(y);
		dst =  &bitmap.pix16(y);

		for (x=0;x<320;x++)
		{
			pixdata1 = src1[x];
			pixdata2 = src2[x];

			if (pixdata2 & 0x3fff)
			{
				dst[x] = (pixdata2 & 0x3fff)|0x4000;
			}

			if (pixdata1 & 0x3fff)
			{
				dst[x] = (pixdata1 & 0x3fff)|0x4000;
			}
		}
	}

	return 0;
}
コード例 #15
0
ファイル: hvyunit.cpp プロジェクト: NULUSIOS/mame
UINT32 hvyunit_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
#define SX_POS  96
#define SY_POS  0

	m_bg_tilemap->set_scrollx(0, ((m_port0_data & 0x40) << 2) + m_scrollx + SX_POS); // TODO
	m_bg_tilemap->set_scrolly(0, ((m_port0_data & 0x80) << 1) + m_scrolly + SY_POS); // TODO
	bitmap.fill(m_palette->black_pen(), cliprect);
	m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
	m_pandora->update(bitmap, cliprect);

	return 0;
}
コード例 #16
0
ファイル: quizpun2.cpp プロジェクト: Fulg/mame
UINT32 quizpun2_state::screen_update_quizpun2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int layers_ctrl = -1;

#ifdef MAME_DEBUG
	if (machine().input().code_pressed(KEYCODE_Z))
	{
		int msk = 0;
		if (machine().input().code_pressed(KEYCODE_Q))  msk |= 1;
		if (machine().input().code_pressed(KEYCODE_W))  msk |= 2;
		if (msk != 0) layers_ctrl &= msk;
	}
#endif

	if (layers_ctrl & 1)    m_bg_tmap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
	else                    bitmap.fill(m_palette->black_pen(), cliprect);

bitmap.fill(m_palette->black_pen(), cliprect);
	if (layers_ctrl & 2)    m_fg_tmap->draw(screen, bitmap, cliprect, 0, 0);

	return 0;
}
コード例 #17
0
ファイル: cedar_magnet.cpp プロジェクト: Robbbert/store1
uint32_t cedar_magnet_state::screen_update_cedar_magnet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{

	bitmap.fill(m_palette->black_pen(), cliprect);

	int pal = (m_palbank >> 6);

	m_cedplane1->draw(screen, bitmap, cliprect,pal);
	m_cedplane0->draw(screen, bitmap, cliprect,pal);
	m_cedsprite->draw(screen, bitmap, cliprect,pal);

	return 0;
}
コード例 #18
0
ファイル: igs_m027.c プロジェクト: kkklatu/mame
UINT32 igs_m027_state::screen_update_igs_majhong(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	//??????????
	bitmap.fill(m_palette->black_pen(), cliprect);

	//??????
	m_igs_bg_tilemap->draw(screen, bitmap, cliprect, 0,0);

	//CG??????

	//??????
	m_igs_tx_tilemap->draw(screen, bitmap, cliprect, 0,0);
	//fprintf(stdout,"Video UPDATE OK!\n");
	return 0;
}
コード例 #19
0
ファイル: bmcbowl.c プロジェクト: mbcoguno/mame
UINT32 bmcbowl_state::screen_update_bmcbowl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
/*
      280x230,4 bitmap layers, 8bpp,
        missing scroll and priorities   (maybe fixed ones)
*/

	int x,y,z,pixdat;
	bitmap.fill(m_palette->black_pen(), cliprect);

	z=0;
	for (y=0;y<230;y++)
	{
		for (x=0;x<280;x+=2)
		{
			pixdat = m_vid2[0x8000+z];

			if(pixdat&0xff)
				bitmap.pix16(y, x+1) = (pixdat&0xff);
			if(pixdat>>8)
				bitmap.pix16(y, x) = (pixdat>>8);

			pixdat = m_vid2[z];

			if(pixdat&0xff)
				bitmap.pix16(y, x+1) = (pixdat&0xff);
			if(pixdat>>8)
				bitmap.pix16(y, x) = (pixdat>>8);

			pixdat = m_vid1[0x8000+z];

			if(pixdat&0xff)
				bitmap.pix16(y, x+1) = (pixdat&0xff);
			if(pixdat>>8)
				bitmap.pix16(y, x) = (pixdat>>8);

			pixdat = m_vid1[z];

			if(pixdat&0xff)
				bitmap.pix16(y, x+1) = (pixdat&0xff);
			if(pixdat>>8)
				bitmap.pix16(y, x) = (pixdat>>8);

			z++;
		}
	}
	return 0;
}
コード例 #20
0
UINT32 umipoker_state::screen_update_umipoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	m_tilemap_0->set_scrolly(0, m_umipoker_scrolly[0]);
	m_tilemap_1->set_scrolly(0, m_umipoker_scrolly[1]);
	m_tilemap_2->set_scrolly(0, m_umipoker_scrolly[2]);
	m_tilemap_3->set_scrolly(0, m_umipoker_scrolly[3]);

	bitmap.fill(m_palette->black_pen(), cliprect);

	m_tilemap_0->draw(screen, bitmap, cliprect, 0,0);
	m_tilemap_1->draw(screen, bitmap, cliprect, 0,0);
	m_tilemap_2->draw(screen, bitmap, cliprect, 0,0);
	m_tilemap_3->draw(screen, bitmap, cliprect, 0,0);

	return 0;
}
コード例 #21
0
ファイル: magicard.cpp プロジェクト: Fulg/mame
UINT32 magicard_state::screen_update_magicard(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	int x, y;
	UINT32 count;

	bitmap.fill(m_palette->black_pen(), cliprect); //TODO

	if(!(SCC_DE_VREG)) //display enable
		return 0;

	count = ((SCC_VSR_VREG) / 2);

	if(SCC_FG_VREG) //4bpp gfx
	{
		for(y = 0; y < 300; y++)
		{
			for(x = 0; x < 84; x++)
			{
				UINT32 color;

				color = ((m_magicram[count]) & 0x000f) >> 0;

				if(cliprect.contains((x * 4) + 3, y))
					bitmap.pix32(y, (x * 4) + 3) = m_palette->pen(color);

				color = ((m_magicram[count]) & 0x00f0) >> 4;

				if(cliprect.contains((x * 4) + 2, y))
					bitmap.pix32(y, (x * 4) + 2) = m_palette->pen(color);

				color = ((m_magicram[count]) & 0x0f00) >> 8;

				if(cliprect.contains((x * 4) + 1, y))
					bitmap.pix32(y, (x * 4) + 1) = m_palette->pen(color);

				color = ((m_magicram[count]) & 0xf000) >> 12;

				if(cliprect.contains((x * 4) + 0, y))
					bitmap.pix32(y, (x * 4) + 0) = m_palette->pen(color);

				count++;
			}
		}
	}
	else //8bpp gfx
	{
		for(y = 0; y < 300; y++)
コード例 #22
0
ファイル: jackie.cpp プロジェクト: bmunger/mame
UINT32 jackie_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int i,j;
	int startclipmin = 0;
	const rectangle &visarea = screen.visible_area();

	bitmap.fill(m_palette->black_pen(), cliprect);

	for (i=0;i < 0x40;i++)
	{
		m_reel1_tilemap->set_scrolly(i, m_bg_scroll[i+0x000]);
		m_reel2_tilemap->set_scrolly(i, m_bg_scroll[i+0x040]);
		m_reel3_tilemap->set_scrolly(i, m_bg_scroll[i+0x080]);
	}

	for (j=0; j < 0x100-1; j++)
	{
		rectangle clip;
		int rowenable = m_bg_scroll2[j];

		/* draw top of screen */
		clip.set(visarea.min_x, visarea.max_x, startclipmin, startclipmin+1);

		if (rowenable==0)
		{
			m_reel1_tilemap->draw(screen, bitmap, clip, 0,0);
		}
		else if (rowenable==1)
		{
			m_reel2_tilemap->draw(screen, bitmap, clip, 0,0);
		}
		else if (rowenable==2)
		{
			m_reel3_tilemap->draw(screen, bitmap, clip, 0,0);
		}
		else if (rowenable==3)
		{
		}

		startclipmin+=1;
	}

	m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);

	return 0;
}
コード例 #23
0
ファイル: suprgolf.c プロジェクト: dinkc64/mame
UINT32 suprgolf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int x,y,count,color;
	bitmap.fill(m_palette->black_pen(), cliprect);

	{
		count = 0;

		for(y=0;y<256;y++)
		{
			for(x=0;x<512;x++)
			{
				color = m_bg_fb[count];

				if(x <= cliprect.max_x && y <= cliprect.max_y)
					bitmap.pix16(y, x) = m_palette->pen((color & 0x7ff));

				count++;
			}
		}
	}

	{
		count = 0;

		for(y=0;y<256;y++)
		{
			for(x=0;x<512;x++)
			{
				color = m_fg_fb[count];

				if(((m_fg_fb[count] & 0x0f) != 0x0f) && (x <= cliprect.max_x && y <= cliprect.max_y))
					bitmap.pix16(y, x) = m_palette->pen((color & 0x7ff));

				count++;
			}
		}
	}

	m_tilemap->draw(screen, bitmap, cliprect, 0,0);

	return 0;
}
コード例 #24
0
ファイル: bingor.c プロジェクト: jiangzhonghui/mame
UINT32 bingor_state::screen_update_bingor(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	int x,y,count;

	bitmap.fill(m_palette->black_pen(), cliprect);

	count = (0x2000/2);

	for(y=0;y<256;y++)
	{
		for(x=0;x<286;x+=4)
		{
			UINT32 color;

			color = (m_blit_ram[count] & 0xf000)>>12;

			if(cliprect.contains(x+3, y))
				bitmap.pix32(y, x+3) = m_palette->pen(color);

			color = (m_blit_ram[count] & 0x0f00)>>8;

			if(cliprect.contains(x+2, y))
				bitmap.pix32(y, x+2) = m_palette->pen(color);

			color = (m_blit_ram[count] & 0x00f0)>>4;

			if(cliprect.contains(x+1, y))
				bitmap.pix32(y, x+1) = m_palette->pen(color);

			color = (m_blit_ram[count] & 0x000f)>>0;

			if(cliprect.contains(x+0, y))
				bitmap.pix32(y, x+0) = m_palette->pen(color);

			count++;
		}
	}

	return 0;
}
コード例 #25
0
ファイル: lastfght.cpp プロジェクト: qwijibo/mame
uint32_t lastfght_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
#ifdef MAME_DEBUG
#if 1
	// gfx roms viewer (toggle with enter, use pgup/down to browse)
	int x, y, count = 0;
	uint8_t *gfxdata = memregion("gfx1")->base();
	uint8_t data;

	if (machine().input().code_pressed_once(KEYCODE_ENTER)) m_view_roms ^= 1;
	if (m_view_roms)
	{
		if (machine().input().code_pressed_once(KEYCODE_PGDN))  m_base += 512 * 256;
		if (machine().input().code_pressed_once(KEYCODE_PGUP))  m_base -= 512 * 256;
		m_base %= memregion("gfx1")->bytes();

		count = m_base;

		bitmap.fill(m_palette->black_pen(), cliprect );
		for (y = 0 ; y < 256; y++)
		{
			for (x = 0; x < 512; x++)
			{
				data = (((count & 0xf) == 0) && ((count & 0x1e00) == 0)) ? m_palette->white_pen() : gfxdata[count];   // white grid or data
				bitmap.pix16(y, x) = data;
				count++;
			}
		}
		popmessage("%x", m_base);
		return 0;
	}
#endif
#endif

	copybitmap(bitmap, m_bitmap[m_dest ^ 1], 0, 0, 0, 0, cliprect);

	return 0;
}
コード例 #26
0
ファイル: sealy.cpp プロジェクト: Fulg/mame
UINT32 sealy_state::screen_update_sealy(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
	bitmap.fill(m_palette->black_pen(), cliprect);
	return 0;
}
コード例 #27
0
ファイル: ttchamp.cpp プロジェクト: stengun/mame
UINT32 ttchamp_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	logerror("update\n");
	int y,x,count;

	static const int xxx=320,yyy=204;

	bitmap.fill(m_palette->black_pen());
	UINT8 *videoramfg;
	UINT8* videorambg;

	count=0;
	videorambg = (UINT8*)m_videoram0;
	videoramfg = (UINT8*)m_videoram2;

	for (y=0;y<yyy;y++)
	{
		for(x=0;x<xxx;x++)
		{
			bitmap.pix16(y, x) = videorambg[BYTE_XOR_LE(count)]+0x300;
			count++;
		}
	}

	/*
	count=0;
	videoram = (UINT8*)m_videoram1;
	for (y=0;y<yyy;y++)
	{
	    for(x=0;x<xxx;x++)
	    {
	        UINT8 pix = videoram[BYTE_XOR_LE(count)];
	        if (pix) bitmap.pix16(y, x) = pix+0x200;
	        count++;
	    }
	}
	*/

	count=0;
	for (y=0;y<yyy;y++)
	{
		for(x=0;x<xxx;x++)
		{
			UINT8 pix = videoramfg[BYTE_XOR_LE(count)];
			if (pix)
			{
				// first pen values seem to be special
				// see char select and shadows ingame
				// pen 0 = transparent
				// pen 1 = blend 1
				// pen 2 = blend 2
				// pen 3 = ??

				if (pix == 0x01) // blend mode 1
				{
					UINT8 pix = videorambg[BYTE_XOR_LE(count)];
					bitmap.pix16(y, x) = pix + 0x200;
				}
				else if (pix == 0x02) // blend mode 2
				{
					UINT8 pix = videorambg[BYTE_XOR_LE(count)];
					bitmap.pix16(y, x) = pix + 0x100;
				}
				else
				{
					bitmap.pix16(y, x) = pix + 0x000;
				}
			}
			count++;
		}
	}

#if 0
	for (int i = 0; i < 0x8000; i++)
	{
		// how are layers cleared?
		// I think it actually does more blit operations with
		// different bits of m_port10 set to redraw the backgrounds using the video ram data as a source rather than ROM - notice the garbage you see behind 'sprites' right now
		// this method also removes the text layer, which we don't want
	//  m_videoram1[i] = 0x0000;
	//  m_videoram2[i] = 0x0000;
	}
#endif

	return 0;
}
コード例 #28
0
ファイル: dmndrby.cpp プロジェクト: PugsyMAME/mame
uint32_t dmndrby_state::screen_update_dderby(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int x,y,count;
	int off,scrolly;
	gfx_element *gfx = m_gfxdecode->gfx(0);
	gfx_element *sprites = m_gfxdecode->gfx(1);
	gfx_element *track = m_gfxdecode->gfx(2);

	bitmap.fill(m_palette->black_pen(), cliprect);


/* Draw racetrack

racetrack seems to be stored in 4th and 5th prom.
can we draw it with the tilemap? maybe not, the layout is a litle strange

*/
//  base = m_scroll_ram[0];

	off=0x1900-(m_bg*0x100)+(m_scroll_ram[1])*0x100;
	scrolly = 0xff-(m_scroll_ram[0]);
	if(m_scroll_ram[1]==0xff) off=0x1800;
	for(x=0;x<16;x++) {
		for(y=0;y<16;y++) {
			int chr = m_racetrack_tilemap_rom[off];
			int col = m_racetrack_tilemap_rom[off+0x2000]&0x1f;
			int flipx = m_racetrack_tilemap_rom[off+0x2000]&0x40;
			track->opaque(bitmap,cliprect,chr,col,flipx,0,y*16+scrolly,x*16);
			// draw another bit of track
			// a rubbish way of doing it
			chr = m_racetrack_tilemap_rom[off-0x100];
			col = m_racetrack_tilemap_rom[off+0x1f00]&0x1f;
			flipx = m_racetrack_tilemap_rom[off+0x1f00]&0x40;
			track->opaque(bitmap,cliprect,chr,col,flipx,0,y*16-256+scrolly,x*16);
			off++;
		}
	}


//return 0;

/* draw sprites

 guess work  again! seems to work fine and horse labels match up
wouldnt like to say its the most effective way though...
 -- maybe they should be decoded as 'big sprites' instead?

*/
	for (count=5;count>=0;count-- )
	{
		int a=0;
		int b=0;
		int base = count*4;
		int sprx=m_sprite_ram[base+3];
		int spry=m_sprite_ram[base+2];
		//m_sprite_ram[base+1];
		int col = (m_sprite_ram[base+1]&0x1f);
		int anim = (m_sprite_ram[base]&0x3)*0x40; // animation frame - probably wrong but seems right
		int horse = (m_sprite_ram[base+1]&0x7)*8+7;  // horse label from 1 - 6

		for (a=0;a<8 ;a++)
		{
			for(b=0;b<7;b++) {
				sprites->transpen(bitmap,cliprect,anim+a*8+b,col,0,0,sprx+a*8,spry+b*8,0);
			}
		}
		// draw the horse number
		a=3;
		b=3;
		sprites->transpen(bitmap,cliprect,anim+horse,col,0,0,sprx+a*8,spry+b*8,0);


	}

	/*TODO: Fix / understand how the transparency works properly. */
	count=0;
	for (y=0;y<32;y++)
	{
		for(x=0;x<32;x++)
		{
			int tileno,bank,color;
			tileno=m_dderby_vidchars[count];
			bank=(m_dderby_vidattribs[count]&0x20)>>5;
			tileno|=(bank<<8);
			color=((m_dderby_vidattribs[count])&0x1f);

			gfx->transpen(bitmap,cliprect,tileno,color,0,0,x*8,y*8,(tileno == 0x38) ? 0 : -1);

			count++;
		}
	}


	return 0;
}
コード例 #29
0
UINT32 itgamble_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	bitmap.fill(m_palette->black_pen());
	return 0;
}
コード例 #30
0
UINT32 igs009_state::screen_update_jingbell(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int layers_ctrl = m_video_enable ? -1 : 0;

#ifdef MAME_DEBUG
	if (machine().input().code_pressed(KEYCODE_Z))
	{
		int mask = 0;
		if (machine().input().code_pressed(KEYCODE_Q))  mask |= 1;
		if (machine().input().code_pressed(KEYCODE_W))  mask |= 2;
		if (machine().input().code_pressed(KEYCODE_A))  mask |= 4;
		if (mask != 0) layers_ctrl &= mask;
	}
#endif

	if (layers_ctrl & 1)
	{
		int zz,i;
		int startclipmin = 0;
		const rectangle &visarea = screen.visible_area();


		for (i= 0;i < 0x80;i++)
		{
			m_gp98_reel1_tilemap->set_scrolly(i, m_bg_scroll[i]*2);
			m_gp98_reel2_tilemap->set_scrolly(i, m_bg_scroll[i+0x80]*2);
			m_gp98_reel3_tilemap->set_scrolly(i, m_bg_scroll[i+0x100]*2);
			m_gp98_reel4_tilemap->set_scrolly(i, m_bg_scroll[i+0x180]*2);
		}




		for (zz=0;zz<0x80-8;zz++) // -8 because of visible area (2*8 = 16)
		{
			rectangle clip;
			int rowenable = m_bg_scroll2[zz];

			/* draw top of screen */
			clip.set(visarea.min_x, visarea.max_x, startclipmin, startclipmin+2);

			bitmap.fill(m_palette->pen(rowenable), clip);

			if (rowenable==0)
			{ // 0 and 1 are the same? or is there a global switchoff?
				m_gp98_reel1_tilemap->draw(screen, bitmap, clip, 0,0);
			}
			else if (rowenable==1)
			{
				m_gp98_reel2_tilemap->draw(screen, bitmap, clip, 0,0);
			}
			else if (rowenable==2)
			{
				m_gp98_reel3_tilemap->draw(screen, bitmap, clip, 0,0);
			}
			else if (rowenable==3)
			{
				m_gp98_reel4_tilemap->draw(screen, bitmap, clip, 0,0);
			}


			startclipmin+=2;
		}

	}
	else                    bitmap.fill(m_palette->black_pen(), cliprect);


	if (layers_ctrl & 2)    m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);

	return 0;
}