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


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

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


在下文中一共展示了screen_device::machine方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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->m_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);

			screen.machine().scheduler().timer_set(period_on, FUNC(irq_on));
			screen.machine().scheduler().timer_set(period_off, FUNC(irq_off));
		}
}
开发者ID:LibXenonProject,项目名称:mame-lx,代码行数:29,代码来源:blstroid.c

示例2:

static UINT32 update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int xoffs, device_t *tc0100scn)
{
	UINT8 layer[3], nodraw;

	tc0100scn_tilemap_update(tc0100scn);

	layer[0] = tc0100scn_bottomlayer(tc0100scn);
	layer[1] = layer[0] ^ 1;
	layer[2] = 2;

	/* Clear priority bitmap */
	screen.machine().priority_bitmap.fill(0, cliprect);

	/* chip 0 does tilemaps on the left, chip 1 does the ones on the right */
	// draw bottom layer
	nodraw  = tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[0], TILEMAP_DRAW_OPAQUE, 0);	/* left */

	/* Ensure screen blanked even when bottom layers not drawn due to disable bit */
	if (nodraw)
		bitmap.fill(get_black_pen(screen.machine()), cliprect);

	// draw middle layer
	tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[1], 0, 1);

	/* Sprites can be under/over the layer below text layer */
	draw_sprites(screen.machine(), bitmap, cliprect, xoffs, 8); // draw sprites

	// draw top(text) layer
	tc0100scn_tilemap_draw(tc0100scn, bitmap, cliprect, layer[2], 0, 0);
	return 0;
}
开发者ID:j4y4r,项目名称:j4ymame,代码行数:31,代码来源:warriorb.c

示例3: scanline_update

static void scanline_update(screen_device &screen, int scanline)
{
	address_space *space = screen.machine().device("audiocpu")->memory().space(AS_PROGRAM);

	/* sound IRQ is on 32V */
	if (scanline & 32)
		atarigen_6502_irq_ack_r(space, 0);
	else if (!(input_port_read(screen.machine(), "FE4000") & 0x40))
		atarigen_6502_irq_gen(screen.machine().device("audiocpu"));
}
开发者ID:stuartcarnie,项目名称:MAME-OS-X,代码行数:10,代码来源:badlands.c

示例4: on_vblank

static void on_vblank(running_machine &machine, screen_device &screen, bool vblank_state)
{
	/* VBLANK starting */
	if (vblank_state && watchdog_enabled)
	{
		/* check the watchdog */
		if (screen.machine().config().m_watchdog_vblank_count != 0)
		{
			watchdog_counter = watchdog_counter - 1;

			if (watchdog_counter == 0)
				watchdog_callback(screen.machine(), NULL, 0);
		}
	}
}
开发者ID:rogerjowett,项目名称:ClientServerMAME,代码行数:15,代码来源:watchdog.c

示例5: screen_update_paradise

UINT32 paradise_state::screen_update_paradise(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
	int layers_ctrl = -1;

#ifdef MAME_DEBUG
if (machine().input().code_pressed(KEYCODE_Z))
{
	int mask = 0;
	if (machine().input().code_pressed(KEYCODE_Q))	mask |= 1;
	if (machine().input().code_pressed(KEYCODE_W))	mask |= 2;
	if (machine().input().code_pressed(KEYCODE_E))	mask |= 4;
	if (machine().input().code_pressed(KEYCODE_R))	mask |= 8;
	if (machine().input().code_pressed(KEYCODE_A))	mask |= 16;
	if (mask != 0) layers_ctrl &= mask;
}
#endif

	bitmap.fill(get_black_pen(machine()), cliprect);

	if (!(m_priority & 4))	/* Screen blanking */
		return 0;

	if (m_priority & 1)
		if (layers_ctrl & 16)
			draw_sprites(screen.machine(), bitmap, cliprect);

	if (layers_ctrl & 1)	m_tilemap_0->draw(bitmap, cliprect, 0, 0);
	if (layers_ctrl & 2)	m_tilemap_1->draw(bitmap, cliprect, 0, 0);
	if (layers_ctrl & 4)	copybitmap_trans(bitmap, m_tmpbitmap, flip_screen(), flip_screen(), 0, 0, cliprect, 0x80f);

	if (m_priority & 2)
	{
		if (!(m_priority & 1))
			if (layers_ctrl & 16)
				draw_sprites(screen.machine(), bitmap, cliprect);
		if (layers_ctrl & 8)
			m_tilemap_2->draw(bitmap, cliprect, 0, 0);
	}
	else
	{
		if (layers_ctrl & 8)
			m_tilemap_2->draw(bitmap, cliprect, 0, 0);
		if (!(m_priority & 1))
			if (layers_ctrl & 16)
				draw_sprites(screen.machine(), bitmap, cliprect);
	}
	return 0;
}
开发者ID:coinhelper,项目名称:jsmess,代码行数:48,代码来源:paradise.c

