コード例 #1
0
ファイル: exidy.cpp プロジェクト: SailorSat/cabmame
void venture_sound_device::device_add_mconfig(machine_config &config)
{
	m6502_device &audiocpu(M6502(config, "audiocpu", 3579545/4));
	audiocpu.set_addrmap(AS_PROGRAM, &venture_sound_device::venture_audio_map);

	RIOT6532(config, m_riot, SH6532_CLOCK);
	m_riot->in_pa_callback().set(FUNC(venture_sound_device::r6532_porta_r));
	m_riot->out_pa_callback().set(FUNC(venture_sound_device::r6532_porta_w));
	m_riot->in_pb_callback().set(FUNC(venture_sound_device::r6532_portb_r));
	m_riot->out_pb_callback().set(FUNC(venture_sound_device::r6532_portb_w));
	m_riot->irq_callback().set("audioirq", FUNC(input_merger_device::in_w<0>));

	PIA6821(config, m_pia, 0);
	m_pia->writepa_handler().set(FUNC(venture_sound_device::pia_pa_w));
	m_pia->writepb_handler().set(FUNC(venture_sound_device::pia_pb_w));
	m_pia->ca2_handler().set(FUNC(venture_sound_device::pia_ca2_w));
	m_pia->cb2_handler().set(FUNC(venture_sound_device::pia_cb2_w));
	m_pia->irqb_handler().set("audioirq", FUNC(input_merger_device::in_w<1>));

	INPUT_MERGER_ANY_HIGH(config, "audioirq").output_handler().set_inputline("audiocpu", m6502_device::IRQ_LINE); // open collector

	SPEAKER(config, "mono").front_center();

	this->add_route(ALL_OUTPUTS, "mono", 0.50);
}
コード例 #2
0
ファイル: mpc.cpp プロジェクト: PugsyMAME/mame
DEVICE_INPUT_DEFAULTS_END


//-------------------------------------------------
//  device_add_mconfig - add device-specific
//  machine configuration
//-------------------------------------------------

void ss50_mpc_device::device_add_mconfig(machine_config &config)
{
	PIA6821(config, m_pia, 0); // actually MC6820
	m_pia->writepa_handler().set("outgate", FUNC(input_merger_device::in_w<0>)).bit(0);
	m_pia->cb2_handler().set(FUNC(ss50_mpc_device::reader_control_w));
	m_pia->readpb_handler().set_ioport("STOP").mask(0x01).lshift(6);
	m_pia->readpb_handler().append(FUNC(ss50_mpc_device::count_r)).lshift(7);
	m_pia->writepb_handler().set(FUNC(ss50_mpc_device::count_select_w)).bit(2);
	m_pia->writepb_handler().append(m_counter, FUNC(ripple_counter_device::reset_w)).bit(0);
	//m_pia->irqa_handler().set(FUNC(ss50_mpc_device::pia_irq_w));
	//m_pia->irqb_handler().set(FUNC(ss50_mpc_device::pia_irq_w));

	rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal"));
	rs232.rxd_handler().set(FUNC(ss50_mpc_device::serial_input_w));
	rs232.set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal));

	INPUT_MERGER_ALL_HIGH(config, "outgate").output_handler().set("rs232", FUNC(rs232_port_device::write_txd));

	INPUT_MERGER_ANY_HIGH(config, m_loopback).output_handler().set("outgate", FUNC(input_merger_device::in_w<1>));

	RIPPLE_COUNTER(config, m_counter); // CD4024AE (IC3)
	m_counter->set_stages(7); // only Q5 (÷32) and Q4 (÷16) are actually used
}
コード例 #3
0
ファイル: gottlieb.cpp プロジェクト: k2-git/mame
INPUT_PORTS_END


//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------

