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


C++ discrete_sound_w函数代码示例

本文整理汇总了C++中discrete_sound_w函数的典型用法代码示例。如果您正苦于以下问题:C++ discrete_sound_w函数的具体用法?C++ discrete_sound_w怎么用?C++ discrete_sound_w使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: WRITE8_DEVICE_HANDLER

static WRITE8_DEVICE_HANDLER( starshp1_analog_out_w )
{
	starshp1_state *state = device->machine().driver_data<starshp1_state>();
	switch (offset & 7)
	{
	case 1:
		state->m_ship_size = data;
		break;
	case 2:
		discrete_sound_w(device, STARSHP1_NOISE_AMPLITUDE, data);
		break;
	case 3:
		discrete_sound_w(device, STARSHP1_TONE_PITCH, data);
		break;
	case 4:
		discrete_sound_w(device, STARSHP1_MOTOR_SPEED, data);
		break;
	case 5:
		state->m_circle_hpos = data;
		break;
	case 6:
		state->m_circle_vpos = data;
		break;
	case 7:
		state->m_circle_size = data;
		break;
	}
}
开发者ID:cdenix,项目名称:psmame,代码行数:28,代码来源:starshp1.c

示例2: WRITE8_HANDLER

static WRITE8_HANDLER( firetrk_output_w )
{
	firetrk_state *state = space->machine().driver_data<firetrk_state>();
	device_t *discrete = space->machine().device("discrete");

	/* BIT0 => START1 LAMP */
	set_led_status(space->machine(), 0, !(data & 0x01));

	/* BIT1 => START2 LAMP */
	set_led_status(space->machine(), 1, !(data & 0x02));

	/* BIT2 => FLASH       */
	state->m_flash = data & 0x04;

	/* BIT3 => TRACK LAMP  */
	set_led_status(space->machine(), 3, !(data & 0x08));

	/* BIT4 => ATTRACT     */
	discrete_sound_w(discrete, FIRETRUCK_ATTRACT_EN, data & 0x10);
	coin_lockout_w(space->machine(), 0, !(data & 0x10));
	coin_lockout_w(space->machine(), 1, !(data & 0x10));

	/* BIT5 => START3 LAMP */
	set_led_status(space->machine(), 2, !(data & 0x20));

	/* BIT6 => UNUSED      */

	/* BIT7 => BELL OUT    */
	discrete_sound_w(discrete, FIRETRUCK_BELL_EN, data & 0x80);
}
开发者ID:rogerjowett,项目名称:ClientServerMAME,代码行数:30,代码来源:firetrk.c

示例3: WRITE8_HANDLER

static WRITE8_HANDLER( namco_54xx_O_w )
{
	UINT8 out = (data & 0x0f);
	if (data & 0x10)
		discrete_sound_w(machine, NAMCO_54XX_1_DATA, out);
	else
		discrete_sound_w(machine, NAMCO_54XX_0_DATA, out);
}
开发者ID:cdenix,项目名称:ps3-mame-0125,代码行数:8,代码来源:namco54.c

示例4: triplhnt_update_misc

static void triplhnt_update_misc(address_space &space, int offset)
{
	triplhnt_state *state = space.machine().driver_data<triplhnt_state>();
	samples_device *samples = space.machine().device<samples_device>("samples");
	device_t *discrete = space.machine().device("discrete");
	UINT8 is_witch_hunt;
	UINT8 bit = offset >> 1;

	/* BIT0 => UNUSED      */
	/* BIT1 => LAMP        */
	/* BIT2 => SCREECH     */
	/* BIT3 => LOCKOUT     */
	/* BIT4 => SPRITE ZOOM */
	/* BIT5 => CMOS WRITE  */
	/* BIT6 => TAPE CTRL   */
	/* BIT7 => SPRITE BANK */

	if (offset & 1)
	{
		state->m_misc_flags |= 1 << bit;

		if (bit == 5)
		{
			state->m_cmos[state->m_cmos_latch] = state->m_da_latch;
		}
	}
	else
	{
		state->m_misc_flags &= ~(1 << bit);
	}

	state->m_sprite_zoom = (state->m_misc_flags >> 4) & 1;
	state->m_sprite_bank = (state->m_misc_flags >> 7) & 1;

	set_led_status(space.machine(), 0, state->m_misc_flags & 0x02);

	coin_lockout_w(space.machine(), 0, !(state->m_misc_flags & 0x08));
	coin_lockout_w(space.machine(), 1, !(state->m_misc_flags & 0x08));

	discrete_sound_w(discrete, space, TRIPLHNT_SCREECH_EN, state->m_misc_flags & 0x04);	// screech
	discrete_sound_w(discrete, space, TRIPLHNT_LAMP_EN, state->m_misc_flags & 0x02);	// Lamp is used to reset noise
	discrete_sound_w(discrete, space, TRIPLHNT_BEAR_EN, state->m_misc_flags & 0x80);	// bear

	is_witch_hunt = space.machine().root_device().ioport("0C09")->read() == 0x40;
	bit = ~state->m_misc_flags & 0x40;

	/* if we're not playing the sample yet, start it */
	if (!samples->playing(0))
		samples->start(0, 0, true);
	if (!samples->playing(1))
		samples->start(1, 1, true);

	/* bit 6 turns cassette on/off */
	samples->pause(0,  is_witch_hunt || bit);
	samples->pause(1, !is_witch_hunt || bit);
}
开发者ID:coinhelper,项目名称:jsmess,代码行数:56,代码来源:triplhnt.c