示例6:

static UINT32 update_screen(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect, int index)
{
    vcombat_state *state = screen.machine().driver_data<vcombat_state>();
    int y;
    const rgb_t *const pens = tlc34076_get_pens(screen.machine().device("tlc34076"));

    UINT16 *m68k_buf = state->m_m68k_framebuffer[(*state->m_framebuffer_ctrl & 0x20) ? 1 : 0];
    UINT16 *i860_buf = state->m_i860_framebuffer[index][0];

    /* TODO: It looks like the leftmost chunk of the ground should really be on the right side? */
    /*       But the i860 draws the background correctly, so it may be an original game issue. */
    /*       There's also some garbage in the upper-left corner. Might be related to this 'wraparound'. */
    /*       Or maybe it's related to the 68k's alpha?  It might come from the 68k side of the house.  */

    for (y = cliprect.min_y; y <= cliprect.max_y; ++y)
    {
        int x;
        int src_addr = 256/2 * y;
        const UINT16 *m68k_src = &m68k_buf[src_addr];
        const UINT16 *i860_src = &i860_buf[src_addr];
        UINT32 *dst = &bitmap.pix32(y, cliprect.min_x);

        for (x = cliprect.min_x; x <= cliprect.max_x; x += 2)
        {
            int i;
            UINT16 m68k_pix = *m68k_src++;
            UINT16 i860_pix = *i860_src++;

            /* Draw two pixels */
            for (i = 0; i < 2; ++i)
            {
                /* Vcombat's screen renders 'flopped' - very likely because VR headset displays may reflect off mirrors.
                Shadfgtr isn't flopped, so it's not a constant feature of the hardware. */

                /* Combine the two layers */
                if ((m68k_pix & 0xff) == 0)
                    *dst++ = pens[i860_pix & 0xff];
                else
                    *dst++ = pens[m68k_pix & 0xff];

                m68k_pix >>= 8;
                i860_pix >>= 8;
            }
        }
    }

    return 0;
}
开发者ID:kleopatra999,项目名称:mess-svn,代码行数:48,代码来源:vcombat.c

示例7: skeetsht_scanline_update

static void skeetsht_scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params)
{
	skeetsht_state *state = screen.machine().driver_data<skeetsht_state>();
	const rgb_t *const pens = tlc34076_get_pens(screen.machine().device("tlc34076"));
	UINT16 *vram = &state->m_tms_vram[(params->rowaddr << 8) & 0x3ff00];
	UINT32 *dest = &bitmap.pix32(scanline);
	int coladdr = params->coladdr;
	int x;

	for (x = params->heblnk; x < params->hsblnk; x += 2)
	{
		UINT16 pixels = vram[coladdr++ & 0xff];
		dest[x + 0] = pens[pixels & 0xff];
		dest[x + 1] = pens[pixels >> 8];
	}
}
开发者ID:risico,项目名称:jsmess,代码行数:16,代码来源:skeetsht.c