void gottlieb_sound_r1_device::device_add_mconfig(machine_config &config)
{
	// audio CPU
	m6502_device &audiocpu(M6502(config, "audiocpu", SOUND1_CLOCK/4)); // the board can be set to /2 as well
	audiocpu.set_addrmap(AS_PROGRAM, &gottlieb_sound_r1_device::gottlieb_sound_r1_map);

	INPUT_MERGER_ANY_HIGH(config, "nmi").output_handler().set_inputline("audiocpu", INPUT_LINE_NMI);

	// I/O configuration
	RIOT6532(config, m_riot, SOUND1_CLOCK/4);
	m_riot->in_pb_callback().set_ioport("SB1");
	m_riot->out_pb_callback().set("nmi", FUNC(input_merger_device::in_w<0>)).bit(7).invert(); // unsure if this is ever used, but the NMI is connected to the RIOT's PB7
	m_riot->irq_callback().set_inputline("audiocpu", M6502_IRQ_LINE);

	// sound devices
	DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, *this, 0.25); // unknown DAC
	voltage_regulator_device &vref(VOLTAGE_REGULATOR(config, "vref"));
	vref.set_output(5.0);
	vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
	vref.add_route(0, "dac", -1.0, DAC_VREF_NEG_INPUT);
}
コード例 #4
0
ファイル: vib.cpp プロジェクト: PugsyMAME/mame
void acorn_vib_device::device_add_mconfig(machine_config &config)
{
	INPUT_MERGER_ANY_HIGH(config, m_irqs).output_handler().set(FUNC(acorn_vib_device::irq_w));

	VIA6522(config, m_via6522, XTAL(1'000'000));
	m_via6522->writepa_handler().set("cent_data_out", FUNC(output_latch_device::bus_w));
	m_via6522->ca2_handler().set(m_centronics, FUNC(centronics_device::write_strobe));
	m_via6522->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<0>));

	CENTRONICS(config, m_centronics, centronics_devices, "printer");
	m_centronics->ack_handler().set(m_via6522, FUNC(via6522_device::write_ca1));
	m_centronics->busy_handler().set(m_via6522, FUNC(via6522_device::write_pa7));
	output_latch_device &cent_data_out(OUTPUT_LATCH(config, "cent_data_out"));
	m_centronics->set_output_latch(cent_data_out);

	I8255(config, m_ppi8255, 0);

	ACIA6850(config, m_acia, 0);
	m_acia->txd_handler().set(m_rs232, FUNC(rs232_port_device::write_txd));
	m_acia->rts_handler().set(m_rs232, FUNC(rs232_port_device::write_rts));
	m_acia->irq_handler().set(m_irqs, FUNC(input_merger_device::in_w<1>));

	RS232_PORT(config, m_rs232, default_rs232_devices, nullptr);
	m_rs232->rxd_handler().set(m_acia, FUNC(acia6850_device::write_rxd));
	m_rs232->cts_handler().set(m_acia, FUNC(acia6850_device::write_cts));
	m_rs232->dcd_handler().set(m_acia, FUNC(acia6850_device::write_dcd));

	CLOCK(config, m_acia_clock, 1.8432_MHz_XTAL);
	m_acia_clock->signal_handler().set(FUNC(acorn_vib_device::write_acia_clock));
}
コード例 #5
0
ファイル: efo_zsu.cpp プロジェクト: Octocontrabass/mame
void efo_zsu_device::device_add_mconfig(machine_config &config)
{
	z80_device& soundcpu(Z80(config, "soundcpu", 4000000));
	soundcpu.set_addrmap(AS_PROGRAM, &efo_zsu_device::zsu_map);
	soundcpu.set_addrmap(AS_IO, &efo_zsu_device::zsu_io);
	soundcpu.set_daisy_config(daisy_chain);

	Z80CTC(config, m_ctc0, 4000000);
	m_ctc0->intr_callback().set("soundirq", FUNC(input_merger_device::in_w<0>));
	m_ctc0->zc_callback<0>().set(FUNC(efo_zsu_device::ctc0_z0_w));
	m_ctc0->zc_callback<1>().set(FUNC(efo_zsu_device::ctc0_z1_w));
	m_ctc0->zc_callback<2>().set(FUNC(efo_zsu_device::ctc0_z2_w));

	Z80CTC(config, m_ctc1, 4000000);
	m_ctc1->intr_callback().set("soundirq", FUNC(input_merger_device::in_w<1>));
	m_ctc1->zc_callback<0>().set(FUNC(efo_zsu_device::ctc1_z0_w));
	m_ctc1->zc_callback<1>().set(FUNC(efo_zsu_device::ctc1_z1_w));
	m_ctc1->zc_callback<2>().set(FUNC(efo_zsu_device::ctc1_z2_w));

#if 0 // does nothing useful now
	clock_device &ck1mhz(CLOCK(config, "ck1mhz", 4000000/4);
	ck1mhz.signal_handler().set(m_ctc1, FUNC(z80ctc_device::trg0));
	ck1mhz.signal_handler().append(m_ctc1, FUNC(z80ctc_device::trg1));
	ck1mhz.signal_handler().append(m_ctc1, FUNC(z80ctc_device::trg2));
#endif

	GENERIC_LATCH_8(config, m_soundlatch);
	m_soundlatch->data_pending_callback().set("soundirq", FUNC(input_merger_device::in_w<2>));

	INPUT_MERGER_ANY_HIGH(config, "soundirq").output_handler().set_inputline("soundcpu", INPUT_LINE_IRQ0); // 74HC03 NAND gate

	SPEAKER(config, "mono").front_center();

	ay8910_device &aysnd0(AY8910(config, "aysnd0", 4000000/2));
	aysnd0.port_a_write_callback().set_membank("rombank").mask(0x03);
	aysnd0.add_route(ALL_OUTPUTS, "mono", 0.5);

	ay8910_device &aysnd1(AY8910(config, "aysnd1", 4000000/2));
	aysnd1.port_a_write_callback().set(FUNC(efo_zsu_device::ay1_porta_w));
	aysnd1.add_route(ALL_OUTPUTS, "mono", 0.5);

	CD40105(config, m_fifo, 0);
	m_fifo->out_ready_cb().set(FUNC(efo_zsu_device::fifo_dor_w));
	m_fifo->out_cb().set(m_adpcm, FUNC(msm5205_device::data_w));

	MSM5205(config, m_adpcm, 4000000/8).add_route(ALL_OUTPUTS, "mono", 0.50);
}
コード例 #6
0
ファイル: v550.cpp プロジェクト: MASHinfo/mame
void v550_state::v550(machine_config &config)
{
	Z80(config, m_maincpu, 34.846_MHz_XTAL / 16); // NEC D780C (2.177875 MHz verified)
	m_maincpu->set_addrmap(AS_PROGRAM, &v550_state::mem_map);
	m_maincpu->set_addrmap(AS_IO, &v550_state::io_map);

	NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // NEC D444C-2 + battery

	upd7220_device &gdc(UPD7220(config, "gdc", 34.846_MHz_XTAL / 16)); // NEC D7220D (2.177875 MHz verified)
	gdc.set_screen("screen");

	I8255(config, "ppi"); // NEC D8255AC-5

	I8251(config, m_usart, 34.846_MHz_XTAL / 16); // NEC D8251AC
	m_usart->rxrdy_handler().set("mainint", FUNC(input_merger_device::in_w<1>));

	upd7201_new_device& mpsc(UPD7201_NEW(config, "mpsc", 34.846_MHz_XTAL / 16)); // NEC D7201C
	mpsc.out_int_callback().set("mainint", FUNC(input_merger_device::in_w<0>));

	INPUT_MERGER_ANY_HIGH(config, "mainint").output_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ0);

	com8116_device &brg1(COM8116(config, "brg1", 5068800)); // actually SMC COM8116T-020 (unknown clock)
	brg1.ft_handler().set("mpsc", FUNC(upd7201_new_device::txca_w));
	brg1.fr_handler().set("mpsc", FUNC(upd7201_new_device::rxca_w));

	com8116_device &brg2(COM8116(config, "brg2", 5068800)); // actually SMC COM8116T-020
	brg2.ft_handler().set("mpsc", FUNC(upd7201_new_device::txcb_w));
	brg2.ft_handler().append("mpsc", FUNC(upd7201_new_device::rxcb_w));
	brg2.fr_handler().set("usart", FUNC(i8251_device::write_txc));
	brg2.fr_handler().append("usart", FUNC(i8251_device::write_rxc));

	mcs48_cpu_device &kbdmcu(I8035(config, "kbdmcu", 4'608'000));
	kbdmcu.set_addrmap(AS_PROGRAM, &v550_state::kbd_map);

	SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
	m_screen->set_raw(34.846_MHz_XTAL, 19 * 102, 0, 19 * 80, 295, 0, 272);
	m_screen->set_screen_update(FUNC(v550_state::screen_update));

	scn2672_device &pvtc(SCN2672(config, "pvtc", 34.846_MHz_XTAL / 19));
	pvtc.set_addrmap(0, &v550_state::pvtc_char_map);
	pvtc.set_addrmap(1, &v550_state::pvtc_attr_map);
	pvtc.set_character_width(19);
	pvtc.intr_callback().set_inputline(m_maincpu, INPUT_LINE_NMI);
	pvtc.set_screen("screen");
	// SCB2673 clock verified at 17.423 MHz
}
コード例 #7
0
ファイル: cms.cpp プロジェクト: SailorSat/cabmame
void cms_state::cms6502(machine_config &config)
{
	M6502(config, m_maincpu, 1_MHz_XTAL);
	m_maincpu->set_addrmap(AS_PROGRAM, &cms_state::cms6502_mem);

	INPUT_MERGER_ANY_HIGH(config, m_irqs).output_handler().set_inputline(m_maincpu, M6502_IRQ_LINE);

	VIA6522(config, m_via, 1_MHz_XTAL);
	//m_via->cb2_handler().set(FUNC(cms_state::cass_w));
	m_via->irq_handler().set("irqs", FUNC(input_merger_device::in_w<0>));

	/* 7 Slot Backplane */
	ACORN_BUS(config, m_bus, 0);
	m_bus->set_space(m_maincpu, AS_PROGRAM);
	m_bus->out_irq_callback().set(m_irqs, FUNC(input_merger_device::in_w<1>));
	m_bus->out_nmi_callback().set(FUNC(cms_state::bus_nmi_w));
	ACORN_BUS_SLOT(config, "bus1", m_bus, cms_bus_devices, "4080term");
	ACORN_BUS_SLOT(config, "bus2", m_bus, cms_bus_devices, nullptr);
	ACORN_BUS_SLOT(config, "bus3", m_bus, cms_bus_devices, "fdc");
	ACORN_BUS_SLOT(config, "bus4", m_bus, cms_bus_devices, "hires");
	ACORN_BUS_SLOT(config, "bus5", m_bus, cms_bus_devices, nullptr);
	ACORN_BUS_SLOT(config, "bus6", m_bus, cms_bus_devices, nullptr);
}
コード例 #8
0
ファイル: zorba.cpp プロジェクト: fesh0r/mame-full
void zorba_state::zorba(machine_config &config)
{
	// basic machine hardware
	Z80(config, m_maincpu, 24_MHz_XTAL / 6);
	m_maincpu->set_addrmap(AS_PROGRAM, &zorba_state::zorba_mem);
	m_maincpu->set_addrmap(AS_IO, &zorba_state::zorba_io);

	/* video hardware */
	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
	screen.set_color(rgb_t::green());
	screen.set_refresh_hz(50);
	screen.set_screen_update("crtc", FUNC(i8275_device::screen_update));
	GFXDECODE(config, "gfxdecode", m_palette, gfx_zorba);
	PALETTE(config, m_palette, palette_device::MONOCHROME_HIGHLIGHT);

	/* sound hardware */
	SPEAKER(config, "mono").front_center();
	BEEP(config, m_beep, 800).add_route(ALL_OUTPUTS, "mono", 1.00); // should be horizontal frequency / 16, so depends on CRTC parameters

	INPUT_MERGER_ANY_HIGH(config, "irq0").output_handler().set(FUNC(zorba_state::irq_w<0>));
	INPUT_MERGER_ANY_HIGH(config, "irq1").output_handler().set(FUNC(zorba_state::irq_w<1>));
	INPUT_MERGER_ANY_HIGH(config, "irq2").output_handler().set(FUNC(zorba_state::irq_w<2>));

	/* devices */
	Z80DMA(config, m_dma, 24_MHz_XTAL / 6);
	// busack on cpu connects to bai pin
	m_dma->out_busreq_callback().set(FUNC(zorba_state::busreq_w));  //connects to busreq on cpu
	m_dma->out_int_callback().set("irq0", FUNC(input_merger_device::in_w<0>));
	//ba0 - not connected
	m_dma->in_mreq_callback().set(FUNC(zorba_state::memory_read_byte));
	m_dma->out_mreq_callback().set(FUNC(zorba_state::memory_write_byte));
	m_dma->in_iorq_callback().set(FUNC(zorba_state::io_read_byte));
	m_dma->out_iorq_callback().set(FUNC(zorba_state::io_write_byte));

	I8251(config, m_uart0, 0); // U32 COM port J2
	m_uart0->txd_handler().set("rs232", FUNC(rs232_port_device::write_txd)); // TODO: this line has a LED attached
	m_uart0->dtr_handler().set("rs232", FUNC(rs232_port_device::write_dtr));
	m_uart0->rts_handler().set("rs232", FUNC(rs232_port_device::write_rts));
	m_uart0->rxrdy_handler().set(FUNC(zorba_state::tx_rx_rdy_w<1>));
	m_uart0->txrdy_handler().set(FUNC(zorba_state::tx_rx_rdy_w<0>));

	I8251(config, m_uart1, 0); // U31 printer port J3
	m_uart1->txd_handler().set("serprn", FUNC(rs232_port_device::write_txd));
	m_uart1->rts_handler().set("serprn", FUNC(rs232_port_device::write_rts));
	m_uart1->rxrdy_handler().set(FUNC(zorba_state::tx_rx_rdy_w<3>));
	m_uart1->txrdy_handler().set(FUNC(zorba_state::tx_rx_rdy_w<2>));

	I8251(config, m_uart2, 0); // U30 serial keyboard J6
	m_uart2->txd_handler().set("keyboard", FUNC(zorba_keyboard_device::txd_w));
	m_uart2->rxrdy_handler().set(FUNC(zorba_state::tx_rx_rdy_w<5>));
	m_uart2->txrdy_handler().set(FUNC(zorba_state::tx_rx_rdy_w<4>));

	// port A - disk select etc, beeper
	// port B - parallel interface
	PIA6821(config, m_pia0, 0);
	m_pia0->writepa_handler().set(FUNC(zorba_state::pia0_porta_w));
	m_pia0->writepb_handler().set("parprndata", FUNC(output_latch_device::bus_w));
	m_pia0->cb2_handler().set("parprn", FUNC(centronics_device::write_strobe));

	// IEEE488 interface
	PIA6821(config, m_pia1, 0);
	m_pia1->readpa_handler().set(m_ieee, FUNC(ieee488_device::dio_r)); // TODO: gated with PB1
	m_pia1->writepa_handler().set(m_ieee, FUNC(ieee488_device::host_dio_w)); // TODO: gated with PB1
	m_pia1->readpb_handler().set(FUNC(zorba_state::pia1_portb_r));
	m_pia1->writepb_handler().set(FUNC(zorba_state::pia1_portb_w));
	m_pia1->ca2_handler().set(m_ieee, FUNC(ieee488_device::host_ifc_w));
	m_pia1->cb2_handler().set(m_ieee, FUNC(ieee488_device::host_ren_w));
	m_pia1->irqa_handler().set("irq1", FUNC(input_merger_device::in_w<0>));
	m_pia1->irqb_handler().set("irq1", FUNC(input_merger_device::in_w<1>));

	// PIT
	pit8254_device &pit(PIT8254(config, "pit", 0));
	pit.set_clk<0>(24_MHz_XTAL / 3);
	pit.set_clk<1>(24_MHz_XTAL / 3);
	pit.set_clk<2>(24_MHz_XTAL / 3);
	pit.out_handler<0>().set(FUNC(zorba_state::br1_w));
	pit.out_handler<1>().set(m_uart1, FUNC(i8251_device::write_txc));
	pit.out_handler<1>().append(m_uart1, FUNC(i8251_device::write_rxc));
	pit.out_handler<2>().set(m_uart2, FUNC(i8251_device::write_txc));
	pit.out_handler<2>().append(m_uart2, FUNC(i8251_device::write_rxc));

	// CRTC
	I8275(config, m_crtc, 14.318'181_MHz_XTAL / 7);
	m_crtc->set_character_width(8);
	m_crtc->set_display_callback(FUNC(zorba_state::zorba_update_chr), this);
	m_crtc->drq_wr_callback().set(m_dma, FUNC(z80dma_device::rdy_w));
	m_crtc->irq_wr_callback().set("irq0", FUNC(input_merger_device::in_w<1>));
	m_crtc->set_screen("screen");

	// Floppies
	FD1793(config, m_fdc, 24_MHz_XTAL / 24);
	m_fdc->intrq_wr_callback().set("irq2", FUNC(input_merger_device::in_w<0>));
	m_fdc->drq_wr_callback().set("irq2", FUNC(input_merger_device::in_w<1>));
	FLOPPY_CONNECTOR(config, m_floppy0, zorba_floppies, "525dd", floppy_image_device::default_floppy_formats).enable_sound(true);
	FLOPPY_CONNECTOR(config, m_floppy1, zorba_floppies, "525dd", floppy_image_device::default_floppy_formats).enable_sound(true);

	// J1 IEEE-488
	IEEE488(config, m_ieee);
	m_ieee->srq_callback().set(m_pia1, FUNC(pia6821_device::ca2_w)); // TODO: gated with PB1 from PIA

	// J2 EIA RS232/internal modem
	// TODO: this has additional lines compared to a regular RS232 port (TxC in, RxC in, RxC out, speaker in, power)
	rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, nullptr));
	rs232.rxd_handler().set(m_uart0, FUNC(i8251_device::write_rxd)); // TODO: this line has a LED attached
	rs232.cts_handler().set(m_uart0, FUNC(i8251_device::write_cts)); // TODO: this line has a LED attached
	rs232.dsr_handler().set(m_uart0, FUNC(i8251_device::write_dsr));

	// J3 Parallel printer
	centronics_device &parprn(CENTRONICS(config, "parprn", centronics_devices, "printer"));
	parprn.busy_handler().set(m_uart1, FUNC(i8251_device::write_cts));
	parprn.busy_handler().append(m_uart1, FUNC(i8251_device::write_dsr)); // TODO: shared with serial CTS
	parprn.fault_handler().set(FUNC(zorba_state::printer_fault_w));
	parprn.select_handler().set(FUNC(zorba_state::printer_select_w));

	output_latch_device &parprndata(OUTPUT_LATCH(config, "parprndata"));
	parprn.set_output_latch(parprndata);

	// J3 Serial printer
	rs232_port_device &serprn(RS232_PORT(config, "serprn", default_rs232_devices, nullptr));
	serprn.rxd_handler().set(m_uart1, FUNC(i8251_device::write_rxd)); // TODO: this line has a LED attached

	// J6 TTL-level serial keyboard
	ZORBA_KEYBOARD(config, "keyboard").rxd_cb().set(m_uart2, FUNC(i8251_device::write_rxd));

	SOFTWARE_LIST(config, "flop_list").set_original("zorba");
}