本文整理汇总了C++中screen_device::update_partial方法的典型用法代码示例。如果您正苦于以下问题:C++ screen_device::update_partial方法的具体用法?C++ screen_device::update_partial怎么用?C++ screen_device::update_partial使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类screen_device
的用法示例。
在下文中一共展示了screen_device::update_partial方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void atarig42_state::scanline_update(screen_device &screen, int scanline)
{
int i;
if (scanline == 0) logerror("-------\n");
/* keep in range */
int offset = (scanline / 8) * 64 + 48;
if (offset >= 0x800)
return;
/* update the playfield scrolls */
for (i = 0; i < 8; i++)
{
uint16_t word;
word = m_alpha_tilemap->basemem_read(offset++);
if (word & 0x8000)
{
int newscroll = (word >> 5) & 0x3ff;
int newbank = word & 0x1f;
if (newscroll != m_playfield_xscroll)
{
if (scanline + i > 0)
screen.update_partial(scanline + i - 1);
m_playfield_tilemap->set_scrollx(0, newscroll);
m_playfield_xscroll = newscroll;
}
if (newbank != m_playfield_color_bank)
{
if (scanline + i > 0)
screen.update_partial(scanline + i - 1);
m_playfield_tilemap->mark_all_dirty();
m_playfield_color_bank = newbank;
}
}
word = m_alpha_tilemap->basemem_read(offset++);
if (word & 0x8000)
{
int newscroll = ((word >> 6) - (scanline + i)) & 0x1ff;
int newbank = word & 7;
if (newscroll != m_playfield_yscroll)
{
if (scanline + i > 0)
screen.update_partial(scanline + i - 1);
m_playfield_tilemap->set_scrolly(0, newscroll);
m_playfield_yscroll = newscroll;
}
if (newbank != m_playfield_tile_bank)
{
if (scanline + i > 0)
screen.update_partial(scanline + i - 1);
m_playfield_tilemap->mark_all_dirty();
m_playfield_tile_bank = newbank;
}
}
示例2: atarig1_scanline_update
void atarig1_scanline_update(screen_device &screen, int scanline)
{
atarig1_state *state = (atarig1_state *)screen.machine->driver_data;
UINT16 *base = &state->atarigen.alpha[(scanline / 8) * 64 + 48];
int i;
//if (scanline == 0) logerror("-------\n");
/* keep in range */
if (base >= &state->atarigen.alpha[0x800])
return;
screen.update_partial(MAX(scanline - 1, 0));
/* update the playfield scrolls */
for (i = 0; i < 8; i++)
{
UINT16 word;
/* first word controls horizontal scroll */
word = *base++;
if (word & 0x8000)
{
int newscroll = ((word >> 6) + state->pfscroll_xoffset) & 0x1ff;
if (newscroll != state->playfield_xscroll)
{
screen.update_partial(MAX(scanline + i - 1, 0));
tilemap_set_scrollx(state->atarigen.playfield_tilemap, 0, newscroll);
state->playfield_xscroll = newscroll;
}
}
/* second word controls vertical scroll and tile bank */
word = *base++;
if (word & 0x8000)
{
int newscroll = ((word >> 6) - (scanline + i)) & 0x1ff;
int newbank = word & 7;
if (newscroll != state->playfield_yscroll)
{
screen.update_partial(MAX(scanline + i - 1, 0));
tilemap_set_scrolly(state->atarigen.playfield_tilemap, 0, newscroll);
state->playfield_yscroll = newscroll;
}
if (newbank != state->playfield_tile_bank)
{
screen.update_partial(MAX(scanline + i - 1, 0));
tilemap_mark_all_tiles_dirty(state->atarigen.playfield_tilemap);
state->playfield_tile_bank = newbank;
}
}
示例3:
void atarig1_state::scanline_update(screen_device &screen, int scanline)
{
int i;
//if (scanline == 0) logerror("-------\n");
/* keep in range */
int offset = (scanline / 8) * 64 + 48;
if (offset >= 0x800)
return;
screen.update_partial(MAX(scanline - 1, 0));
/* update the playfield scrolls */
for (i = 0; i < 8; i++)
{
UINT16 word;
/* first word controls horizontal scroll */
word = m_alpha_tilemap->basemem_read(offset++);
if (word & 0x8000)
{
int newscroll = ((word >> 6) + m_pfscroll_xoffset) & 0x1ff;
if (newscroll != m_playfield_xscroll)
{
screen.update_partial(MAX(scanline + i - 1, 0));
m_playfield_tilemap->set_scrollx(0, newscroll);
m_playfield_xscroll = newscroll;
}
}
/* second word controls vertical scroll and tile bank */
word = m_alpha_tilemap->basemem_read(offset++);
if (word & 0x8000)
{
int newscroll = ((word >> 6) - (scanline + i)) & 0x1ff;
int newbank = word & 7;
if (newscroll != m_playfield_yscroll)
{
screen.update_partial(MAX(scanline + i - 1, 0));
m_playfield_tilemap->set_scrolly(0, newscroll);
m_playfield_yscroll = newscroll;
}
if (newbank != m_playfield_tile_bank)
{
screen.update_partial(MAX(scanline + i - 1, 0));
m_playfield_tilemap->mark_all_dirty();
m_playfield_tile_bank = newbank;
}
}
示例4: scanline_update
void vindictr_state::scanline_update(screen_device &screen, int scanline)
{
UINT16 *base = &m_alpha[((scanline - 8) / 8) * 64 + 42];
int x;
/* keep in range */
if (base < m_alpha)
base += 0x7c0;
else if (base >= &m_alpha[0x7c0])
return;
/* update the current parameters */
for (x = 42; x < 64; x++)
{
UINT16 data = *base++;
switch ((data >> 9) & 7)
{
case 2: /* /PFB */
if (m_playfield_tile_bank != (data & 7))
{
screen.update_partial(scanline - 1);
m_playfield_tile_bank = data & 7;
m_playfield_tilemap->mark_all_dirty();
}
break;
case 3: /* /PFHSLD */
if (m_playfield_xscroll != (data & 0x1ff))
{
screen.update_partial(scanline - 1);
m_playfield_tilemap->set_scrollx(0, data);
m_playfield_xscroll = data & 0x1ff;
}
break;
case 4: /* /MOHS */
if (atarimo_get_xscroll(0) != (data & 0x1ff))
{
screen.update_partial(scanline - 1);
atarimo_set_xscroll(0, data & 0x1ff);
}
break;
case 5: /* /PFSPC */
break;
case 6: /* /VIRQ */
scanline_int_gen(*subdevice("maincpu"));
break;
case 7: /* /PFVS */
{
/* a new vscroll latches the offset into a counter; we must adjust for this */
int offset = scanline;
const rectangle &visible_area = screen.visible_area();
if (offset > visible_area.max_y)
offset -= visible_area.max_y + 1;
if (m_playfield_yscroll != ((data - offset) & 0x1ff))
{
screen.update_partial(scanline - 1);
m_playfield_tilemap->set_scrolly(0, data - offset);
atarimo_set_yscroll(0, (data - offset) & 0x1ff);
}
break;
}
}
}
}
示例5: scanline_update
void vindictr_state::scanline_update(screen_device &screen, int scanline)
{
int x;
/* keep in range */
int offset = ((scanline - 8) / 8) * 64 + 42;
if (offset < 0)
offset += 0x7c0;
else if (offset >= 0x7c0)
return;
/* update the current parameters */
for (x = 42; x < 64; x++)
{
uint16_t data = m_alpha_tilemap->basemem_read(offset++);
switch ((data >> 9) & 7)
{
case 2: /* /PFB */
if (m_playfield_tile_bank != (data & 7))
{
screen.update_partial(scanline - 1);
m_playfield_tile_bank = data & 7;
m_playfield_tilemap->mark_all_dirty();
}
break;
case 3: /* /PFHSLD */
if (m_playfield_xscroll != (data & 0x1ff))
{
screen.update_partial(scanline - 1);
m_playfield_tilemap->set_scrollx(0, data);
m_playfield_xscroll = data & 0x1ff;
}
break;
case 4: /* /MOHS */
if (m_mob->xscroll() != (data & 0x1ff))
{
screen.update_partial(scanline - 1);
m_mob->set_xscroll(data & 0x1ff);
}
break;
case 5: /* /PFSPC */
break;
case 6: /* /VIRQ */
scanline_int_write_line(1);
break;
case 7: /* /PFVS */
{
/* a new vscroll latches the offset into a counter; we must adjust for this */
int offset = scanline;
const rectangle &visible_area = screen.visible_area();
if (offset > visible_area.bottom())
offset -= visible_area.bottom() + 1;
if (m_playfield_yscroll != ((data - offset) & 0x1ff))
{
screen.update_partial(scanline - 1);
m_playfield_tilemap->set_scrolly(0, data - offset);
m_mob->set_yscroll((data - offset) & 0x1ff);
}
break;
}
}
}
}
示例6: batman_scanline_update
void batman_scanline_update(screen_device &screen, int scanline)
{
batman_state *state = screen.machine().driver_data<batman_state>();
/* update the scanline parameters */
if (scanline <= screen.visible_area().max_y && state->m_atarivc_state.rowscroll_enable)
{
UINT16 *base = &state->m_alpha[scanline / 8 * 64 + 48];
int scan, i;
for (scan = 0; scan < 8; scan++, scanline++)
for (i = 0; i < 2; i++)
{
int data = *base++;
switch (data & 15)
{
case 9:
if (scanline > 0)
screen.update_partial(scanline - 1);
state->m_atarivc_state.mo_xscroll = (data >> 7) & 0x1ff;
atarimo_set_xscroll(0, state->m_atarivc_state.mo_xscroll);
break;
case 10:
if (scanline > 0)
screen.update_partial(scanline - 1);
state->m_atarivc_state.pf1_xscroll_raw = (data >> 7) & 0x1ff;
atarivc_update_pf_xscrolls(state);
tilemap_set_scrollx(state->m_playfield_tilemap, 0, state->m_atarivc_state.pf0_xscroll);
tilemap_set_scrollx(state->m_playfield2_tilemap, 0, state->m_atarivc_state.pf1_xscroll);
break;
case 11:
if (scanline > 0)
screen.update_partial(scanline - 1);
state->m_atarivc_state.pf0_xscroll_raw = (data >> 7) & 0x1ff;
atarivc_update_pf_xscrolls(state);
tilemap_set_scrollx(state->m_playfield_tilemap, 0, state->m_atarivc_state.pf0_xscroll);
break;
case 13:
if (scanline > 0)
screen.update_partial(scanline - 1);
state->m_atarivc_state.mo_yscroll = (data >> 7) & 0x1ff;
atarimo_set_yscroll(0, state->m_atarivc_state.mo_yscroll);
break;
case 14:
if (scanline > 0)
screen.update_partial(scanline - 1);
state->m_atarivc_state.pf1_yscroll = (data >> 7) & 0x1ff;
tilemap_set_scrolly(state->m_playfield2_tilemap, 0, state->m_atarivc_state.pf1_yscroll);
break;
case 15:
if (scanline > 0)
screen.update_partial(scanline - 1);
state->m_atarivc_state.pf0_yscroll = (data >> 7) & 0x1ff;
tilemap_set_scrolly(state->m_playfield_tilemap, 0, state->m_atarivc_state.pf0_yscroll);
break;
}
}
}