示例8: amerdart_scanline

static void amerdart_scanline(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params)
{
	coolpool_state *state = screen.machine().driver_data<coolpool_state>();

	UINT16 *vram = &state->m_vram_base[(params->rowaddr << 8) & 0xff00];
	UINT32 *dest = &bitmap.pix32(scanline);
	rgb_t pens[16];
	int coladdr = params->coladdr;
	int x;

	/* update the palette */
	if (scanline < 256)
		for (x = 0; x < 16; x++)
		{
			UINT16 pal = state->m_vram_base[x];
			pens[x] = MAKE_RGB(pal4bit(pal >> 4), pal4bit(pal >> 8), pal4bit(pal >> 12));
		}

	for (x = params->heblnk; x < params->hsblnk; x += 4)
	{
		UINT16 pixels = vram[coladdr++ & 0xff];
		dest[x + 0] = pens[(pixels >> 0) & 15];
		dest[x + 1] = pens[(pixels >> 4) & 15];
		dest[x + 2] = pens[(pixels >> 8) & 15];
		dest[x + 3] = pens[(pixels >> 12) & 15];
	}
}
开发者ID:coinhelper,项目名称:jsmess,代码行数:27,代码来源:coolpool.c

示例9: 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

示例10: scanline_update

void badlands_state::scanline_update(screen_device &screen, int scanline)
{
	address_space &space = subdevice("audiocpu")->memory().space(AS_PROGRAM);

	/* sound IRQ is on 32V */
	if (scanline & 32)
		m6502_irq_ack_r(space, 0);
	else if (!(ioport("FE4000")->read() & 0x40))
		m6502_irq_gen(*screen.machine().device("audiocpu"));
}
开发者ID:clobber,项目名称:UME,代码行数:10,代码来源:badlands.c

示例11: static_on_vblank

void device_execute_interface::static_on_vblank(screen_device &screen, void *param, bool vblank_state)
{
	// VBLANK starting
	if (vblank_state)
	{
		device_execute_interface *exec = NULL;
		for (bool gotone = screen.machine().m_devicelist.first(exec); gotone; gotone = exec->next(exec))
			exec->on_vblank_start(screen);
	}
}
开发者ID:cdenix,项目名称:psmame,代码行数:10,代码来源:diexec.c

示例12:

bool mm1_state::screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
{
	/* text */
	i8275_update(m_crtc, &bitmap, &cliprect);
	copybitmap(&bitmap, screen.machine().generic.tmpbitmap, 0, 0, 0, 0, &cliprect);

	/* graphics */
	m_hgdc->update_screen(&bitmap, &cliprect);

	return 0;
}
开发者ID:rogerjowett,项目名称:ClientServerMAME,代码行数:11,代码来源:mikromik.c

示例13: screen_update

UINT32 faceoffh_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
{
	// NMI on coin-in?
	UINT8 coin = (~ioport("INPUTS")->read()) & 0x03;
	m_audiocpu->set_input_line(INPUT_LINE_NMI, coin ? ASSERT_LINE : CLEAR_LINE);

	// Play the digitalker samples (it's not hooked up yet)
	static UINT8 sample = 0, bank = 0;

	if (screen.machine().input().code_pressed_once(KEYCODE_Q))
		--bank;
	if (screen.machine().input().code_pressed_once(KEYCODE_W))
		++bank;
	bank %= 3;
	digitalker_set_bank(bank);

	if (screen.machine().input().code_pressed_once(KEYCODE_A))
		--sample;
	if (screen.machine().input().code_pressed_once(KEYCODE_S))
		++sample;

	if (screen.machine().input().code_pressed_once(KEYCODE_Z))
	{
		m_digitalker->digitalker_0_cms_w(CLEAR_LINE);
		m_digitalker->digitalker_0_cs_w(CLEAR_LINE);

		address_space &space = m_audiocpu->space(AS_PROGRAM);
		m_digitalker->digitalker_data_w(space, 0, sample, 0xff);

		m_digitalker->digitalker_0_wr_w(ASSERT_LINE);
		m_digitalker->digitalker_0_wr_w(CLEAR_LINE);
		m_digitalker->digitalker_0_wr_w(ASSERT_LINE);
	}	

	popmessage("COIN: %02X VIAB: %02X\nCOUNT: %02X %02X LEDS: %02X\nSAMPLE: %02X (B%X)",
				m_coin, m_port_b,
				(m_shift >> 16) & 0xff, (m_shift >> 8) & 0xff, (m_shift >> 0) & 0xff,	// 2 x 7-seg, 3 leds
				sample, bank
	);
	return 0;
}
开发者ID:j105rob,项目名称:mame,代码行数:41,代码来源:faceoffh.c

