当前位置: 首页>>代码示例>>C++>>正文


C++ screen_device::width方法代码示例

本文整理汇总了C++中screen_device::width方法的典型用法代码示例。如果您正苦于以下问题:C++ screen_device::width方法的具体用法?C++ screen_device::width怎么用?C++ screen_device::width使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在screen_device的用法示例。


在下文中一共展示了screen_device::width方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: blstroid_scanline_update

void blstroid_scanline_update(screen_device &screen, int scanline)
{
	blstroid_state *state = screen.machine->driver_data<blstroid_state>();
	int offset = (scanline / 8) * 64 + 40;

	/* check for interrupts */
	if (offset < 0x1000)
		if (state->playfield[offset] & 0x8000)
		{
			int width, vpos;
			attotime period_on;
			attotime period_off;

			/* FIXME: - the only thing this IRQ does it tweak the starting MO link */
			/* unfortunately, it does it too early for the given MOs! */
			/* perhaps it is not actually hooked up on the real PCB... */
			return;

			/* set a timer to turn the interrupt on at HBLANK of the 7th scanline */
			/* and another to turn it off one scanline later */
			width = screen.width();
			vpos  = screen.vpos();
			period_on  = screen.time_until_pos(vpos + 7, width * 0.9);
			period_off = screen.time_until_pos(vpos + 8, width * 0.9);

			timer_set(screen.machine, period_on, NULL,  0, irq_on);
			timer_set(screen.machine, period_off, NULL, 0, irq_off);
		}
}
开发者ID:DarrenBranford,项目名称:MAME4iOS,代码行数:29,代码来源:blstroid.c

示例2:

bool comx35_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
{
	if (screen.width() == CDP1869_SCREEN_WIDTH)
	{
		m_vis->update_screen(&bitmap, &cliprect);
	}
	else
	{
		m_expansion->screen_update(screen, bitmap, cliprect);
	}

	return false;
}
开发者ID:rogerjowett,项目名称:ClientServerMAME,代码行数:13,代码来源:comx35.c

示例3: scanline_update

void skullxbo_state::scanline_update(screen_device &screen, int scanline)
{
	/* check for interrupts in the alpha ram */
	/* the interrupt occurs on the HBLANK of the 6th scanline following */
	int offset = (scanline / 8) * 64 + 42;
	if (offset < 0x7c0 && (m_alpha_tilemap->basemem_read(offset) & 0x8000))
	{
		int width = screen.width();
		attotime period = screen.time_until_pos(screen.vpos() + 6, width * 0.9);
		m_scanline_timer->adjust(period);
	}

	/* update the playfield and motion objects */
	skullxbo_scanline_update(scanline);
}
开发者ID:felipesanches,项目名称:ume,代码行数:15,代码来源:skullxbo.c

示例4: alpha_row_update

static void alpha_row_update(screen_device &screen, int scanline)
{
	skullxbo_state *state = screen.machine().driver_data<skullxbo_state>();
	UINT16 *check = &state->m_alpha[(scanline / 8) * 64 + 42];

	/* check for interrupts in the alpha ram */
	/* the interrupt occurs on the HBLANK of the 6th scanline following */
	if (check < &state->m_alpha[0x7c0] && (*check & 0x8000))
	{
		int	width = screen.width();
		attotime period = screen.time_until_pos(screen.vpos() + 6, width * 0.9);
		screen.machine().scheduler().timer_set(period, FUNC(irq_gen));
	}

	/* update the playfield and motion objects */
	skullxbo_scanline_update(screen.machine(), scanline);
}
开发者ID:cdenix,项目名称:psmame,代码行数:17,代码来源:skullxbo.c

示例5:

tc0780fpa_renderer::tc0780fpa_renderer(device_t &parent, screen_device &screen, const uint8_t *texture_ram)
	: poly_manager<float, tc0780fpa_polydata, 6, 10000>(screen)
{
	int width = screen.width();
	int height = screen.height();

	m_fb[0] = std::make_unique<bitmap_ind16>(width, height);
	m_fb[1] = std::make_unique<bitmap_ind16>(width, height);
	m_zb = std::make_unique<bitmap_ind16>(width, height);

	m_texture = texture_ram;

	m_cliprect = screen.cliprect();

	m_current_fb = 0;

	// save state
	parent.save_item(NAME(*m_fb[0]));
	parent.save_item(NAME(*m_fb[1]));
	parent.save_item(NAME(*m_zb));
}
开发者ID:goofwear,项目名称:mame,代码行数:21,代码来源:tc0780fpa.cpp

