diff --git a/src/devices/bus/a800/atari1050.cpp b/src/devices/bus/a800/atari1050.cpp index 532b19723b7..5ea47f1ec2f 100644 --- a/src/devices/bus/a800/atari1050.cpp +++ b/src/devices/bus/a800/atari1050.cpp @@ -54,17 +54,17 @@ void atari1050_device::mem_map(address_map &map) void atari1050_device::data_out_w(int state) { - m_pia->pb6_w(state); + m_pia->pb_w<6>(state); } void atari1050_device::command_w(int state) { - m_pia->pb7_w(state); + m_pia->pb_w<7>(state); } void atari1050_device::ready_w(int state) { - m_pia->pb1_w(state); + m_pia->pb_w<1>(state); } @@ -93,12 +93,12 @@ void atari1050_device::device_add_mconfig(machine_config &config) m_pia->pa_wr_callback().set(m_fdc, FUNC(wd2793_device::dden_w)).bit(3); //m_pia->pa_wr_callback().append(atari1050_device::motor_control_w)).bit(1); m_pia->pb_wr_callback().set(FUNC(atari1050_device::step_w)); - m_pia->irq_wr_callback().set(m_pia, FUNC(mos6532_new_device::pa6_w)).invert(); + m_pia->irq_wr_callback().set(m_pia, FUNC(mos6532_new_device::pa_w<6>)).invert(); //m_pia->irq_wr_callback().append(m_fdc, FUNC(wd2793_device::ip_w)); WD2793(config, m_fdc, 4_MHz_XTAL / 4); - m_fdc->drq_wr_callback().set(m_pia, FUNC(mos6532_new_device::pa7_w)); - m_fdc->enp_wr_callback().set(m_pia, FUNC(mos6532_new_device::pa4_w)); + m_fdc->drq_wr_callback().set(m_pia, FUNC(mos6532_new_device::pa_w<7>)); + m_fdc->enp_wr_callback().set(m_pia, FUNC(mos6532_new_device::pa_w<4>)); } diff --git a/src/devices/bus/a800/atari810.cpp b/src/devices/bus/a800/atari810.cpp index c3111ea1030..bacb8e90bc3 100644 --- a/src/devices/bus/a800/atari810.cpp +++ b/src/devices/bus/a800/atari810.cpp @@ -52,17 +52,17 @@ void atari810_device::mem_map(address_map &map) void atari810_device::data_out_w(int state) { - m_pia->pb7_w(state); + m_pia->pb_w<7>(state); } void atari810_device::command_w(int state) { - m_pia->pb6_w(state); + m_pia->pb_w<6>(state); } void atari810_device::ready_w(int state) { - m_pia->pb1_w(state); + m_pia->pb_w<1>(state); } @@ -92,8 +92,8 @@ void atari810_device::device_add_mconfig(machine_config &config) //m_pia->irq_wr_callback().set(m_fdc, FUNC(fd1771_device::ip_w)); FD1771(config, m_fdc, 1_MHz_XTAL); - m_fdc->drq_wr_callback().set(m_pia, FUNC(mos6532_new_device::pa7_w)); - m_fdc->intrq_wr_callback().set(m_pia, FUNC(mos6532_new_device::pa6_w)); + m_fdc->drq_wr_callback().set(m_pia, FUNC(mos6532_new_device::pa_w<7>)); + m_fdc->intrq_wr_callback().set(m_pia, FUNC(mos6532_new_device::pa_w<6>)); } diff --git a/src/devices/bus/ieee488/c2040.cpp b/src/devices/bus/ieee488/c2040.cpp index f5dc1cde9da..faaeae24fa2 100644 --- a/src/devices/bus/ieee488/c2040.cpp +++ b/src/devices/bus/ieee488/c2040.cpp @@ -489,7 +489,7 @@ void c2040_device::add_common_devices(machine_config &config) m_miot->pb_rd_callback<3>().set(m_fdc, FUNC(c2040_fdc_device::wps_r)); C2040_FDC(config, m_fdc, XTAL(16'000'000)); - m_fdc->sync_wr_callback().set(m_miot, FUNC(mos6530_new_device::pb6_w)); + m_fdc->sync_wr_callback().set(m_miot, FUNC(mos6530_new_device::pb_w<6>)); m_fdc->ready_wr_callback().set(m_via, FUNC(via6522_device::write_ca1)); m_fdc->error_wr_callback().set(m_via, FUNC(via6522_device::write_cb1)); } @@ -658,7 +658,7 @@ void c2040_device::device_reset() m_miot->reset(); m_via->reset(); - m_riot1->pa7_w(0); + m_riot1->pa_w<7>(0); // turn off spindle motors m_fdc->mtr0_w(1); @@ -674,7 +674,7 @@ void c2040_device::ieee488_atn(int state) { update_ieee_signals(); - m_riot1->pa7_w(!state); + m_riot1->pa_w<7>(!state); } diff --git a/src/devices/bus/ieee488/c8050.cpp b/src/devices/bus/ieee488/c8050.cpp index 2a80bfaa45f..95e069126d4 100644 --- a/src/devices/bus/ieee488/c8050.cpp +++ b/src/devices/bus/ieee488/c8050.cpp @@ -774,7 +774,7 @@ void c8050_device::device_reset() m_miot->reset(); m_via->reset(); - m_riot1->pa7_w(1); + m_riot1->pa_w<7>(1); // turn off spindle motors m_fdc->mtr0_w(1); @@ -790,7 +790,7 @@ void c8050_device::ieee488_atn(int state) { update_ieee_signals(); - m_riot1->pa7_w(state); + m_riot1->pa_w<7>(state); } diff --git a/src/devices/bus/ieee488/c8280.cpp b/src/devices/bus/ieee488/c8280.cpp index 1d9eb476110..b5117025f2b 100644 --- a/src/devices/bus/ieee488/c8280.cpp +++ b/src/devices/bus/ieee488/c8280.cpp @@ -434,7 +434,7 @@ void c8280_device::device_reset() m_riot1->reset(); m_fdc->reset(); - m_riot1->pa7_w(1); + m_riot1->pa_w<7>(1); m_fk5 = 0; m_floppy = nullptr; @@ -451,7 +451,7 @@ void c8280_device::ieee488_atn(int state) { update_ieee_signals(); - m_riot1->pa7_w(state); + m_riot1->pa_w<7>(state); } diff --git a/src/devices/bus/ieee488/d9060.cpp b/src/devices/bus/ieee488/d9060.cpp index 502d97f78e1..0302571c146 100644 --- a/src/devices/bus/ieee488/d9060.cpp +++ b/src/devices/bus/ieee488/d9060.cpp @@ -542,7 +542,7 @@ void d9060_device_base::device_reset() m_hdccpu->set_input_line(M6502_SET_OVERFLOW, ASSERT_LINE); - m_riot1->pa7_w(1); + m_riot1->pa_w<7>(1); } @@ -554,7 +554,7 @@ void d9060_device_base::ieee488_atn(int state) { update_ieee_signals(); - m_riot1->pa7_w(state); + m_riot1->pa_w<7>(state); } diff --git a/src/devices/machine/mos6530n.cpp b/src/devices/machine/mos6530n.cpp index 6cbf5ddb596..dd0560b7a53 100644 --- a/src/devices/machine/mos6530n.cpp +++ b/src/devices/machine/mos6530n.cpp @@ -521,11 +521,9 @@ uint8_t mos6530_device_base::irq_r() { uint8_t data = get_irq_flags(); - if (!machine().side_effects_disabled()) { - if (m_irq_edge) { - m_irq_edge = false; - update_irq(); - } + if (!machine().side_effects_disabled() && m_irq_edge) { + m_irq_edge = false; + update_irq(); } return data; diff --git a/src/devices/machine/mos6530n.h b/src/devices/machine/mos6530n.h index 2d9ba90880c..0434b7f6e3b 100644 --- a/src/devices/machine/mos6530n.h +++ b/src/devices/machine/mos6530n.h @@ -65,33 +65,24 @@ class mos6530_device_base : public device_t { public: - auto irq_wr_callback() { return m_irq_cb.bind(); } + // port byte callbacks auto pa_rd_callback() { return m_in8_pa_cb.bind(); } auto pa_wr_callback() { return m_out8_pa_cb.bind(); } auto pb_rd_callback() { return m_in8_pb_cb.bind(); } auto pb_wr_callback() { return m_out8_pb_cb.bind(); } + + // port bit callbacks template auto pa_rd_callback() { return m_in_pa_cb[N].bind(); } template auto pa_wr_callback() { return m_out_pa_cb[N].bind(); } template auto pb_rd_callback() { return m_in_pb_cb[N].bind(); } template auto pb_wr_callback() { return m_out_pb_cb[N].bind(); } - void pa0_w(int state) { pa_w(0, state); } - void pa1_w(int state) { pa_w(1, state); } - void pa2_w(int state) { pa_w(2, state); } - void pa3_w(int state) { pa_w(3, state); } - void pa4_w(int state) { pa_w(4, state); } - void pa5_w(int state) { pa_w(5, state); } - void pa6_w(int state) { pa_w(6, state); } - void pa7_w(int state) { pa_w(7, state); } + // 6532 _IRQ pin (on 6530 it is PB7) + auto irq_wr_callback() { return m_irq_cb.bind(); } - void pb0_w(int state) { pb_w(0, state); } - void pb1_w(int state) { pb_w(1, state); } - void pb2_w(int state) { pb_w(2, state); } - void pb3_w(int state) { pb_w(3, state); } - void pb4_w(int state) { pb_w(4, state); } - void pb5_w(int state) { pb_w(5, state); } - void pb6_w(int state) { pb_w(6, state); } - void pb7_w(int state) { pb_w(7, state); } + // write to port inputs + template void pa_w(int state) { pa_w(N, state); } + template void pb_w(int state) { pb_w(N, state); } protected: // construction/destruction diff --git a/src/mame/atari/firefox.cpp b/src/mame/atari/firefox.cpp index d9489c26177..e89482a1883 100644 --- a/src/mame/atari/firefox.cpp +++ b/src/mame/atari/firefox.cpp @@ -7,13 +7,13 @@ driver by smf, Aaron Giles, Chris Hardy & Scott Waye -short term: - split driver/vidhrdw/sndhrdw/machine - add option to centre joystick to enter test menu +TODO: +- add option to centre joystick to enter test menu + it uses a quad pokey package 137323-1221-406??? the laser disc is a philips lvp 22vp931 -( but maybe this works too... Special Drive: Laser Disc Player - Philips VP-832A ) +(but maybe this works too... Special Drive: Laser Disc Player - Philips VP-832A) AV# 60626 @@ -29,6 +29,7 @@ but requires a special level III player for proper control. Video: CAV. Audio: A */ #include "emu.h" + #include "cpu/m6809/m6809.h" #include "cpu/m6502/m6502.h" #include "sound/pokey.h" @@ -36,11 +37,12 @@ but requires a special level III player for proper control. Video: CAV. Audio: A #include "machine/74259.h" #include "machine/adc0808.h" #include "machine/ldvp931.h" -#include "machine/6532riot.h" #include "machine/gen_latch.h" +#include "machine/mos6530n.h" #include "machine/timer.h" #include "machine/watchdog.h" #include "machine/x2212.h" + #include "emupal.h" #include "speaker.h" #include "tilemap.h" @@ -60,11 +62,12 @@ public: m_tile_palette(*this, "tile_palette"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), + m_riot(*this, "riot"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_palette(*this, "palette"), - m_soundlatch(*this, "soundlatch"), - m_soundlatch2(*this, "soundlatch2"), + soundlatch(*this, "soundlatch%u", 1U), + m_pokey(*this, "pokey%u", 1U), m_tms(*this, "tms"), m_nvram_1c(*this, "nvram_1c"), m_nvram_1d(*this, "nvram_1d"), @@ -98,8 +101,6 @@ private: void self_reset_w(uint8_t data); void coin_counter_right_w(int state); void coin_counter_left_w(int state); - uint8_t riot_porta_r(); - void riot_porta_w(uint8_t data); TILE_GET_INFO_MEMBER(bgtile_get_info); uint32_t screen_update_firefox(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(video_timer_callback); @@ -119,22 +120,23 @@ private: required_device m_maincpu; required_device m_audiocpu; + required_device m_riot; required_device m_gfxdecode; required_device m_screen; required_device m_palette; - required_device m_soundlatch; - required_device m_soundlatch2; + required_device_array soundlatch; + required_device_array m_pokey; required_device m_tms; required_device m_nvram_1c; required_device m_nvram_1d; required_memory_bank m_mainbank; - int m_n_disc_lock; - int m_n_disc_data; - int m_n_disc_read_data; + int m_n_disc_lock = 0; + int m_n_disc_data = 0; + int m_n_disc_read_data = 0; tilemap_t *m_bgtiles; - int m_sprite_bank; + int m_sprite_bank = 0; }; @@ -335,42 +337,12 @@ void firefox_state::sound_reset_w(int state) m_audiocpu->set_input_line(INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE); if (state != 0) { - m_soundlatch->reset(); - m_soundlatch2->reset(); + soundlatch[0]->reset(); + soundlatch[1]->reset(); } } -/************************************* - * - * 6532 RIOT handlers - * - *************************************/ - -uint8_t firefox_state::riot_porta_r() -{ - /* bit 7 = MAINFLAG */ - /* bit 6 = SOUNDFLAG */ - /* bit 5 = PA5 */ - /* bit 4 = TEST */ - /* bit 3 = n/c */ - /* bit 2 = TMS /ready */ - /* bit 1 = TMS /read */ - /* bit 0 = TMS /write */ - - return (m_soundlatch->pending_r() ? 0x80 : 0x00) | (m_soundlatch2->pending_r() ? 0x40 : 0x00) | 0x10 | (m_tms->readyq_r() << 2); -} - -void firefox_state::riot_porta_w(uint8_t data) -{ - /* handle 5220 read */ - m_tms->rsq_w((data>>1) & 1); - - /* handle 5220 write */ - m_tms->wsq_w(data & 1); -} - - /************************************* * * Non-Volatile RAM (NOVRAM) @@ -445,8 +417,6 @@ void firefox_state::machine_start() m_mainbank->configure_entries(0, 32, memregion("maincpu")->base() + 0x10000, 0x1000); m_laserdisc->set_data_ready_callback(philips_22vp931_device::data_ready_delegate(&firefox_state::firq_gen, this)); - - m_sprite_bank = 0; } @@ -472,7 +442,7 @@ void firefox_state::main_map(address_map &map) map(0x4103, 0x4103).mirror(0x00f8).portr("opt0"); /* OPT0 */ map(0x4104, 0x4104).mirror(0x00f8).portr("opt1"); /* OPT1 */ map(0x4105, 0x4105).mirror(0x00f8).r(FUNC(firefox_state::firefox_disc_data_r)); /* DREAD */ - map(0x4106, 0x4106).mirror(0x00f8).r(m_soundlatch2, FUNC(generic_latch_8_device::read)); /* RDSOUND */ + map(0x4106, 0x4106).mirror(0x00f8).r(soundlatch[1], FUNC(generic_latch_8_device::read)); /* RDSOUND */ map(0x4107, 0x4107).mirror(0x00f8).r("adc", FUNC(adc0808_device::data_r)); /* ADC */ map(0x4200, 0x4200).mirror(0x0047).w(FUNC(firefox_state::main_irq_clear_w)); /* RSTIRQ */ map(0x4208, 0x4208).mirror(0x0047).w(FUNC(firefox_state::main_firq_clear_w)); /* RSTFIRQ */ @@ -483,7 +453,7 @@ void firefox_state::main_map(address_map &map) map(0x4280, 0x4287).mirror(0x0040).w("latch0", FUNC(ls259_device::write_d7)); map(0x4288, 0x428f).mirror(0x0040).w("latch1", FUNC(ls259_device::write_d7)); map(0x4290, 0x4290).mirror(0x0047).w(FUNC(firefox_state::rom_bank_w)); /* WRTREG */ - map(0x4298, 0x4298).mirror(0x0047).w(m_soundlatch, FUNC(generic_latch_8_device::write)); /* WRSOUND */ + map(0x4298, 0x4298).mirror(0x0047).w(soundlatch[0], FUNC(generic_latch_8_device::write)); /* WRSOUND */ map(0x42a0, 0x42a0).mirror(0x0047).w(FUNC(firefox_state::firefox_disc_data_w)); /* DSKLATCH */ map(0x4400, 0xffff).rom(); } @@ -499,14 +469,14 @@ void firefox_state::main_map(address_map &map) void firefox_state::audio_map(address_map &map) { map(0x0000, 0x07ff).ram(); - map(0x0800, 0x087f).mirror(0x0700).ram(); /* RIOT ram */ - map(0x0880, 0x089f).mirror(0x0760).rw("riot", FUNC(riot6532_device::read), FUNC(riot6532_device::write)); - map(0x1000, 0x1000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); - map(0x1800, 0x1800).w(m_soundlatch2, FUNC(generic_latch_8_device::write)); - map(0x2000, 0x200f).rw("pokey1", FUNC(pokey_device::read), FUNC(pokey_device::write)); - map(0x2800, 0x280f).rw("pokey2", FUNC(pokey_device::read), FUNC(pokey_device::write)); - map(0x3000, 0x300f).rw("pokey3", FUNC(pokey_device::read), FUNC(pokey_device::write)); - map(0x3800, 0x380f).rw("pokey4", FUNC(pokey_device::read), FUNC(pokey_device::write)); + map(0x0800, 0x087f).mirror(0x0700).m(m_riot, FUNC(mos6532_new_device::ram_map)); + map(0x0880, 0x089f).mirror(0x0760).m(m_riot, FUNC(mos6532_new_device::io_map)); + map(0x1000, 0x1000).r(soundlatch[0], FUNC(generic_latch_8_device::read)); + map(0x1800, 0x1800).w(soundlatch[1], FUNC(generic_latch_8_device::write)); + map(0x2000, 0x200f).rw(m_pokey[0], FUNC(pokey_device::read), FUNC(pokey_device::write)); + map(0x2800, 0x280f).rw(m_pokey[1], FUNC(pokey_device::read), FUNC(pokey_device::write)); + map(0x3000, 0x300f).rw(m_pokey[2], FUNC(pokey_device::read), FUNC(pokey_device::write)); + map(0x3800, 0x380f).rw(m_pokey[3], FUNC(pokey_device::read), FUNC(pokey_device::write)); map(0x8000, 0xffff).rom(); } @@ -530,10 +500,10 @@ static INPUT_PORTS_START( firefox ) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_START("rdin1") - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch", generic_latch_8_device, pending_r) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch1", generic_latch_8_device, pending_r) PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("soundlatch2", generic_latch_8_device, pending_r) PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Diagnostic Step") // mentioned in schematics, but N/C? PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) @@ -677,37 +647,34 @@ void firefox_state::firefox(machine_config &config) X2212(config, "nvram_1c").set_auto_save(true); X2212(config, "nvram_1d").set_auto_save(true); - riot6532_device &riot(RIOT6532(config, "riot", MASTER_XTAL/8)); - riot.in_pa_callback().set(FUNC(firefox_state::riot_porta_r)); - riot.out_pa_callback().set(FUNC(firefox_state::riot_porta_w)); - riot.in_pb_callback().set("tms", FUNC(tms5220_device::status_r)); - riot.out_pb_callback().set("tms", FUNC(tms5220_device::data_w)); - riot.irq_callback().set_inputline("audiocpu", M6502_IRQ_LINE); + MOS6532_NEW(config, m_riot, MASTER_XTAL/8); + m_riot->pa_wr_callback<0>().set(m_tms, FUNC(tms5220_device::wsq_w)); + m_riot->pa_wr_callback<1>().set(m_tms, FUNC(tms5220_device::rsq_w)); + m_riot->pa_rd_callback<2>().set(m_tms, FUNC(tms5220_device::readyq_r)); + m_riot->pa_rd_callback<4>().set_constant(1); // TEST + m_riot->pa_wr_callback<5>().set_nop(); // TMS5220 VDD + m_riot->pb_rd_callback().set(m_tms, FUNC(tms5220_device::status_r)); + m_riot->pb_wr_callback().set(m_tms, FUNC(tms5220_device::data_w)); + m_riot->irq_wr_callback().set_inputline(m_audiocpu, M6502_IRQ_LINE); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - GENERIC_LATCH_8(config, m_soundlatch); - m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); + GENERIC_LATCH_8(config, soundlatch[0]); + soundlatch[0]->data_pending_callback().set(m_riot, FUNC(mos6532_new_device::pa_w<7>)); // MAINFLAG + soundlatch[0]->data_pending_callback().append_inputline(m_audiocpu, INPUT_LINE_NMI); + soundlatch[0]->data_pending_callback().append([this](int state) { if (state) machine().scheduler().perfect_quantum(attotime::from_usec(100)); }); - GENERIC_LATCH_8(config, m_soundlatch2); + GENERIC_LATCH_8(config, soundlatch[1]); + soundlatch[1]->data_pending_callback().set(m_riot, FUNC(mos6532_new_device::pa_w<6>)); // SOUNDFLAG - pokey_device &pokey1(POKEY(config, "pokey1", MASTER_XTAL/8)); - pokey1.add_route(ALL_OUTPUTS, "lspeaker", 0.30); - pokey1.add_route(ALL_OUTPUTS, "rspeaker", 0.30); - - pokey_device &pokey2(POKEY(config, "pokey2", MASTER_XTAL/8)); - pokey2.add_route(ALL_OUTPUTS, "lspeaker", 0.30); - pokey2.add_route(ALL_OUTPUTS, "rspeaker", 0.30); - - pokey_device &pokey3(POKEY(config, "pokey3", MASTER_XTAL/8)); - pokey3.add_route(ALL_OUTPUTS, "lspeaker", 0.30); - pokey3.add_route(ALL_OUTPUTS, "rspeaker", 0.30); - - pokey_device &pokey4(POKEY(config, "pokey4", MASTER_XTAL/8)); - pokey4.add_route(ALL_OUTPUTS, "lspeaker", 0.30); - pokey4.add_route(ALL_OUTPUTS, "rspeaker", 0.30); + for (int i = 0; i < 4; i++) + { + POKEY(config, m_pokey[i], MASTER_XTAL/8); + m_pokey[i]->add_route(ALL_OUTPUTS, "lspeaker", 0.30); + m_pokey[i]->add_route(ALL_OUTPUTS, "rspeaker", 0.30); + } TMS5220(config, m_tms, MASTER_XTAL/2/11); m_tms->add_route(ALL_OUTPUTS, "lspeaker", 0.75); diff --git a/src/mame/atari/mhavoc.cpp b/src/mame/atari/mhavoc.cpp index df17d43e040..0b015610c6b 100644 --- a/src/mame/atari/mhavoc.cpp +++ b/src/mame/atari/mhavoc.cpp @@ -586,6 +586,13 @@ int mhavoc_state::alpha_xmtd_r() return m_alpha_xmtd; } +int alphaone_state::clock_r() +{ + // 2.4kHz (divide 2.5MHz by 1024) + return (m_alpha->total_cycles() & 0x400) ? 0 : 1; +} + + /************************************* * * Output ports @@ -646,6 +653,7 @@ void mhavoc_state::out_1_w(uint8_t data) machine().bookkeeping().coin_counter_w(1, data & 0x01); } + /************************************* * * Speech access @@ -848,40 +856,21 @@ void alphaone_state::alpha_map(address_map &map) * *************************************/ -int alphaone_state::clock_r() -{ - // 2.4kHz (divide 2.5MHz by 1024) - return (m_alpha->total_cycles() & 0x400) ? 0 : 1; -} - - -/* 2008-08 FP: - IN0 Bit 4 is tested in the second input test, but it's not clear its effect. - According to the memory map at top it should be Diagnostic Step, but it's - actually IN0 Bit 5 to have this function. I marked it as UNKNOWN for the moment */ static INPUT_PORTS_START( mhavoc ) PORT_START("IN0") // alpha - // Bits 7-6 = selected based on player_1 - // Bits 5-4 = common - // Bit 3 = Gamma rcvd flag - // Bit 2 = Gamma xmtd flag - // Bit 1 = 2.4kHz (divide 2.5MHz by 1024) - // Bit 0 = Vector generator halt flag PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("avg", avg_device, done_r) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(mhavoc_state, clock_r) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(mhavoc_state, gamma_xmtd_r) PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(mhavoc_state, gamma_rcvd_r) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Diag Step/Coin C") PORT_CODE(KEYCODE_F1) - PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mhavoc_state, coin_service_r) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Diagnostic Step") // mentioned in schematics, but N/C? + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(mhavoc_state, coin_service_r) // selected based on player_1 PORT_START("IN1") // gamma - // Bits 7-2 = input switches - // Bit 1 = Alpha rcvd flag - // Bit 0 = Alpha xmtd flag PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(mhavoc_state, alpha_xmtd_r) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(mhavoc_state, alpha_rcvd_r) - PORT_BIT( 0x0c, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) // TIRDY, this pcb does not have a TMS5200 + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) @@ -950,7 +939,6 @@ static INPUT_PORTS_START( mhavocrv ) PORT_MODIFY("IN1") PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("tms", tms5220_device, readyq_r) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END static INPUT_PORTS_START( mhavocp ) diff --git a/src/mame/atari/starwars.cpp b/src/mame/atari/starwars.cpp index e099a5af390..4a2f2bc5661 100644 --- a/src/mame/atari/starwars.cpp +++ b/src/mame/atari/starwars.cpp @@ -181,7 +181,7 @@ static INPUT_PORTS_START( starwars ) PORT_START("IN1") PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Diagnostic Step") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Diagnostic Step") // mentioned in schematics, but N/C? PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) @@ -293,10 +293,10 @@ void starwars_state::starwars(machine_config &config) m_riot->pa_rd_callback<2>().set(m_tms, FUNC(tms5220_device::readyq_r)); m_riot->pa_wr_callback<3>().set_nop(); // hold main CPU in reset? + enable delay circuit? m_riot->pa_rd_callback<4>().set_constant(1); // not sound self test - m_riot->pa_wr_callback<5>().set_nop(); // mute speech - m_riot->pb_rd_callback().set("tms", FUNC(tms5220_device::status_r)); - m_riot->pb_wr_callback().set("tms", FUNC(tms5220_device::data_w)); - m_riot->irq_wr_callback().set_inputline("audiocpu", M6809_IRQ_LINE); + m_riot->pa_wr_callback<5>().set_nop(); // TMS5220 VDD + m_riot->pb_rd_callback().set(m_tms, FUNC(tms5220_device::status_r)); + m_riot->pb_wr_callback().set(m_tms, FUNC(tms5220_device::data_w)); + m_riot->irq_wr_callback().set_inputline(m_audiocpu, M6809_IRQ_LINE); X2212(config, "x2212").set_auto_save(true); /* nvram */ @@ -333,11 +333,11 @@ void starwars_state::starwars(machine_config &config) TMS5220(config, m_tms, MASTER_CLOCK/2/9).add_route(ALL_OUTPUTS, "mono", 0.50); GENERIC_LATCH_8(config, m_soundlatch); - m_soundlatch->data_pending_callback().set(m_riot, FUNC(mos6532_new_device::pa7_w)); + m_soundlatch->data_pending_callback().set(m_riot, FUNC(mos6532_new_device::pa_w<7>)); m_soundlatch->data_pending_callback().append([this](int state) { if (state) machine().scheduler().perfect_quantum(attotime::from_usec(100)); }); GENERIC_LATCH_8(config, m_mainlatch); - m_mainlatch->data_pending_callback().set(m_riot, FUNC(mos6532_new_device::pa6_w)); + m_mainlatch->data_pending_callback().set(m_riot, FUNC(mos6532_new_device::pa_w<6>)); m_mainlatch->data_pending_callback().append([this](int state) { if (state) machine().scheduler().perfect_quantum(attotime::from_usec(100)); }); } diff --git a/src/mame/shared/exidysound.cpp b/src/mame/shared/exidysound.cpp index 35464fd5248..e1bf6df9e7a 100644 --- a/src/mame/shared/exidysound.cpp +++ b/src/mame/shared/exidysound.cpp @@ -717,7 +717,7 @@ void mtrap_sound_device::voiceio_w(offs_t offset, uint8_t data) m_cvsd->digit_w(data & 1); if (!(offset & 0x20)) - m_riot->pb0_w(data & 1); + m_riot->pb_w<0>(data & 1); } diff --git a/src/mame/taito/changela.cpp b/src/mame/taito/changela.cpp index 7d2d03ba4c9..df9e1430265 100644 --- a/src/mame/taito/changela.cpp +++ b/src/mame/taito/changela.cpp @@ -218,10 +218,10 @@ void changela_state::machine_reset() void changela_state::video_start() { - m_riverram = std::make_unique(0x800); + m_riverram = make_unique_clear(0x800); save_pointer(NAME(m_riverram), 0x800); - m_treeram = std::make_unique(0x800); + m_treeram = make_unique_clear(0x800); save_pointer(NAME(m_treeram), 0x800); m_screen->register_screen_bitmap(m_obj0_bitmap);