示例5: INTERRUPT_GEN

static INTERRUPT_GEN( skydiver_interrupt )
{
	/* Convert range data to divide value and write to sound */
	discrete_sound_w(SKYDIVER_RANGE_DATA, (0x01 << (~skydiver_videoram[0x394] & 0x07)) & 0xff);	// Range 0-2

	discrete_sound_w(SKYDIVER_RANGE3_EN,  skydiver_videoram[0x394] & 0x08);		// Range 3 - note disable
	discrete_sound_w(SKYDIVER_NOTE_DATA, ~skydiver_videoram[0x395] & 0xff);		// Note - freq
	discrete_sound_w(SKYDIVER_NOISE_DATA,  skydiver_videoram[0x396] & 0x0f);	// NAM - Noise Amplitude

	if (skydiver_nmion)
		cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
}
开发者ID:broftkd,项目名称:historic-mess,代码行数:12,代码来源:skydiver.c

示例6: draw_sprites

UINT32 triplhnt_state::screen_update_triplhnt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
    m_bg_tilemap->mark_all_dirty();

    m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);

    draw_sprites(bitmap, cliprect);

    address_space &space = machine().driver_data()->generic_space();
    discrete_sound_w(m_discrete, space, TRIPLHNT_BEAR_ROAR_DATA, m_playfield_ram[0xfa] & 15);
    discrete_sound_w(m_discrete, space, TRIPLHNT_SHOT_DATA, m_playfield_ram[0xfc] & 15);
    return 0;
}
开发者ID:thomas41546,项目名称:mame4raspi,代码行数:13,代码来源:triplhnt.c

示例7: WRITE_HANDLER

static WRITE_HANDLER(play1s_data_w) {
  static UINT8 oldData;
  static int timer_on;
  if (data & 0x0f) {
    if (oldData != data) sndlocals.volume = 100;
    oldData = data;
    discrete_sound_w(8, data & 0x01);
    discrete_sound_w(4, data & 0x02);
    discrete_sound_w(2, data & 0x04);
    discrete_sound_w(1, data & 0x08);
    if (~data & 0x10) { // start fading
      timer_adjust(sndlocals.timer, 0.02, 0, 0.02);
      timer_on = 1;
    } else { // no fading used
      timer_adjust(sndlocals.timer, TIME_NEVER, 0, 0);
      timer_on = 0;
      mixer_set_volume(0, sndlocals.volume);
    }
  } else if (!timer_on) { // no fading going on, so stop sound
    discrete_sound_w(8, 0);
    discrete_sound_w(4, 0);
    discrete_sound_w(2, 0);
    discrete_sound_w(1, 0);
  }
}
开发者ID:chrisjubb,项目名称:pinmame,代码行数:25,代码来源:playsnd.c

示例8: WRITE_HANDLER

static WRITE_HANDLER( firetruck_out_w )
{
	firetruck_invert_display = data&0x04;
	/*		x-------	0x80 BELLOUT */
	/*		-x------	0x40 unused? */
	/*		--x-----	0x20 LED for START button */
	/*		---X----	0x10 ATTRACT (disables horn circuit) */
	/*		----x---	0x08 (LED for track select button?) */
	/*		-----x--	0x04 FLASH - inverts screen */
	/*		------x-	0x02 unused? */
	/*		-------x	0x01 LED for START button */
	discrete_sound_w(0x06,!(data&0x10));	/* Attract */
	discrete_sound_w(0x05,(data&0x80)?0x00:0x01);	/* Bell */
}
开发者ID:slaanesh-dev,项目名称:xMame37B16-Pi,代码行数:14,代码来源:firetrk.c

示例9: WRITE8_DEVICE_HANDLER

DISCRETE_SOUND_END


/* the ports are guessed from operation */
/* the schematics do not show the actual hookup */

WRITE8_DEVICE_HANDLER( m79amb_8000_w )
{
	/* these values are not latched */
	/* they are pulsed when the port is addressed */
	/* the discrete system will just trigger from them */
	discrete_sound_w(device, M79AMB_SHOT_EN, data & 0x01);
	discrete_sound_w(device, M79AMB_BOOM_EN, data & 0x02);
	discrete_sound_w(device, M79AMB_THUD_EN, data & 0x04);
};
开发者ID:Paulodx,项目名称:sdl-mame-wii,代码行数:15,代码来源:m79amb.c

