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


C++ CAP_U函数代码示例

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


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

示例1: switch

attotime ttl74123_device::compute_duration()
{
	double duration;

	switch (m_config.m_connection_type)
	{
	case TTL74123_NOT_GROUNDED_NO_DIODE:
		duration = 0.28 * m_config.m_res * m_config.m_cap * (1.0 + (700.0 / m_config.m_res));
		break;

	case TTL74123_NOT_GROUNDED_DIODE:
		duration = 0.25 * m_config.m_res * m_config.m_cap * (1.0 + (700.0 / m_config.m_res));
		break;

	case TTL74123_GROUNDED:
	default:
		if (m_config.m_cap < CAP_U(0.1))
		{
			/* this is really a curve - a very flat one in the 0.1uF-.01uF range */
			duration = 0.32 * m_config.m_res * m_config.m_cap;
		}
		else
		{
			duration = 0.33 * m_config.m_res * m_config.m_cap;
		}
		break;
	}

	return double_to_attotime(duration);
}
开发者ID:johkelly,项目名称:MAME_hi,代码行数:30,代码来源:74123.c

示例2: set_music_freq

void snk6502_sound_device::device_start()
{
	// adjusted
	set_music_freq(43000);

	// 38.99 Hz update (according to schematic)
	set_music_clock(M_LN2 * (RES_K(18) * 2 + RES_K(1)) * CAP_U(1));

	m_tone_stream = machine().sound().stream_alloc(*this, 0, 1, SAMPLE_RATE);

	for (int i = 0; i < NUM_CHANNELS; i++)
	{
		save_item(NAME(m_tone_channels[i].mute), i);
		save_item(NAME(m_tone_channels[i].offset), i);
		save_item(NAME(m_tone_channels[i].base), i);
		save_item(NAME(m_tone_channels[i].mask), i);
		save_item(NAME(m_tone_channels[i].sample_step), i);
		save_item(NAME(m_tone_channels[i].sample_cur), i);
		save_item(NAME(m_tone_channels[i].form), i);
	}

	save_item(NAME(m_tone_clock));
	save_item(NAME(m_sound0_stop_on_rollover));
	save_item(NAME(m_hd38880_cmd));
	save_item(NAME(m_hd38880_addr));
	save_item(NAME(m_hd38880_data_bytes));
	save_item(NAME(m_hd38880_speed));
}
开发者ID:SailorSat,项目名称:cabmame,代码行数:28,代码来源:snk6502.cpp

示例3: RES_K

void sasuke_sound_device::device_reset()
{
	m_custom->set_music_clock(M_LN2 * (RES_K(18) + RES_K(1)) * CAP_U(1));

	// adjusted (measured through audio recording of pcb)
	m_custom->set_music_freq(35300);
}
开发者ID:SailorSat,项目名称:cabmame,代码行数:7,代码来源:snk6502.cpp

示例4: TTL74123_config

void TTL74123_config(int which, const TTL74123_interface *intf)
{
	TTL74123_state *chip;

	assert_always(which < MAX_TTL74123, "Exceeded maximum number of 74123 chips");
	assert_always(intf, "No interface specified");
	assert_always((intf->connection_type == TTL74123_GROUNDED) && (intf->cap >= CAP_U(0.01)), "Only capacitors >= 0.01uF supported for GROUNDED type");
	assert_always(intf->cap >= CAP_P(1000), "Only capacitors >= 1000pF supported ");

	chip = &chips[which];

	chip->intf = intf;
	chip->which = which;
	chip->timer = timer_alloc(clear_callback, chip);

	/* start with the defaults */
	chip->A = intf->A;
    chip->B = intf->B;
	chip->clear = intf->clear;

	/* register for state saving */
	state_save_register_item("TTL74123", which, chip->A);
	state_save_register_item("TTL74123", which, chip->B);
	state_save_register_item("TTL74123", which, chip->clear);
}
开发者ID:broftkd,项目名称:historic-mame,代码行数:25,代码来源:74123.c

示例5: compute_duration