示例6:

// renders to 2 bitmaps, and mixes output
UINT32 toaplan2_state::screen_update_batsugun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
//  bitmap.fill(0, cliprect);
//  gp9001_custom_priority_bitmap->fill(0, cliprect);

	if (m_vdp0)
	{
		bitmap.fill(0, cliprect);
		m_custom_priority_bitmap.fill(0, cliprect);
		m_vdp0->gp9001_render_vdp(bitmap, cliprect);
	}
	if (m_vdp1)
	{
		m_secondary_render_bitmap.fill(0, cliprect);
		m_custom_priority_bitmap.fill(0, cliprect);
		m_vdp1->gp9001_render_vdp(m_secondary_render_bitmap, cliprect);
	}


	// key test places in batsugun
	// level 2 - the two layers of clouds (will appear under background, or over ships if wrong)
	// level 3 - the special effect 'layer' which should be under everything (will appear over background if wrong)
	// level 4(?) - the large clouds (will obscure player if wrong)
	// high score entry - letters will be missing if wrong
	// end credits - various issues if wrong, clouds like level 2
	//
	// when implemented based directly on the PAL equation it doesn't work, however, my own equations roughly based
	// on that do.
	//

	if (m_vdp0 && m_vdp1)
	{
		int width = screen.width();
		int height = screen.height();
		int y,x;
		UINT16* src_vdp0; // output buffer of vdp0
		UINT16* src_vdp1; // output buffer of vdp1

		for (y=0;y<height;y++)
		{
			src_vdp0 = &bitmap.pix16(y);
			src_vdp1 = &m_secondary_render_bitmap.pix16(y);

			for (x=0;x<width;x++)
			{
				UINT16 GPU0_LUTaddr = src_vdp0[x];
				UINT16 GPU1_LUTaddr = src_vdp1[x];

				// these equations is derived from the PAL, but doesn't seem to work?

				int COMPARISON = ((GPU0_LUTaddr & 0x0780) > (GPU1_LUTaddr & 0x0780));

				// note: GPU1_LUTaddr & 0x000f - transparency check for vdp1? (gfx are 4bpp, the low 4 bits of the lookup would be the pixel data value)
#if 0
				int result =
							((GPU0_LUTaddr & 0x0008) & !COMPARISON)
						| ((GPU0_LUTaddr & 0x0008) & !(GPU1_LUTaddr & 0x000f))
						| ((GPU0_LUTaddr & 0x0004) & !COMPARISON)
						| ((GPU0_LUTaddr & 0x0004) & !(GPU1_LUTaddr & 0x000f))
						| ((GPU0_LUTaddr & 0x0002) & !COMPARISON)
						| ((GPU0_LUTaddr & 0x0002) & !(GPU1_LUTaddr & 0x000f))
						| ((GPU0_LUTaddr & 0x0001) & !COMPARISON)
						| ((GPU0_LUTaddr & 0x0001) & !(GPU1_LUTaddr & 0x000f));

				if (result) src_vdp0[x] = GPU0_LUTaddr;
				else src_vdp0[x] = GPU1_LUTaddr;
#endif
				// this seems to work tho?
				if (!(GPU1_LUTaddr & 0x000f))
				{
					src_vdp0[x] = GPU0_LUTaddr;
				}
				else
				{
					if (!(GPU0_LUTaddr & 0x000f))
					{
						src_vdp0[x] = GPU1_LUTaddr; // bg pen
					}
					else
					{
						if (COMPARISON)
						{
							src_vdp0[x] = GPU1_LUTaddr;
						}
						else
						{
							src_vdp0[x] = GPU0_LUTaddr;
						}

					}
				}
			}
		}
	}

	return 0;
}
开发者ID:libretro,项目名称:mame2014-libretro,代码行数:98,代码来源:toaplan2.c


注:本文中的screen_device::width方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。