示例10: INTERRUPT_GEN

static INTERRUPT_GEN( skydiver_interrupt )
{
	skydiver_state *state = device->machine().driver_data<skydiver_state>();
	device_t *discrete = device->machine().device("discrete");

	/* Convert range data to divide value and write to sound */
	discrete_sound_w(discrete, SKYDIVER_RANGE_DATA, (0x01 << (~state->m_videoram[0x394] & 0x07)) & 0xff);	// Range 0-2

	discrete_sound_w(discrete, SKYDIVER_RANGE3_EN,  state->m_videoram[0x394] & 0x08);		// Range 3 - note disable
	discrete_sound_w(discrete, SKYDIVER_NOTE_DATA, ~state->m_videoram[0x395] & 0xff);		// Note - freq
	discrete_sound_w(discrete, SKYDIVER_NOISE_DATA,  state->m_videoram[0x396] & 0x0f);	// NAM - Noise Amplitude

	if (state->m_nmion)
		device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
开发者ID:kleopatra999,项目名称:mess-svn,代码行数:15,代码来源:skydiver.c

示例11: INTERRUPT_GEN

static INTERRUPT_GEN( sprint2 )
{
	static UINT8 dial[2];

	/* handle steering wheels */

	if (GAME_IS_SPRINT1 || GAME_IS_SPRINT2)
	{
		int i;

		for (i = 0; i < 2; i++)
		{
			signed char delta = readinputport(6 + i) - dial[i];

			if (delta < 0)
			{
				steering[i] = 0x00;
			}
			if (delta > 0)
			{
				steering[i] = 0x40;
			}

			dial[i] += delta;

			switch (readinputport(4 + i) & 15)
			{
			case 1: gear[i] = 1; break;
			case 2: gear[i] = 2; break;
			case 4: gear[i] = 3; break;
			case 8: gear[i] = 4; break;
			}
		}
	}

	discrete_sound_w(SPRINT2_MOTORSND1_DATA, sprint2_video_ram[0x394] & 15);	// also DOMINOS_FREQ_DATA
	discrete_sound_w(SPRINT2_MOTORSND2_DATA, sprint2_video_ram[0x395] & 15);
	discrete_sound_w(SPRINT2_CRASHSND_DATA, sprint2_video_ram[0x396] & 15);	// also DOMINOS_AMP_DATA

	/* interrupts and watchdog are disabled during service mode */

	watchdog_enable(!service_mode());

	if (!service_mode())
	{
		cpunum_set_input_line(0, INPUT_LINE_NMI, PULSE_LINE);
	}
}
开发者ID:joolswills,项目名称:advancemame,代码行数:48,代码来源:sprint2.c

示例12: WRITE8_MEMBER

DISCRETE_SOUND_END


WRITE8_MEMBER(sprint8_state::sprint8_crash_w)
{
	discrete_sound_w(m_discrete, space, SPRINT8_CRASH_EN, data & 0x01);
}
开发者ID:coinhelper,项目名称:jsmess,代码行数:7,代码来源:sprint8.c

示例13: WRITE8_HANDLER

static WRITE8_HANDLER( output_port_0_w )
{
	/*
        Note: We compute the timeout time on a write here. Unfortunately, the situation is
        kind of weird, because the discrete sound system is also affected by this timeout.
        In fact, it is very important that our timing calculation timeout AFTER the sound
        system's equivalent computation, or else we will hang notes.
    */
	UINT8 raw_game_speed = readinputport(6);
	double resistance = raw_game_speed * 25000 / 100;
	mame_time duration = make_mame_time(0, MAX_SUBSECONDS * 0.45 * 6.8e-6 * resistance * (data+1));
	timeout_time = add_mame_times(mame_timer_get_time(), duration);

	discrete_sound_w(HITME_DOWNCOUNT_VAL, data);
	discrete_sound_w(HITME_OUT0, 1);
}
开发者ID:broftkd,项目名称:mess-cvs,代码行数:16,代码来源:hitme.c

示例14: WRITE8_DEVICE_HANDLER

DISCRETE_SOUND_END


WRITE8_DEVICE_HANDLER( sprint8_crash_w )
{
	discrete_sound_w(device, SPRINT8_CRASH_EN, data & 0x01);
}
开发者ID:DarrenBranford,项目名称:MAME4iOS,代码行数:7,代码来源:sprint8.c

示例15: WRITE8_HANDLER

DISCRETE_SOUND_END

WRITE8_HANDLER( blockade_sound_freq_w )
{
	discrete_sound_w(BLOCKADE_NOTE_DATA, data);
    return;
}
开发者ID:broftkd,项目名称:historic-mame,代码行数:7,代码来源:blockade.c


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