예제 #1
0
void fantasy_sound_device::device_add_mconfig(machine_config &config)
{
	SPEAKER(config, "mono").front_center();

	SNK6502_SOUND(config, m_custom, 0);
	m_custom->add_route(ALL_OUTPUTS, "mono", 0.50);

	samples_device &samples(SAMPLES(config, "samples"));
	samples.set_channels(1);
	samples.set_samples_names(fantasy_sample_names);
	samples.add_route(ALL_OUTPUTS, "mono", 0.5);

	sn76477_device &sn76477_1(SN76477(config, "sn76477.1"));
	// BOMB     GND:    2,9,26,27       +5V: 15,25
	sn76477_1.set_noise_params(RES_K(470), RES_M(1.5), CAP_P(220));
	sn76477_1.set_decay_res(0);
	sn76477_1.set_attack_params(0, 0);
	sn76477_1.set_amp_res(RES_K(470));
	sn76477_1.set_feedback_res(RES_K(4.7));
	sn76477_1.set_vco_params(0, 0, 0);
	sn76477_1.set_pitch_voltage(0);
	sn76477_1.set_slf_params(0, 0);
	sn76477_1.set_oneshot_params(0, 0);
	sn76477_1.set_vco_mode(0);
	sn76477_1.set_mixer_params(0, 1, 0);
	// schematic does not show pin 1 grounded, but it must be.
	// otherwise it is using the VCO for the envelope, but the VCO is not hooked up
	sn76477_1.set_envelope_params(0, 1);
	sn76477_1.set_enable(0);
	sn76477_1.add_route(0, "discrete", 1.0, 0);

	DISCRETE(config, m_discrete, fantasy_discrete);
	m_discrete->add_route(ALL_OUTPUTS, "mono", 0.5);
}
예제 #2
0
파일: gotya.cpp 프로젝트: PugsyMAME/mame
void gotya_state::gotya(machine_config &config)
{
	/* basic machine hardware */
	Z80(config, m_maincpu, 18432000/6); /* 3.072 MHz ??? */
	m_maincpu->set_addrmap(AS_PROGRAM, &gotya_state::gotya_map);
	m_maincpu->set_vblank_int("screen", FUNC(gotya_state::irq0_line_hold));

	WATCHDOG_TIMER(config, "watchdog");

	/* video hardware */
	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
	screen.set_refresh_hz(60);
	screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
	screen.set_size(36*8, 32*8);
	screen.set_visarea(0, 36*8-1, 2*8, 30*8-1);
	screen.set_screen_update(FUNC(gotya_state::screen_update_gotya));
	screen.set_palette(m_palette);

	GFXDECODE(config, m_gfxdecode, m_palette, gfx_gotya);
	PALETTE(config, m_palette, FUNC(gotya_state::gotya_palette), 16*4, 32);

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

	SAMPLES(config, m_samples);
	m_samples->set_channels(4);
	m_samples->set_samples_names(sample_names);
	m_samples->add_route(ALL_OUTPUTS, "mono", 1.0);
}
예제 #3
0
void satansat_sound_device::device_add_mconfig(machine_config &config)
{
	SPEAKER(config, "mono").front_center();

	SNK6502_SOUND(config, m_custom, 0);
	m_custom->add_route(ALL_OUTPUTS, "mono", 0.50);

	samples_device &samples(SAMPLES(config, "samples"));
	samples.set_channels(3);
	samples.set_samples_names(vanguard_sample_names);
	samples.add_route(ALL_OUTPUTS, "mono", 0.25);

	sn76477_device &sn76477_1(SN76477(config, "sn76477.1"));
	// ???      GND: 2,26,27        +5V: 15,25
	sn76477_1.set_noise_params(RES_K(470), RES_M(1.5), CAP_P(220));
	sn76477_1.set_decay_res(0);
	sn76477_1.set_attack_params(0, 0);
	sn76477_1.set_amp_res(RES_K(47));
	sn76477_1.set_feedback_res(RES_K(47));
	sn76477_1.set_vco_params(0, 0, 0);
	sn76477_1.set_pitch_voltage(0);
	sn76477_1.set_slf_params(0, 0);
	sn76477_1.set_oneshot_params(0, 0);
	sn76477_1.set_vco_mode(0);
	sn76477_1.set_mixer_params(0, 1, 0);
	sn76477_1.set_envelope_params(1, 1);
	sn76477_1.set_enable(1);
	sn76477_1.add_route(ALL_OUTPUTS, "mono", 1.0);
}
예제 #4
0
void genpin_class::genpin_audio(machine_config &config)
{
	SPEAKER(config, "mechvol").front_center();
	SAMPLES(config, m_samples);
	m_samples->set_channels(6);
	m_samples->set_samples_names(genpin_sample_names);
	m_samples->add_route(ALL_OUTPUTS, "mechvol", 1.0);
}
예제 #5
0
파일: pt554.cpp 프로젝트: MoochMcGee/mame
void nes_bandai_pt554_device::device_add_mconfig(machine_config &config)
{
	// additional sound hardware
	SPEAKER(config, "addon").front_center();

	SAMPLES(config, m_samples);
	m_samples->set_channels(8);
	m_samples->set_samples_names(pt554_sample_names);
	m_samples->add_route(ALL_OUTPUTS, "addon", 0.50);
}
예제 #6
0
void starfire_state::starfire(machine_config &config)
{
	fireone(config);

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

	SAMPLES(config, m_samples);
	m_samples->set_channels(5);
	m_samples->set_samples_names(starfire_sample_names);
	m_samples->add_route(ALL_OUTPUTS, "mono", 1.0);
}
예제 #7
0
파일: mmagic.cpp 프로젝트: PugsyMAME/mame
void mmagic_state::mmagic(machine_config &config)
{
	// basic machine hardware
	I8085A(config, m_maincpu, 6.144_MHz_XTAL); // NEC D8085A
	m_maincpu->set_addrmap(AS_PROGRAM, &mmagic_state::mmagic_mem);
	m_maincpu->set_addrmap(AS_IO, &mmagic_state::mmagic_io);

	// video hardware
	SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
	m_screen->set_raw(6.144_MHz_XTAL, 384, 0, 256, 264, 0, 192);
	m_screen->set_screen_update(FUNC(mmagic_state::screen_update));

	PALETTE(config, m_palette, palette_device::RGB_3BIT);

	// sound hardware
	SPEAKER(config, "mono").front_center();
	SAMPLES(config, m_samples);
	m_samples->set_channels(1);
	m_samples->set_samples_names(mmagic_sample_names);
	m_samples->add_route(ALL_OUTPUTS, "mono", 0.5);
	// TODO: replace samples with SN76477 + discrete sound
}
예제 #8
0
	{OFSX, 0, 0},
	{OFSY, 0, 0},
	{OFSZ, 0, 0},
	{DUR, 3, 0},
	{LATENT, 20, 0},
	{WINDOW, 20, 0},
	{THRESH_ACT, 4, 0},
	{THRESH_INACT, 2, 0},
	{TIME_INACT, 6, 0},
	{THRESH_FF, 8, 0},
	{TIME_FF, 0x20, 0},
	{TAP_AXES, 0, 0},
	{ACT_INACT_CTL, 0xFF, 0},
	{BW_RATE, RATE(8), 0},
	{DATA_FORMAT, FULL_RES, 0},
	{FIFO_CTL, FIFO_MODE(FIFO_STREAM) | SAMPLES(0), 0},