示例14: atarig1_scanline_update

void atarig1_scanline_update(screen_device &screen, int scanline)
{
	atarig1_state *state = screen.machine().driver_data<atarig1_state>();
	UINT16 *base = &state->m_alpha[(scanline / 8) * 64 + 48];
	int i;

	//if (scanline == 0) logerror("-------\n");

	/* keep in range */
	if (base >= &state->m_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->m_pfscroll_xoffset) & 0x1ff;
			if (newscroll != state->m_playfield_xscroll)
			{
				screen.update_partial(MAX(scanline + i - 1, 0));
				tilemap_set_scrollx(state->m_playfield_tilemap, 0, newscroll);
				state->m_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->m_playfield_yscroll)
			{
				screen.update_partial(MAX(scanline + i - 1, 0));
				tilemap_set_scrolly(state->m_playfield_tilemap, 0, newscroll);
				state->m_playfield_yscroll = newscroll;
			}
			if (newbank != state->m_playfield_tile_bank)
			{
				screen.update_partial(MAX(scanline + i - 1, 0));
				tilemap_mark_all_tiles_dirty(state->m_playfield_tilemap);
				state->m_playfield_tile_bank = newbank;
			}
		}
开发者ID:kkalmaz,项目名称:psmame,代码行数:50,代码来源:atarig1.c

示例15: animate

static void animate(running_machine &machine, screen_device &device, bool vblank_state)
{
	int player;

	/* only animate once per frame, when vblank_state is 1 */
	if (!vblank_state)
		return;

	/* increment animation counter */
	global.animation_counter += 0x08;

	/* compute a fade factor from the current animation value */
	if (global.animation_counter < 0x80)
		global.fade = 0xa0 + (0x60 * ( global.animation_counter & 0x7f) / 0x80);
	else
		global.fade = 0xa0 + (0x60 * (~global.animation_counter & 0x7f) / 0x80);

	for (player = 0; player < MAX_PLAYERS; player++)
	{
		/* read all the lightgun values */
		if (global.used[player])
			device.machine().ioport().crosshair_position(player, global.x[player], global.y[player]);

		/* auto visibility */
		if (global.mode[player] == CROSSHAIR_VISIBILITY_AUTO)
		{
			if ((global.x[player] != global.last_x[player]) || (global.y[player] != global.last_y[player]))
			{
				/* crosshair has moved, keep crosshair visible */
				global.visible[player] = TRUE;
				global.last_x[player] = global.x[player];
				global.last_y[player] = global.y[player];
				global.time[player] = 0;
			}
			else
			{
				/* see if the player has been motionless for time specified */
				/* slightly confusing formula, but the effect is: */
				/* auto_time = 0 makes the crosshair barely visible while moved */
				/* every increment in auto_time is about .2s at 60Hz */
				if (global.time[player] > global.auto_time * 12 + 2)
					/* time exceeded so turn crosshair invisible */
					global.visible[player] = FALSE;

				/* increment player visibility time */
				global.time[player]++;
			}
		}
	}
}
开发者ID:broftkd,项目名称:mess-svn,代码行数:50,代码来源:crsshair.c


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