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


C++ bitmap_ind16::valid方法代码示例

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


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

示例1: screen_update

UINT32 crtc_ega_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	assert(bitmap.valid());

	if (m_has_valid_parameters)
	{
		UINT16 y;

		void *param = NULL;

		assert(m_update_row != NULL);

		/* call the set up function if any */
		if (m_begin_update != NULL)
			param = m_begin_update(this, bitmap, cliprect);

		if (cliprect.min_y == 0)
		{
			/* read the start address at the beginning of the frame */
			m_current_disp_addr = m_disp_start_addr;
		}

		/* for each row in the visible region */
		for (y = cliprect.min_y; y <= cliprect.max_y; y++)
		{
			/* compute the current raster line */
			UINT8 ra = y % (m_max_ras_addr + 1);

			/* check if the cursor is visible and is on this scanline */
			int cursor_visible = m_cursor_state &&
								(ra >= (m_cursor_start_ras & 0x1f)) &&
								( (ra <= (m_cursor_end_ras & 0x1f)) || ((m_cursor_end_ras & 0x1f) == 0x00 )) &&
								(m_cursor_addr >= m_current_disp_addr) &&
								(m_cursor_addr < (m_current_disp_addr + ( m_horiz_disp + 1 )));

			/* compute the cursor X position, or -1 if not visible */
			INT8 cursor_x = cursor_visible ? (m_cursor_addr - m_current_disp_addr) : -1;

			/* call the external system to draw it */
			m_update_row(this, bitmap, cliprect, m_current_disp_addr, ra, y, m_horiz_disp + 1, cursor_x, param);

			/* update MA if the last raster address */
			if (ra == m_max_ras_addr)
				m_current_disp_addr = (m_current_disp_addr + m_horiz_disp + 1) & 0xffff;
		}

		/* call the tear down function if any */
		if (m_end_update != NULL)
			m_end_update(this, bitmap, cliprect, param);
	}
	else
		logerror("Invalid crtc_ega screen parameters - display disabled!!!\n");

	return 0;
}
开发者ID:jiangzhonghui,项目名称:mame,代码行数:55,代码来源:crtc_ega.c


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