Exemple #1
0
void rastan_state::rastan(machine_config &config)
{
	/* basic machine hardware */
	M68000(config, m_maincpu, XTAL(16'000'000)/2);  /* verified on pcb */
	m_maincpu->set_addrmap(AS_PROGRAM, &rastan_state::rastan_map);
	m_maincpu->set_vblank_int("screen", FUNC(rastan_state::irq5_line_hold));

	Z80(config, m_audiocpu, XTAL(16'000'000)/4);    /* verified on pcb */
	m_audiocpu->set_addrmap(AS_PROGRAM, &rastan_state::rastan_s_map);

	config.m_minimum_quantum = attotime::from_hz(600);  /* 10 CPU slices per frame - enough for the sound CPU to read all commands */

	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(0));
	screen.set_size(40*8, 32*8);
	screen.set_visarea(0*8, 40*8-1, 1*8, 31*8-1);
	screen.set_screen_update(FUNC(rastan_state::screen_update_rastan));
	screen.set_palette("palette");

	GFXDECODE(config, "gfxdecode", "palette", gfx_rastan);
	PALETTE(config, "palette").set_format(palette_device::xBGR_555, 2048);

	PC080SN(config, m_pc080sn, 0);
	m_pc080sn->set_gfxdecode_tag("gfxdecode");

	PC090OJ(config, m_pc090oj, 0);
	m_pc090oj->set_gfx_region(1);
	m_pc090oj->set_gfxdecode_tag("gfxdecode");
	m_pc090oj->set_palette_tag("palette");

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

	ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(16'000'000)/4));  /* verified on pcb */
	ymsnd.irq_handler().set_inputline(m_audiocpu, 0);
	ymsnd.port_write_handler().set(FUNC(rastan_state::rastan_bankswitch_w));
	ymsnd.add_route(0, "mono", 0.50);
	ymsnd.add_route(1, "mono", 0.50);

	MSM5205(config, m_msm, XTAL(384'000)); /* verified on pcb */
	m_msm->vck_legacy_callback().set(FUNC(rastan_state::rastan_msm5205_vck)); /* VCK function */
	m_msm->set_prescaler_selector(msm5205_device::S48_4B);  /* 8 kHz */
	m_msm->add_route(ALL_OUTPUTS, "mono", 0.60);

	LS157(config, m_adpcm_sel, 0);
	m_adpcm_sel->out_callback().set(m_msm, FUNC(msm5205_device::data_w));

	pc060ha_device &ciu(PC060HA(config, "ciu", 0));
	ciu.set_master_tag(m_maincpu);
	ciu.set_slave_tag(m_audiocpu);
}
Exemple #2
0
void firetrap_state::firetrap(machine_config &config)
{
	/* basic machine hardware */
	Z80(config, m_maincpu, FIRETRAP_XTAL/2);    // 6 MHz
	m_maincpu->set_addrmap(AS_PROGRAM, &firetrap_state::firetrap_map);
	m_maincpu->set_vblank_int("screen", FUNC(firetrap_state::firetrap_irq));

	M6502(config, m_audiocpu, FIRETRAP_XTAL/8); // 1.5 MHz
	m_audiocpu->set_addrmap(AS_PROGRAM, &firetrap_state::sound_map);
	/* IRQs are caused by the ADPCM chip */
	/* NMIs are caused by the main CPU */

	I8751(config, "mcu", XTAL(8'000'000)).set_disable();

	/* video hardware */
	screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
//  screen.set_refresh_hz(57.4034); // PCB measurement
//  screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
//  screen.set_size(32*8, 32*8);
//  screen.set_visarea(0*8, 32*8-1, 1*8, 31*8-1);
	// DECO video CRTC, unverified
	screen.set_raw(FIRETRAP_XTAL/2,384,0,256,272,8,248);
	screen.set_screen_update(FUNC(firetrap_state::screen_update_firetrap));
	screen.set_palette(m_palette);

	GFXDECODE(config, m_gfxdecode, m_palette, gfx_firetrap);
	PALETTE(config, m_palette, FUNC(firetrap_state::firetrap_palette), 256);

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

	GENERIC_LATCH_8(config, m_soundlatch);
	m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI);

	ym3526_device &ymsnd(YM3526(config, "ymsnd", FIRETRAP_XTAL/4));    // 3 MHz
	ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0);

	LS157(config, m_adpcm_select, 0);
	m_adpcm_select->out_callback().set("msm", FUNC(msm5205_device::data_w));

	MSM5205(config, m_msm, FIRETRAP_XTAL/32);   // 375 kHz
	m_msm->vck_callback().set(FUNC(firetrap_state::firetrap_adpcm_int));
	m_msm->set_prescaler_selector(msm5205_device::S48_4B);  /* 7.8125kHz */
	m_msm->add_route(ALL_OUTPUTS, "mono", 0.30);
}