本文整理汇总了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;
}