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