static attotime compute_duration(ttl74123_t *chip)
{
	double duration;

	switch (chip->intf->connection_type)
	{
	case TTL74123_NOT_GROUNDED_NO_DIODE:
		duration = 0.28 * chip->intf->res * chip->intf->cap * (1.0 + (700.0 / chip->intf->res));
		break;

	case TTL74123_NOT_GROUNDED_DIODE:
		duration = 0.25 * chip->intf->res * chip->intf->cap * (1.0 + (700.0 / chip->intf->res));
		break;

	case TTL74123_GROUNDED:
	default:
		if (chip->intf->cap < CAP_U(0.1))
			/* this is really a curve - a very flat one in the 0.1uF-.01uF range */
			duration = 0.32 * chip->intf->res * chip->intf->cap;
		else
			duration = 0.33 * chip->intf->res * chip->intf->cap;
		break;
	}

	return double_to_attotime(duration);
}
开发者ID:nitrologic,项目名称:emu,代码行数:26,代码来源:74123.c

示例6: RES_K

INPUT_PORTS_END



//**************************************************************************
//  MACHINE INITIALIZATION
//**************************************************************************

int newbrain_state::get_reset_t()
{
	return RES_K(220) * CAP_U(10) * 1000; // t = R128 * C125 = 2.2s
}
开发者ID:PugsyMAME,项目名称:mame,代码行数:12,代码来源:newbrain.cpp

示例7: machine

void snk6502_sound_device::device_start()
{
	m_ROM = machine().root_device().memregion("snk6502")->base();

	// adjusted
	set_music_freq(43000);

	// 38.99 Hz update (according to schematic)
	set_music_clock(M_LN2 * (RES_K(18) * 2 + RES_K(1)) * CAP_U(1));

	m_tone_stream = machine().sound().stream_alloc(*this, 0, 1, SAMPLE_RATE);
}
开发者ID:Ander-son,项目名称:libretro-mame,代码行数:12,代码来源:snk6502.c

示例8: RES_K

void comx35_state::machine_reset()
{
	int t = RES_K(27) * CAP_U(1) * 1000; // t = R1 * C1

	m_clear = 0;
	m_iden = 1;
	m_cr1 = 1;
	m_ef4 = CLEAR_LINE;
	m_int = CLEAR_LINE;
	m_prd = CLEAR_LINE;

	timer_set(attotime::from_msec(t), TIMER_ID_RESET);
}
开发者ID:kleopatra999,项目名称:mess-svn,代码行数:13,代码来源:comx35.c

示例9: RES_K

void comx35_state::machine_reset()
{
	int t = RES_K(27) * CAP_U(1) * 1000; // t = R1 * C1

	m_clear = 0;
	m_iden = 1;
	m_cr1 = 1;
	m_ef4 = CLEAR_LINE;
	m_int = CLEAR_LINE;
	m_prd = CLEAR_LINE;

	m_reset_timer->adjust(attotime::from_msec(t));
}
开发者ID:poliva,项目名称:mame-rr,代码行数:13,代码来源:comx35.c

示例10: MCFG_SOUND_START_OVERRIDE

void n8080_state::spacefev_sound(machine_config &config)
{
	MCFG_SOUND_START_OVERRIDE(n8080_state,spacefev)
	MCFG_SOUND_RESET_OVERRIDE(n8080_state,spacefev)

	/* basic machine hardware */
	I8035(config, m_audiocpu, 6000000);
	m_audiocpu->set_addrmap(AS_PROGRAM, &n8080_state::n8080_sound_cpu_map);
	m_audiocpu->t0_in_cb().set(FUNC(n8080_state::n8080_8035_t0_r));
	m_audiocpu->t1_in_cb().set(FUNC(n8080_state::n8080_8035_t1_r));
	m_audiocpu->p1_in_cb().set(FUNC(n8080_state::n8080_8035_p1_r));
	m_audiocpu->p2_out_cb().set(FUNC(n8080_state::n8080_dac_w));

	TIMER(config, "vco_timer").configure_periodic(FUNC(n8080_state::spacefev_vco_voltage_timer), attotime::from_hz(1000));

	/* sound hardware */
	SPEAKER(config, "speaker").front_center();

	DAC_1BIT(config, m_n8080_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.15);
	voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref", 0));
	vref.add_route(0, "n8080_dac", 1.0, DAC_VREF_POS_INPUT);

	SN76477(config, m_sn);
	m_sn->set_noise_params(RES_K(36), RES_K(150), CAP_N(1));
	m_sn->set_decay_res(RES_M(1));
	m_sn->set_attack_params(CAP_U(1.0), RES_K(20));
	m_sn->set_amp_res(RES_K(150));
	m_sn->set_feedback_res(RES_K(47));
	m_sn->set_vco_params(0, CAP_N(1), RES_M(1.5));
	m_sn->set_pitch_voltage(0);
	m_sn->set_slf_params(CAP_N(47), RES_M(1));
	m_sn->set_oneshot_params(CAP_N(47), RES_K(820));
	m_sn->set_vco_mode(0);
	m_sn->set_mixer_params(0, 0, 0);
	m_sn->set_envelope_params(1, 0);
	m_sn->set_enable(1);
	m_sn->add_route(ALL_OUTPUTS, "speaker", 0.35);
}
开发者ID:SailorSat,项目名称:cabmame,代码行数:38,代码来源:n8080.cpp