#ifdef ADXL346_GINT2
	{INT_MAP, ADXL34X_INT_MASK | OVERRUN, 0},
#else
	{INT_MAP, 0, 0},
#endif
	{INT_ENABLE, ADXL34X_INT_MASK | OVERRUN, 0}
};

static int adxl34x_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
	int ret;
	struct hua_input_chip *chip;

	pr_pos_info();
예제 #9
0
void sasuke_sound_device::device_add_mconfig(machine_config &config)
{
	SPEAKER(config, "mono").front_center();

	SNK6502_SOUND(config, m_custom, 0);
	m_custom->add_route(ALL_OUTPUTS, "mono", 0.50);

	samples_device &samples(SAMPLES(config, "samples"));
	samples.set_channels(4);
	samples.set_samples_names(sasuke_sample_names);
	samples.add_route(ALL_OUTPUTS, "mono", 0.12);

	sn76477_device &sn76477_1(SN76477(config, "sn76477.1"));
	// ic48     GND: 2,22,26,27,28  +5V: 1,15,25
	sn76477_1.set_noise_params(RES_K(470), RES_K(150), CAP_P(4700));
	sn76477_1.set_decay_res(RES_K(22));
	sn76477_1.set_attack_params(CAP_U(10), RES_K(10));
	sn76477_1.set_amp_res(RES_K(100));
	sn76477_1.set_feedback_res(RES_K(47));
	sn76477_1.set_vco_params(0, 0, 0);
	sn76477_1.set_pitch_voltage(0);
	sn76477_1.set_slf_params(0, RES_K(10));
	sn76477_1.set_oneshot_params(CAP_U(2.2), RES_K(100));
	sn76477_1.set_vco_mode(0);
	sn76477_1.set_mixer_params(0, 1, 0);
	sn76477_1.set_envelope_params(1, 0);
	sn76477_1.set_enable(1);
	sn76477_1.add_route(ALL_OUTPUTS, "mono", 0.50);

	sn76477_device &sn76477_2(SN76477(config, "sn76477.2"));
	// ic51     GND: 2,26,27        +5V: 1,15,22,25,28
	sn76477_2.set_noise_params(RES_K(340), RES_K(47), CAP_P(100));
	sn76477_2.set_decay_res(RES_K(470));
	sn76477_2.set_attack_params(CAP_U(4.7), RES_K(10));
	sn76477_2.set_amp_res(RES_K(100));
	sn76477_2.set_feedback_res(RES_K(47));
	sn76477_2.set_vco_params(0, CAP_P(220), RES_K(1000));
	sn76477_2.set_pitch_voltage(0);
	sn76477_2.set_slf_params(0, RES_K(220));
	sn76477_2.set_oneshot_params(CAP_U(22), RES_K(47));
	sn76477_2.set_vco_mode(1);
	sn76477_2.set_mixer_params(0, 1, 0);
	sn76477_2.set_envelope_params(1, 1);
	sn76477_2.set_enable(1);
	sn76477_2.add_route(ALL_OUTPUTS, "mono", 0.50);

	sn76477_device &sn76477_3(SN76477(config, "sn76477.3"));
	// ic52     GND: 2,22,27,28     +5V: 1,15,25,26
	sn76477_3.set_noise_params(RES_K(330), RES_K(47), CAP_P(100));
	sn76477_3.set_decay_res(RES_K(1));
	sn76477_3.set_attack_params(0, RES_K(1));
	sn76477_3.set_amp_res(RES_K(100));
	sn76477_3.set_feedback_res(RES_K(47));
	sn76477_3.set_vco_params(0, CAP_P(1000), RES_K(1000));
	sn76477_3.set_pitch_voltage(0);
	sn76477_3.set_slf_params(CAP_U(1), RES_K(10));
	sn76477_3.set_oneshot_params(CAP_U(2.2), RES_K(150));
	sn76477_3.set_vco_mode(0);
	sn76477_3.set_mixer_params(1, 1, 0);
	sn76477_3.set_envelope_params(1, 0);
	sn76477_3.set_enable(1);
	sn76477_3.add_route(ALL_OUTPUTS, "mono", 0.50);
}
예제 #10
0
static int __devinit adxl34x_initialize(bus_device *bus, struct adxl34x *ac)
{
	struct input_dev *input_dev;
	struct adxl34x_platform_data *devpd = bus->dev.platform_data;
	struct adxl34x_platform_data *pdata;
	int err, range;
	unsigned char revid;

	if (!bus->irq) {
		dev_err(&bus->dev, "no IRQ?\n");
		return -ENODEV;
	}

	if (NULL == devpd) {
		dev_err(&bus->dev, "No platfrom data: Using default initialization\n");
		return -ENOMEM;
	}

	memcpy(&ac->pdata, devpd, sizeof(ac->pdata));
	pdata = &ac->pdata;

	input_dev = input_allocate_device();
	if (!input_dev) {
		dev_err(&bus->dev, "%s: input device allocation failed\n", __func__);
		return -ENOMEM;
	}
	ac->input = input_dev;
	ac->disabled = 1;

	INIT_WORK(&ac->work, adxl34x_work);
	mutex_init(&ac->mutex);

	revid = ac->read(bus, DEVID);

	switch (revid) {
	case ID_ADXL345:
		ac->model = ACC_ADXL345;
		break;
	case ID_ADXL346:
		ac->model = ACC_ADXL346;
		break;
	default:
		dev_err(&bus->dev, "Read ACC ADXL Chip ID Err 0x%x\n", revid);
		err = -ENODEV;
		goto err_free_mem;
	}

	dev_info(&bus->dev, "Read ACC ADXL OK ,Chip ID is 0x%x\n", revid);

	snprintf(ac->phys, sizeof(ac->phys), "%s/input0", dev_name(&bus->dev));

	input_dev->name = ACCL_INPUT_DEV_NAME;
	input_dev->phys = ac->phys;
	input_dev->dev.parent = &bus->dev;
	input_dev->id.product = ac->model;
	input_dev->id.bustype = BUS_I2C;
	/*input_dev->open = adxl34x_input_open;*/
	/*input_dev->close = adxl34x_input_close;*/
	input_dev->open = NULL;
	input_dev->close = NULL;
	input_set_drvdata(input_dev, ac);

	__set_bit(ac->pdata.ev_type, input_dev->evbit);

	if (ac->pdata.ev_type == EV_REL) {
		__set_bit(REL_X, input_dev->relbit);
		__set_bit(REL_Y, input_dev->relbit);
		__set_bit(REL_Z, input_dev->relbit);
	} else {
		/* EV_ABS */
		__set_bit(ABS_X, input_dev->absbit);
		__set_bit(ABS_Y, input_dev->absbit);
		__set_bit(ABS_Z, input_dev->absbit);

		if (pdata->data_range & FULL_RES)
			range = ADXL_FULLRES_MAX_VAL;	/* Signed 13-bit */
		else
			range = ADXL_FIXEDRES_MAX_VAL;	/* Signed 10-bit */

		input_set_abs_params(input_dev, ABS_X, -range, range, 3, 3);
		input_set_abs_params(input_dev, ABS_Y, -range, range, 3, 3);
		input_set_abs_params(input_dev, ABS_Z, -range, range, 3, 3);
	}

	__set_bit(EV_KEY, input_dev->evbit);
	__set_bit(pdata->ev_code_tap_x, input_dev->keybit);
	__set_bit(pdata->ev_code_tap_y, input_dev->keybit);
	__set_bit(pdata->ev_code_tap_z, input_dev->keybit);


	if (pdata->ev_code_ff) {
		ac->int_mask = FREE_FALL;
		__set_bit(pdata->ev_code_ff, input_dev->keybit);
	}

	if (pdata->ev_code_act_inactivity)
		__set_bit(pdata->ev_code_act_inactivity, input_dev->keybit);

	ac->int_mask |= ACTIVITY | INACTIVITY;

	if (pdata->watermark) {
		ac->int_mask |= WATERMARK;
		if (!FIFO_MODE(pdata->fifo_mode))
			pdata->fifo_mode |= FIFO_STREAM;
	} else {
		ac->int_mask |= DATA_READY;
	}

	if (pdata->tap_axis_control & (TAP_X_EN | TAP_Y_EN | TAP_Z_EN))
		ac->int_mask |= SINGLE_TAP | DOUBLE_TAP;

	if (FIFO_MODE(pdata->fifo_mode) == FIFO_BYPASS)
		ac->fifo_delay = 0;

	ac->write(bus, POWER_CTL, 0);

	err = adxl34x_config_gpio(&bus->dev, ac);
	if (err < 0) {
		dev_err(&bus->dev, "%s: failed to config gpio lowpower mode\n", __func__);
		goto err_clear_inputdev;
	}
	if (bus->irq >= 0) {
		err = gpio_request(irq_to_gpio(bus->irq), "gsensor_gpio");
		if (err) {
			dev_err(&bus->dev, "%s: failed to request gpio for irq\n", __func__);
			goto err_clear_inputdev;
		}
		gpio_direction_input(bus->irq);
	}

	err = sysfs_create_group(&bus->dev.kobj, &adxl34x_attr_group);
	if (err) {
		dev_err(&bus->dev, "ADXL34X register sysfs failed\n");
		goto err_free_gpio;
	}

	err = input_register_device(input_dev);
	if (err) {
		dev_err(&bus->dev, "ADXL34X register input device failed\n");
		goto err_remove_attr;
	}

	AC_WRITE(ac, THRESH_TAP, pdata->tap_threshold);
	AC_WRITE(ac, OFSX, pdata->x_axis_offset);
	ac->hwcal.x = pdata->x_axis_offset;
	AC_WRITE(ac, OFSY, pdata->y_axis_offset);
	ac->hwcal.y = pdata->y_axis_offset;
	AC_WRITE(ac, OFSZ, pdata->z_axis_offset);
	ac->hwcal.z = pdata->z_axis_offset;
	AC_WRITE(ac, THRESH_TAP, pdata->tap_threshold);
	AC_WRITE(ac, DUR, pdata->tap_duration);
	AC_WRITE(ac, LATENT, pdata->tap_latency);
	AC_WRITE(ac, WINDOW, pdata->tap_window);
	AC_WRITE(ac, THRESH_ACT, pdata->activity_threshold);
	AC_WRITE(ac, THRESH_INACT, pdata->inactivity_threshold);
	AC_WRITE(ac, TIME_INACT, pdata->inactivity_time);
	AC_WRITE(ac, THRESH_FF, pdata->free_fall_threshold);
	AC_WRITE(ac, TIME_FF, pdata->free_fall_time);
	AC_WRITE(ac, TAP_AXES, pdata->tap_axis_control);
	AC_WRITE(ac, ACT_INACT_CTL, pdata->act_axis_control);
	AC_WRITE(ac, BW_RATE, RATE(ac->pdata.data_rate) |
		 (pdata->low_power_mode ? LOW_POWER : 0));
	AC_WRITE(ac, DATA_FORMAT, pdata->data_range);
	AC_WRITE(ac, FIFO_CTL, FIFO_MODE(pdata->fifo_mode) |
		 SAMPLES(pdata->watermark));
	AC_WRITE(ac, INT_MAP, 0);	/* Map all INTs to INT1 */
	AC_WRITE(ac, INT_ENABLE, 0);

    /* pdata->power_mode &= (PCTL_AUTO_SLEEP | PCTL_LINK); */
	pdata->power_mode &=  PCTL_LINK;

	if (bus->irq >= 0) {
		err = request_irq(bus->irq, adxl34x_irq,
				  IRQF_TRIGGER_HIGH, bus->dev.driver->name, ac);
		if (err) {
			dev_err(&bus->dev, "irq %d busy?\n", bus->irq);
			goto err_unreg_inputdev;
		}
	}
#ifdef CONFIG_HUAWEI_SENSORS_INPUT_INFO
	err = set_sensor_input(ACC, input_dev->dev.kobj.name);
	if (err) {
		if (bus->irq >= 0) {
			free_irq(ac->bus->irq, ac);
		}
		dev_err(&bus->dev, "%s set_sensor_input failed\n", __func__);
		goto err_unreg_inputdev;
	}
#endif
	dev_dbg(&bus->dev, "ADXL%d accelerometer, irq %d\n",
				 ac->model, bus->irq);

	return 0;

err_unreg_inputdev:
	input_unregister_device(input_dev);
err_remove_attr:
	sysfs_remove_group(&bus->dev.kobj, &adxl34x_attr_group);
err_free_gpio:
	if (bus->irq >= 0)
		gpio_free(irq_to_gpio(bus->irq));
err_clear_inputdev:
	input_set_drvdata(input_dev, NULL);
err_free_mem:
	input_free_device(input_dev);

	return err;
}