示例11: TIMER_CALLBACK

static TIMER_CALLBACK( schaser_effect_555_cb )
{
	_8080bw_state *state = machine.driver_data<_8080bw_state>();
	int effect = param;
	attotime new_time;
	/* Toggle 555 output */
	state->m_schaser_effect_555_is_low = !state->m_schaser_effect_555_is_low;
	state->m_schaser_effect_555_time_remain = attotime::zero;
	state->m_schaser_effect_555_time_remain_savable = state->m_schaser_effect_555_time_remain.as_double();

	if (state->m_schaser_effect_555_is_low)
		new_time = PERIOD_OF_555_ASTABLE(0, RES_K(20), CAP_U(1)) / 2;
	else
	{
		if (effect)
			new_time = attotime(0, ATTOSECONDS_PER_SECOND * .8873 * schaser_effect_rc[effect]);
		else
			new_time = attotime::never;
	}
	state->m_schaser_effect_555_timer->adjust(new_time, effect);
	sn76477_enable_w(state->m_sn, !(state->m_schaser_effect_555_is_low || state->m_schaser_explosion));
	sn76477_one_shot_cap_voltage_w(state->m_sn, !(state->m_schaser_effect_555_is_low || state->m_schaser_explosion) ? 0 : SN76477_EXTERNAL_VOLTAGE_DISCONNECT);
}
开发者ID:LibXenonProject,项目名称:mame-lx,代码行数:23,代码来源:8080bw.c

示例12: RES_K

static const discrete_mixer_desc ironhors_mixer_desc =
	{DISC_MIXER_IS_RESISTOR,
		{RES_K(2.2), RES_K(2.2), RES_K(2.2)},
		{0,0,0,0,0,0},  /* no variable resistors   */
		{0,0,0,0,0,0},  /* no node capacitors      */
		0, RES_K(1),   /* RF */
		0,
		0,
		0, 1};

static const discrete_mixer_desc ironhors_mixer_desc_final =
	{DISC_MIXER_IS_RESISTOR,
		{RES_K(0.5), RES_K(1)},
		{0,0,0,0,0,0},  /* no variable resistors   */
		{CAP_U(4.7), CAP_U(4.7)},  /* node capacitors         */
		0, RES_K(1),   /* RF */
		0,
		0,
		0, 1};

static DISCRETE_SOUND_START( ironhors )

	DISCRETE_INPUTX_STREAM(NODE_01, 0, 5.0, 0)
	DISCRETE_INPUTX_STREAM(NODE_02, 1, 5.0, 0)
	DISCRETE_INPUTX_STREAM(NODE_03, 2, 5.0, 0)

	DISCRETE_INPUTX_STREAM(NODE_04, 3, 1.0, 0)

	DISCRETE_INPUT_DATA(NODE_11)
	DISCRETE_INPUT_DATA(NODE_12)
开发者ID:MisterTea,项目名称:MAMEHub,代码行数:30,代码来源:ironhors.c

示例13: DISCRETE_TRANSFORM2

	DISCRETE_TRANSFORM2(QIX_VOL_DATA_R, QIX_VOL_DATA, 0x0f, "01&")

	/* Work out the parallel resistance of the selected resistors. */
	DISCRETE_COMP_ADDER(NODE_10, QIX_VOL_DATA_L, &qix_attn_table)
	DISCRETE_COMP_ADDER(NODE_20, QIX_VOL_DATA_R, &qix_attn_table)

	/* Then use it for the resistor divider network. */
	DISCRETE_TRANSFORM3(NODE_11, NODE_10, RES_K(10), QIX_DAC_DATA, "001+/2*")
	DISCRETE_TRANSFORM3(NODE_21, NODE_20, RES_K(10), QIX_DAC_DATA, "001+/2*")

	/* If no resistors are selected (0), then the volume is full. */
	DISCRETE_SWITCH(NODE_12, 1, QIX_VOL_DATA_L, QIX_DAC_DATA, NODE_11)
	DISCRETE_SWITCH(NODE_22, 1, QIX_VOL_DATA_R, QIX_DAC_DATA, NODE_21)

	/* Filter the DC using the lowest case filter. */
	DISCRETE_CRFILTER(NODE_13, NODE_12, RES_K(1.5), CAP_U(1))
	DISCRETE_CRFILTER(NODE_23, NODE_22, RES_K(1.5), CAP_U(1))

	DISCRETE_OUTPUT(NODE_13, 1)
	DISCRETE_OUTPUT(NODE_23, 1)
DISCRETE_SOUND_END



/*************************************
 *
 *  PIA handlers
 *
 *************************************/

static WRITE8_DEVICE_HANDLER( sndpia_2_warning_w )
开发者ID:bdidier,项目名称:MAME-OS-X,代码行数:31,代码来源:qix.c

示例14: PORT_START

	PORT_START("TRACKY")
	PORT_BIT( 0x0f, 0, IPT_TRACKBALL_X ) PORT_SENSITIVITY(10) PORT_KEYDELTA(10)
INPUT_PORTS_END


/*************************************
 *
 *  Discrete Sound Blocks
 *
 *************************************/

static discrete_op_amp_filt_info pokey1_info = {
		RES_K(220), 0, 0, 0, /* r1 .. r4 */
		RES_K(220),          /* rF */
		CAP_U(0.022),        /* C1 */
		CAP_U(0.1),          /* C2 */
		0,                   /* C3 */
		0.0,                 /* vRef */
		15.0,                /* vP */
		-15.0,               /* vN */
};

static discrete_mixer_desc quantum_mixer = {
		DISC_MIXER_IS_OP_AMP, /* type */
		{ RES_K(220), RES_K(220) }, /* r{} */
		{},                         /* r_node */
		{ CAP_U(0.1), CAP_U(0.1) }, /* c{} */
		0,                          /* rI  */
		RES_K(220),                 /* rF  */
		0,                          /* cF  */
开发者ID:kkklatu,项目名称:mame,代码行数:30,代码来源:quantum.c

示例15: switch

void prof80_state::ls259_w(int fa, int sa, int fb, int sb)
{
	switch (sa)
	{
	case 0: // C0/TDI
		m_rtc->data_in_w(fa);
		m_rtc->c0_w(fa);
		m_c0 = fa;
		break;

	case 1: // C1
		m_rtc->c1_w(fa);
		m_c1 = fa;
		break;

	case 2: // C2
		m_rtc->c2_w(fa);
		m_c2 = fa;
		break;

	case 3: // READY
		m_fdc->ready_w(fa);
		break;

	case 4: // TCK
		m_rtc->clk_w(fa);
		break;

	case 5: // IN USE
		output_set_led_value(0, fa);
		break;

	case 6: // _MOTOR
		if (fa)
		{
			// trigger floppy motor off NE555 timer
			int t = 110 * RES_M(10) * CAP_U(6.8); // t = 1.1 * R8 * C6

			timer_set(attotime::from_msec(t), TIMER_ID_MOTOR);
		}
		else
		{
			// turn on floppy motor
			if(m_floppy0)
				m_floppy0->mon_w(false);
			if(m_floppy1)
				m_floppy1->mon_w(false);

			m_motor = 1;

			// reset floppy motor off NE555 timer
			timer_set(attotime::never, TIMER_ID_MOTOR);
		}
		break;

	case 7: // SELECT
		break;
	}

	switch (sb)
	{
	case 0: // RESF
		if (fb) m_fdc->reset();
		break;

	case 1: // MINI
		break;

	case 2: // _RTS
		break;

	case 3: // TX
		break;

	case 4: // _MSTOP
		if (!fb)
		{
			// immediately turn off floppy motor
			synchronize(TIMER_ID_MOTOR);
		}
		break;

	case 5: // TXP
		break;

	case 6: // TSTB
		m_rtc->stb_w(fb);
		break;

	case 7: // MME
		//logerror("INIT %u\n", fb);
		m_init = fb;
		bankswitch();
		break;
	}
}
开发者ID:clobber,项目名称:UME,代码行数:96,代码来源:prof80.c


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