From d18f2469acc101230f1d7486962a1a6471172b0e Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 25 Jul 2023 20:51:08 +0200 Subject: mos6530n(ew): rename to mos6530 --- scripts/src/machine.lua | 6 +- src/devices/bus/a800/atari1050.cpp | 12 +- src/devices/bus/a800/atari1050.h | 4 +- src/devices/bus/a800/atari810.cpp | 10 +- src/devices/bus/a800/atari810.h | 4 +- src/devices/bus/c64/buscard2.cpp | 2 +- src/devices/bus/c64/buscard2.h | 4 +- src/devices/bus/cbmiec/interpod.cpp | 6 +- src/devices/bus/cbmiec/interpod.h | 4 +- src/devices/bus/ieee488/c2040.cpp | 20 +- src/devices/bus/ieee488/c2040.h | 8 +- src/devices/bus/ieee488/c8050.cpp | 28 +- src/devices/bus/ieee488/c8050.h | 8 +- src/devices/bus/ieee488/c8280.cpp | 12 +- src/devices/bus/ieee488/c8280.h | 6 +- src/devices/bus/ieee488/d9060.cpp | 12 +- src/devices/bus/ieee488/d9060.h | 6 +- src/devices/machine/mos6530.cpp | 594 ++++++++++++++++++++++++++++++++++++ src/devices/machine/mos6530.h | 207 +++++++++++++ src/devices/machine/mos6530n.cpp | 594 ------------------------------------ src/devices/machine/mos6530n.h | 207 ------------- src/mame/alliedleisure/killcom.cpp | 6 +- src/mame/alliedleisure/killcom.h | 4 +- src/mame/atari/a2600.cpp | 10 +- src/mame/atari/a7800.cpp | 10 +- src/mame/atari/firefox.cpp | 14 +- src/mame/atari/starwars.cpp | 10 +- src/mame/atari/starwars.h | 4 +- src/mame/atari/tomcat.cpp | 8 +- src/mame/atari/tourtabl.cpp | 16 +- src/mame/commodore/chessmate.cpp | 12 +- src/mame/commodore/kim1.cpp | 20 +- src/mame/elektor/junior.cpp | 10 +- src/mame/pinball/allied.cpp | 28 +- src/mame/pinball/gts80.cpp | 24 +- src/mame/pinball/gts80a.cpp | 24 +- src/mame/pinball/gts80b.cpp | 38 +-- src/mame/pinball/spectra.cpp | 10 +- src/mame/pitronics/beta.cpp | 8 +- src/mame/rockwell/aim65.cpp | 6 +- src/mame/rockwell/aim65.h | 4 +- src/mame/shared/exidysound.cpp | 12 +- src/mame/shared/exidysound.h | 4 +- src/mame/shared/gottlieb_a.cpp | 14 +- src/mame/shared/gottlieb_a.h | 6 +- src/mame/synertek/sym1.cpp | 6 +- 46 files changed, 1031 insertions(+), 1031 deletions(-) create mode 100644 src/devices/machine/mos6530.cpp create mode 100644 src/devices/machine/mos6530.h delete mode 100644 src/devices/machine/mos6530n.cpp delete mode 100644 src/devices/machine/mos6530n.h diff --git a/scripts/src/machine.lua b/scripts/src/machine.lua index 666a2400a86..339957e31ee 100644 --- a/scripts/src/machine.lua +++ b/scripts/src/machine.lua @@ -2544,13 +2544,13 @@ end --------------------------------------------------- -- ---@src/devices/machine/mos6530n.h,MACHINES["MOS6530"] = true +--@src/devices/machine/mos6530.h,MACHINES["MOS6530"] = true --------------------------------------------------- if (MACHINES["MOS6530"]~=null) then files { - MAME_DIR .. "src/devices/machine/mos6530n.cpp", - MAME_DIR .. "src/devices/machine/mos6530n.h", + MAME_DIR .. "src/devices/machine/mos6530.cpp", + MAME_DIR .. "src/devices/machine/mos6530.h", } end diff --git a/src/devices/bus/a800/atari1050.cpp b/src/devices/bus/a800/atari1050.cpp index 10a482e84f7..dec666b0b6b 100644 --- a/src/devices/bus/a800/atari1050.cpp +++ b/src/devices/bus/a800/atari1050.cpp @@ -45,8 +45,8 @@ void atari1050_device::step_w(u8 data) void atari1050_device::mem_map(address_map &map) { map(0x0000, 0x007f).mirror(0x0900).ram(); // MCM6810 - map(0x0080, 0x00ff).mirror(0x0900).m(m_pia, FUNC(mos6532_new_device::ram_map)); - map(0x0280, 0x029f).mirror(0x0960).m(m_pia, FUNC(mos6532_new_device::io_map)); + map(0x0080, 0x00ff).mirror(0x0900).m(m_pia, FUNC(mos6532_device::ram_map)); + map(0x0280, 0x029f).mirror(0x0960).m(m_pia, FUNC(mos6532_device::io_map)); map(0x0400, 0x0403).mirror(0x0bfc).rw(m_fdc, FUNC(wd2793_device::read), FUNC(wd2793_device::write)); map(0x1000, 0x1fff).rom().region("rom", 0); } @@ -88,17 +88,17 @@ void atari1050_device::device_add_mconfig(machine_config &config) m6507_device &fdcpu(M6507(config, "fdcpu", 4_MHz_XTAL / 4)); fdcpu.set_addrmap(AS_PROGRAM, &atari1050_device::mem_map); - MOS6532_NEW(config, m_pia, 4_MHz_XTAL / 4); + MOS6532(config, m_pia, 4_MHz_XTAL / 4); m_pia->pa_rd_callback().set_ioport("SELECT"); 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::pa_bit_w<6>)).invert(); + m_pia->irq_wr_callback().set(m_pia, FUNC(mos6532_device::pa_bit_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::pa_bit_w<7>)); - m_fdc->enp_wr_callback().set(m_pia, FUNC(mos6532_new_device::pa_bit_w<4>)); + m_fdc->drq_wr_callback().set(m_pia, FUNC(mos6532_device::pa_bit_w<7>)); + m_fdc->enp_wr_callback().set(m_pia, FUNC(mos6532_device::pa_bit_w<4>)); } diff --git a/src/devices/bus/a800/atari1050.h b/src/devices/bus/a800/atari1050.h index 6605d05e6a4..5c2c1243b7b 100644 --- a/src/devices/bus/a800/atari1050.h +++ b/src/devices/bus/a800/atari1050.h @@ -12,7 +12,7 @@ #pragma once #include "a8sio.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "machine/wd_fdc.h" @@ -38,7 +38,7 @@ private: void mem_map(address_map &map); - required_device m_pia; + required_device m_pia; required_device m_fdc; }; diff --git a/src/devices/bus/a800/atari810.cpp b/src/devices/bus/a800/atari810.cpp index bc130bfcb38..62118335376 100644 --- a/src/devices/bus/a800/atari810.cpp +++ b/src/devices/bus/a800/atari810.cpp @@ -44,8 +44,8 @@ void atari810_device::mem_map(address_map &map) { map(0x0000, 0x0003).mirror(0x167c).rw(m_fdc, FUNC(fd1771_device::read), FUNC(fd1771_device::write)); map(0x0080, 0x00ff).mirror(0x1400).ram(); // MCM6810 - map(0x0100, 0x017f).mirror(0x1480).m(m_pia, FUNC(mos6532_new_device::ram_map)); - map(0x0300, 0x031f).mirror(0x14e0).m(m_pia, FUNC(mos6532_new_device::io_map)); + map(0x0100, 0x017f).mirror(0x1480).m(m_pia, FUNC(mos6532_device::ram_map)); + map(0x0300, 0x031f).mirror(0x14e0).m(m_pia, FUNC(mos6532_device::io_map)); map(0x0800, 0x0fff).mirror(0x1000).rom().region("rom", 0); } @@ -86,14 +86,14 @@ void atari810_device::device_add_mconfig(machine_config &config) m6507_device &fdcpu(M6507(config, "fdcpu", 1_MHz_XTAL / 2)); fdcpu.set_addrmap(AS_PROGRAM, &atari810_device::mem_map); - MOS6532_NEW(config, m_pia, 1_MHz_XTAL / 2); + MOS6532(config, m_pia, 1_MHz_XTAL / 2); m_pia->pa_rd_callback().set_ioport("SELECT"); m_pia->pb_wr_callback().set(FUNC(atari810_device::step_w)); //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::pa_bit_w<7>)); - m_fdc->intrq_wr_callback().set(m_pia, FUNC(mos6532_new_device::pa_bit_w<6>)); + m_fdc->drq_wr_callback().set(m_pia, FUNC(mos6532_device::pa_bit_w<7>)); + m_fdc->intrq_wr_callback().set(m_pia, FUNC(mos6532_device::pa_bit_w<6>)); } diff --git a/src/devices/bus/a800/atari810.h b/src/devices/bus/a800/atari810.h index 983161a3d2f..3406c14fdf0 100644 --- a/src/devices/bus/a800/atari810.h +++ b/src/devices/bus/a800/atari810.h @@ -12,7 +12,7 @@ #pragma once #include "a8sio.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "machine/wd_fdc.h" @@ -38,7 +38,7 @@ private: void mem_map(address_map &map); - required_device m_pia; + required_device m_pia; required_device m_fdc; }; diff --git a/src/devices/bus/c64/buscard2.cpp b/src/devices/bus/c64/buscard2.cpp index b6e8cf27ea7..799eee69299 100644 --- a/src/devices/bus/c64/buscard2.cpp +++ b/src/devices/bus/c64/buscard2.cpp @@ -130,7 +130,7 @@ ioport_constructor c64_buscard2_device::device_input_ports() const void c64_buscard2_device::device_add_mconfig(machine_config &config) { - MOS6532_NEW(config, m_riot, 0); + MOS6532(config, m_riot, 0); PIA6821(config, m_pia, 0); diff --git a/src/devices/bus/c64/buscard2.h b/src/devices/bus/c64/buscard2.h index 71621a4295e..233cdaf79d8 100644 --- a/src/devices/bus/c64/buscard2.h +++ b/src/devices/bus/c64/buscard2.h @@ -16,7 +16,7 @@ #include "bus/centronics/ctronics.h" #include "bus/ieee488/ieee488.h" #include "machine/6821pia.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" @@ -50,7 +50,7 @@ protected: virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw) override; private: - required_device m_riot; + required_device m_riot; required_device m_pia; required_device m_bus; required_device m_centronics; diff --git a/src/devices/bus/cbmiec/interpod.cpp b/src/devices/bus/cbmiec/interpod.cpp index c5479a30b18..b256f42de19 100644 --- a/src/devices/bus/cbmiec/interpod.cpp +++ b/src/devices/bus/cbmiec/interpod.cpp @@ -111,8 +111,8 @@ const tiny_rom_entry *cbm_interpod_device::device_rom_region() const void cbm_interpod_device::interpod_mem(address_map &map) { - map(0x0000, 0x007f).mirror(0x3b80).m(m_riot, FUNC(mos6532_new_device::ram_map)); - map(0x0400, 0x041f).mirror(0x3be0).m(m_riot, FUNC(mos6532_new_device::io_map)); + map(0x0000, 0x007f).mirror(0x3b80).m(m_riot, FUNC(mos6532_device::ram_map)); + map(0x0400, 0x041f).mirror(0x3be0).m(m_riot, FUNC(mos6532_device::io_map)); map(0x2000, 0x2001).mirror(0x9ffe).rw(m_acia, FUNC(acia6850_device::read), FUNC(acia6850_device::write)); map(0x4000, 0x47ff).mirror(0xb800).rom().region(R6502_TAG, 0); map(0x8000, 0x800f).mirror(0x5ff0).m(m_via, FUNC(via6522_device::map)); @@ -130,7 +130,7 @@ void cbm_interpod_device::device_add_mconfig(machine_config &config) MOS6522(config, m_via, 1000000); - MOS6532_NEW(config, m_riot, 1000000); + MOS6532(config, m_riot, 1000000); ACIA6850(config, m_acia, 0); diff --git a/src/devices/bus/cbmiec/interpod.h b/src/devices/bus/cbmiec/interpod.h index 823ab0c64e7..7278ed68c1a 100644 --- a/src/devices/bus/cbmiec/interpod.h +++ b/src/devices/bus/cbmiec/interpod.h @@ -16,7 +16,7 @@ #include "bus/ieee488/ieee488.h" #include "cpu/m6502/m6502.h" #include "machine/6522via.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "machine/6850acia.h" @@ -46,7 +46,7 @@ protected: private: required_device m_maincpu; required_device m_via; - required_device m_riot; + required_device m_riot; required_device m_acia; required_device m_ieee; required_device m_rs232; diff --git a/src/devices/bus/ieee488/c2040.cpp b/src/devices/bus/ieee488/c2040.cpp index cafc1e3d44a..8cf6ca58d57 100644 --- a/src/devices/bus/ieee488/c2040.cpp +++ b/src/devices/bus/ieee488/c2040.cpp @@ -171,10 +171,10 @@ const tiny_rom_entry *c4040_device::device_rom_region() const void c2040_device::c2040_main_mem(address_map &map) { map.global_mask(0x7fff); - map(0x0000, 0x007f).mirror(0x0100).m(M6532_0_TAG, FUNC(mos6532_new_device::ram_map)); - map(0x0080, 0x00ff).mirror(0x0100).m(M6532_1_TAG, FUNC(mos6532_new_device::ram_map)); - map(0x0200, 0x021f).mirror(0x0d60).m(M6532_0_TAG, FUNC(mos6532_new_device::io_map)); - map(0x0280, 0x029f).mirror(0x0d60).m(M6532_1_TAG, FUNC(mos6532_new_device::io_map)); + map(0x0000, 0x007f).mirror(0x0100).m(M6532_0_TAG, FUNC(mos6532_device::ram_map)); + map(0x0080, 0x00ff).mirror(0x0100).m(M6532_1_TAG, FUNC(mos6532_device::ram_map)); + map(0x0200, 0x021f).mirror(0x0d60).m(M6532_0_TAG, FUNC(mos6532_device::io_map)); + map(0x0280, 0x029f).mirror(0x0d60).m(M6532_1_TAG, FUNC(mos6532_device::io_map)); map(0x1000, 0x13ff).mirror(0x0c00).ram().share("share1"); map(0x2000, 0x23ff).mirror(0x0c00).ram().share("share2"); map(0x3000, 0x33ff).mirror(0x0c00).ram().share("share3"); @@ -190,9 +190,9 @@ void c2040_device::c2040_main_mem(address_map &map) void c2040_device::c2040_fdc_mem(address_map &map) { map.global_mask(0x1fff); - map(0x0000, 0x003f).mirror(0x0300).m(M6530_TAG, FUNC(mos6530_new_device::ram_map)); + map(0x0000, 0x003f).mirror(0x0300).m(M6530_TAG, FUNC(mos6530_device::ram_map)); map(0x0040, 0x004f).mirror(0x0330).m(M6522_TAG, FUNC(via6522_device::map)); - map(0x0080, 0x008f).mirror(0x0330).m(M6530_TAG, FUNC(mos6530_new_device::io_map)); + map(0x0080, 0x008f).mirror(0x0330).m(M6530_TAG, FUNC(mos6530_device::io_map)); map(0x0400, 0x07ff).ram().share("share1"); map(0x0800, 0x0bff).ram().share("share2"); map(0x0c00, 0x0fff).ram().share("share3"); @@ -459,11 +459,11 @@ void c2040_device::add_common_devices(machine_config &config) M6502(config, m_maincpu, XTAL(16'000'000)/16); m_maincpu->set_addrmap(AS_PROGRAM, &c2040_device::c2040_main_mem); - MOS6532_NEW(config, m_riot0, XTAL(16'000'000)/16); + MOS6532(config, m_riot0, XTAL(16'000'000)/16); m_riot0->pa_rd_callback().set(FUNC(c2040_device::dio_r)); m_riot0->pb_wr_callback().set(FUNC(c2040_device::dio_w)); - MOS6532_NEW(config, m_riot1, XTAL(16'000'000)/16); + MOS6532(config, m_riot1, XTAL(16'000'000)/16); m_riot1->pa_rd_callback().set(FUNC(c2040_device::riot1_pa_r)); m_riot1->pa_wr_callback().set(FUNC(c2040_device::riot1_pa_w)); m_riot1->pb_rd_callback().set(FUNC(c2040_device::riot1_pb_r)); @@ -480,7 +480,7 @@ void c2040_device::add_common_devices(machine_config &config) m_via->ca2_handler().set(m_fdc, FUNC(c2040_fdc_device::mode_sel_w)); m_via->cb2_handler().set(m_fdc, FUNC(c2040_fdc_device::rw_sel_w)); - MOS6530_NEW(config, m_miot, XTAL(16'000'000)/16); + MOS6530(config, m_miot, XTAL(16'000'000)/16); m_miot->pa_wr_callback().set(m_fdc, FUNC(c2040_fdc_device::write)); m_miot->pb_wr_callback<0>().set(m_fdc, FUNC(c2040_fdc_device::drv_sel_w)); m_miot->pb_wr_callback<1>().set(m_fdc, FUNC(c2040_fdc_device::ds0_w)); @@ -489,7 +489,7 @@ void c2040_device::add_common_devices(machine_config &config) m_miot->irq_wr_callback().set_inputline(m_fdccpu, M6502_IRQ_LINE); C2040_FDC(config, m_fdc, XTAL(16'000'000)); - m_fdc->sync_wr_callback().set(m_miot, FUNC(mos6530_new_device::pb_bit_w<6>)); + m_fdc->sync_wr_callback().set(m_miot, FUNC(mos6530_device::pb_bit_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)); } diff --git a/src/devices/bus/ieee488/c2040.h b/src/devices/bus/ieee488/c2040.h index 41f4f4f967e..010f055d392 100644 --- a/src/devices/bus/ieee488/c2040.h +++ b/src/devices/bus/ieee488/c2040.h @@ -16,7 +16,7 @@ #include "cpu/m6502/m6502.h" #include "cpu/m6502/m6504.h" #include "machine/6522via.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" @@ -73,9 +73,9 @@ protected: required_device m_maincpu; required_device m_fdccpu; - required_device m_riot0; - required_device m_riot1; - required_device m_miot; + required_device m_riot0; + required_device m_riot1; + required_device m_miot; required_device m_via; required_device m_floppy0; optional_device m_floppy1; diff --git a/src/devices/bus/ieee488/c8050.cpp b/src/devices/bus/ieee488/c8050.cpp index 6fe75a0129f..08d55f2cbdc 100644 --- a/src/devices/bus/ieee488/c8050.cpp +++ b/src/devices/bus/ieee488/c8050.cpp @@ -187,10 +187,10 @@ const tiny_rom_entry *sfd1001_device::device_rom_region() const void c8050_device::c8050_main_mem(address_map &map) { - map(0x0000, 0x007f).mirror(0x0100).m(M6532_0_TAG, FUNC(mos6532_new_device::ram_map)); - map(0x0080, 0x00ff).mirror(0x0100).m(M6532_1_TAG, FUNC(mos6532_new_device::ram_map)); - map(0x0200, 0x021f).mirror(0x0d60).m(M6532_0_TAG, FUNC(mos6532_new_device::io_map)); - map(0x0280, 0x029f).mirror(0x0d60).m(M6532_1_TAG, FUNC(mos6532_new_device::io_map)); + map(0x0000, 0x007f).mirror(0x0100).m(M6532_0_TAG, FUNC(mos6532_device::ram_map)); + map(0x0080, 0x00ff).mirror(0x0100).m(M6532_1_TAG, FUNC(mos6532_device::ram_map)); + map(0x0200, 0x021f).mirror(0x0d60).m(M6532_0_TAG, FUNC(mos6532_device::io_map)); + map(0x0280, 0x029f).mirror(0x0d60).m(M6532_1_TAG, FUNC(mos6532_device::io_map)); map(0x1000, 0x13ff).mirror(0x0c00).ram().share("share1"); map(0x2000, 0x23ff).mirror(0x0c00).ram().share("share2"); map(0x3000, 0x33ff).mirror(0x0c00).ram().share("share3"); @@ -206,14 +206,14 @@ void c8050_device::c8050_main_mem(address_map &map) void c8050_device::c8050_fdc_mem(address_map &map) { map.global_mask(0x1fff); - map(0x0000, 0x003f).mirror(0x0300).m(m_miot, FUNC(mos6530_new_device::ram_map)); + map(0x0000, 0x003f).mirror(0x0300).m(m_miot, FUNC(mos6530_device::ram_map)); map(0x0040, 0x004f).mirror(0x0330).m(m_via, FUNC(via6522_device::map)); - map(0x0080, 0x008f).mirror(0x0330).m(m_miot, FUNC(mos6530_new_device::io_map)); + map(0x0080, 0x008f).mirror(0x0330).m(m_miot, FUNC(mos6530_device::io_map)); map(0x0400, 0x07ff).ram().share("share1"); map(0x0800, 0x0bff).ram().share("share2"); map(0x0c00, 0x0fff).ram().share("share3"); map(0x1000, 0x13ff).ram().share("share4"); - map(0x1c00, 0x1fff).m(m_miot, FUNC(mos6530_new_device::rom_map)); + map(0x1c00, 0x1fff).m(m_miot, FUNC(mos6530_device::rom_map)); } @@ -224,9 +224,9 @@ void c8050_device::c8050_fdc_mem(address_map &map) void c8050_device::c8250lp_fdc_mem(address_map &map) { map.global_mask(0x1fff); - map(0x0000, 0x003f).mirror(0x0300).m(m_miot, FUNC(mos6530_new_device::ram_map)); + map(0x0000, 0x003f).mirror(0x0300).m(m_miot, FUNC(mos6530_device::ram_map)); map(0x0040, 0x004f).mirror(0x0330).m(m_via, FUNC(via6522_device::map)); - map(0x0080, 0x008f).mirror(0x0330).m(m_miot, FUNC(mos6530_new_device::io_map)); + map(0x0080, 0x008f).mirror(0x0330).m(m_miot, FUNC(mos6530_device::io_map)); map(0x0400, 0x07ff).ram().share("share1"); map(0x0800, 0x0bff).ram().share("share2"); map(0x0c00, 0x0fff).ram().share("share3"); @@ -242,9 +242,9 @@ void c8050_device::c8250lp_fdc_mem(address_map &map) void c8050_device::sfd1001_fdc_mem(address_map &map) { map.global_mask(0x1fff); - map(0x0000, 0x003f).mirror(0x0300).m(m_miot, FUNC(mos6530_new_device::ram_map)); + map(0x0000, 0x003f).mirror(0x0300).m(m_miot, FUNC(mos6530_device::ram_map)); map(0x0040, 0x004f).mirror(0x0330).m(m_via, FUNC(via6522_device::map)); - map(0x0080, 0x008f).mirror(0x0330).m(m_miot, FUNC(mos6530_new_device::io_map)); + map(0x0080, 0x008f).mirror(0x0330).m(m_miot, FUNC(mos6530_device::io_map)); map(0x0400, 0x07ff).ram().share("share1"); map(0x0800, 0x0bff).ram().share("share2"); map(0x0c00, 0x0fff).ram().share("share3"); @@ -538,11 +538,11 @@ void c8050_device::add_common_devices(machine_config &config) M6502(config, m_maincpu, XTAL(12'000'000)/12); m_maincpu->set_addrmap(AS_PROGRAM, &c8050_device::c8050_main_mem); - MOS6532_NEW(config, m_riot0, XTAL(12'000'000)/12); + MOS6532(config, m_riot0, XTAL(12'000'000)/12); m_riot0->pa_rd_callback().set(FUNC(c8050_device::dio_r)); m_riot0->pb_wr_callback().set(FUNC(c8050_device::dio_w)); - MOS6532_NEW(config, m_riot1, XTAL(12'000'000)/12); + MOS6532(config, m_riot1, XTAL(12'000'000)/12); m_riot1->pa_rd_callback().set(FUNC(c8050_device::riot1_pa_r)); m_riot1->pa_wr_callback().set(FUNC(c8050_device::riot1_pa_w)); m_riot1->pb_rd_callback().set(FUNC(c8050_device::riot1_pb_r)); @@ -558,7 +558,7 @@ void c8050_device::add_common_devices(machine_config &config) m_via->ca2_handler().set(m_fdc, FUNC(c8050_fdc_device::mode_sel_w)); m_via->cb2_handler().set(m_fdc, FUNC(c8050_fdc_device::rw_sel_w)); - MOS6530_NEW(config, m_miot, XTAL(12'000'000)/12); + MOS6530(config, m_miot, XTAL(12'000'000)/12); m_miot->pa_wr_callback().set(m_fdc, FUNC(c8050_fdc_device::write)); m_miot->pb_wr_callback<1>().set(m_fdc, FUNC(c8050_fdc_device::ds0_w)); m_miot->pb_wr_callback<2>().set(m_fdc, FUNC(c8050_fdc_device::ds1_w)); diff --git a/src/devices/bus/ieee488/c8050.h b/src/devices/bus/ieee488/c8050.h index a8047617408..3277444e37a 100644 --- a/src/devices/bus/ieee488/c8050.h +++ b/src/devices/bus/ieee488/c8050.h @@ -16,7 +16,7 @@ #include "cpu/m6502/m6502.h" #include "cpu/m6502/m6504.h" #include "machine/6522via.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" @@ -65,9 +65,9 @@ protected: required_device m_maincpu; required_device m_fdccpu; - required_device m_riot0; - required_device m_riot1; - required_device m_miot; + required_device m_riot0; + required_device m_riot1; + required_device m_miot; required_device m_via; required_device m_floppy0; optional_device m_floppy1; diff --git a/src/devices/bus/ieee488/c8280.cpp b/src/devices/bus/ieee488/c8280.cpp index 83f33f148c6..bf6db655e33 100644 --- a/src/devices/bus/ieee488/c8280.cpp +++ b/src/devices/bus/ieee488/c8280.cpp @@ -76,10 +76,10 @@ const tiny_rom_entry *c8280_device::device_rom_region() const void c8280_device::c8280_main_mem(address_map &map) { - map(0x0000, 0x007f).mirror(0x100).m(M6532_0_TAG, FUNC(mos6532_new_device::ram_map)); - map(0x0080, 0x00ff).mirror(0x100).m(M6532_1_TAG, FUNC(mos6532_new_device::ram_map)); - map(0x0200, 0x021f).mirror(0xd60).m(M6532_0_TAG, FUNC(mos6532_new_device::io_map)); - map(0x0280, 0x029f).mirror(0xd60).m(M6532_1_TAG, FUNC(mos6532_new_device::io_map)); + map(0x0000, 0x007f).mirror(0x100).m(M6532_0_TAG, FUNC(mos6532_device::ram_map)); + map(0x0080, 0x00ff).mirror(0x100).m(M6532_1_TAG, FUNC(mos6532_device::ram_map)); + map(0x0200, 0x021f).mirror(0xd60).m(M6532_0_TAG, FUNC(mos6532_device::io_map)); + map(0x0280, 0x029f).mirror(0xd60).m(M6532_1_TAG, FUNC(mos6532_device::io_map)); map(0x1000, 0x13ff).mirror(0xc00).ram().share("share1"); map(0x2000, 0x23ff).mirror(0xc00).ram().share("share2"); map(0x3000, 0x33ff).mirror(0xc00).ram().share("share3"); @@ -300,11 +300,11 @@ void c8280_device::device_add_mconfig(machine_config &config) M6502(config, m_maincpu, XTAL(12'000'000)/8); m_maincpu->set_addrmap(AS_PROGRAM, &c8280_device::c8280_main_mem); - MOS6532_NEW(config, m_riot0, XTAL(12'000'000)/8); + MOS6532(config, m_riot0, XTAL(12'000'000)/8); m_riot0->pa_rd_callback().set(FUNC(c8280_device::dio_r)); m_riot0->pb_wr_callback().set(FUNC(c8280_device::dio_w)); - MOS6532_NEW(config, m_riot1, XTAL(12'000'000)/8); + MOS6532(config, m_riot1, XTAL(12'000'000)/8); m_riot1->pa_rd_callback().set(FUNC(c8280_device::riot1_pa_r)); m_riot1->pa_wr_callback().set(FUNC(c8280_device::riot1_pa_w)); m_riot1->pb_rd_callback().set(FUNC(c8280_device::riot1_pb_r)); diff --git a/src/devices/bus/ieee488/c8280.h b/src/devices/bus/ieee488/c8280.h index 1317a6c13f7..4bef271836a 100644 --- a/src/devices/bus/ieee488/c8280.h +++ b/src/devices/bus/ieee488/c8280.h @@ -15,7 +15,7 @@ #include "cpu/m6502/m6502.h" #include "formats/c8280_dsk.h" #include "imagedev/floppy.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "machine/wd_fdc.h" @@ -65,8 +65,8 @@ private: required_device m_maincpu; required_device m_fdccpu; - required_device m_riot0; - required_device m_riot1; + required_device m_riot0; + required_device m_riot1; required_device m_fdc; required_device m_floppy0; required_device m_floppy1; diff --git a/src/devices/bus/ieee488/d9060.cpp b/src/devices/bus/ieee488/d9060.cpp index c520ee71182..3020fa41f42 100644 --- a/src/devices/bus/ieee488/d9060.cpp +++ b/src/devices/bus/ieee488/d9060.cpp @@ -107,10 +107,10 @@ const tiny_rom_entry *d9060_device_base::device_rom_region() const void d9060_device_base::main_mem(address_map &map) { - map(0x0000, 0x007f).mirror(0x0100).m(m_riot0, FUNC(mos6532_new_device::ram_map)); - map(0x0080, 0x00ff).mirror(0x0100).m(m_riot1, FUNC(mos6532_new_device::ram_map)); - map(0x0200, 0x021f).mirror(0x0d60).m(m_riot0, FUNC(mos6532_new_device::io_map)); - map(0x0280, 0x029f).mirror(0x0d60).m(m_riot1, FUNC(mos6532_new_device::io_map)); + map(0x0000, 0x007f).mirror(0x0100).m(m_riot0, FUNC(mos6532_device::ram_map)); + map(0x0080, 0x00ff).mirror(0x0100).m(m_riot1, FUNC(mos6532_device::ram_map)); + map(0x0200, 0x021f).mirror(0x0d60).m(m_riot0, FUNC(mos6532_device::io_map)); + map(0x0280, 0x029f).mirror(0x0d60).m(m_riot1, FUNC(mos6532_device::io_map)); map(0x1000, 0x13ff).mirror(0x0c00).ram().share("share1"); map(0x2000, 0x23ff).mirror(0x0c00).ram().share("share2"); map(0x3000, 0x33ff).mirror(0x0c00).ram().share("share3"); @@ -368,11 +368,11 @@ void d9060_device_base::device_add_mconfig(machine_config &config) M6502(config, m_maincpu, XTAL(4'000'000)/4); m_maincpu->set_addrmap(AS_PROGRAM, &d9060_device::main_mem); - MOS6532_NEW(config, m_riot0, XTAL(4'000'000)/4); + MOS6532(config, m_riot0, XTAL(4'000'000)/4); m_riot0->pa_rd_callback().set(FUNC(d9060_device_base::dio_r)); m_riot0->pb_wr_callback().set(FUNC(d9060_device_base::dio_w)); - MOS6532_NEW(config, m_riot1, XTAL(4'000'000)/4); + MOS6532(config, m_riot1, XTAL(4'000'000)/4); m_riot1->pa_rd_callback().set(FUNC(d9060_device_base::riot1_pa_r)); m_riot1->pa_wr_callback().set(FUNC(d9060_device_base::riot1_pa_w)); m_riot1->pb_rd_callback().set(FUNC(d9060_device_base::riot1_pb_r)); diff --git a/src/devices/bus/ieee488/d9060.h b/src/devices/bus/ieee488/d9060.h index 4c31760502a..6e137dba478 100644 --- a/src/devices/bus/ieee488/d9060.h +++ b/src/devices/bus/ieee488/d9060.h @@ -14,7 +14,7 @@ #include "ieee488.h" #include "cpu/m6502/m6502.h" #include "machine/6522via.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "bus/scsi/scsi.h" @@ -67,8 +67,8 @@ private: required_device m_maincpu; required_device m_hdccpu; - required_device m_riot0; - required_device m_riot1; + required_device m_riot0; + required_device m_riot1; required_device m_via; required_device m_sasibus; required_device m_sasi_data_out; diff --git a/src/devices/machine/mos6530.cpp b/src/devices/machine/mos6530.cpp new file mode 100644 index 00000000000..3d4981e2b20 --- /dev/null +++ b/src/devices/machine/mos6530.cpp @@ -0,0 +1,594 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + MOS Technology 6530 MIOT (Memory, I/O, Timer Array) + Rockwell calls it RRIOT: ROM, RAM, I/O, Timer + + MOS Technology 6532 RIOT (RAM, I/O, Timer Array) + +**********************************************************************/ + +#include "emu.h" +#include "mos6530.h" + +#define LOG_TIMER (1U << 1) + +//#define VERBOSE (LOG_GENERAL | LOG_TIMER) +#include "logmacro.h" + +#define LOGTIMER(...) LOGMASKED(LOG_TIMER, __VA_ARGS__) + + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(MOS6530, mos6530_device, "mos6530", "MOS 6530 MIOT") +DEFINE_DEVICE_TYPE(MOS6532, mos6532_device, "mos6532", "MOS 6532 RIOT") + + +void mos6530_device::rom_map(address_map &map) +{ + map.global_mask(0x3ff); + map(0x000, 0x3ff).r(FUNC(mos6530_device::rom_r)); +} + +void mos6530_device::ram_map(address_map &map) +{ + map.global_mask(0x3f); + map(0x00, 0x3f).rw(FUNC(mos6530_device::ram_r), FUNC(mos6530_device::ram_w)); +} + +void mos6530_device::io_map(address_map &map) +{ + map.global_mask(0xf); + map(0x00, 0x00).mirror(0x8).rw(FUNC(mos6530_device::pa_data_r), FUNC(mos6530_device::pa_data_w)); + map(0x01, 0x01).mirror(0x8).rw(FUNC(mos6530_device::pa_ddr_r), FUNC(mos6530_device::pa_ddr_w)); + map(0x02, 0x02).mirror(0x8).rw(FUNC(mos6530_device::pb_data_r), FUNC(mos6530_device::pb_data_w)); + map(0x03, 0x03).mirror(0x8).rw(FUNC(mos6530_device::pb_ddr_r), FUNC(mos6530_device::pb_ddr_w)); + map(0x04, 0x07).w(FUNC(mos6530_device::timer_off_w)); + map(0x0c, 0x0f).w(FUNC(mos6530_device::timer_on_w)); + map(0x04, 0x04).mirror(0x2).r(FUNC(mos6530_device::timer_off_r)); + map(0x0c, 0x0c).mirror(0x2).r(FUNC(mos6530_device::timer_on_r)); + map(0x05, 0x05).mirror(0xa).r(FUNC(mos6530_device::irq_r)); +} + +void mos6532_device::ram_map(address_map &map) +{ + map.global_mask(0x7f); + map(0x00, 0x7f).rw(FUNC(mos6532_device::ram_r), FUNC(mos6532_device::ram_w)); +} + +void mos6532_device::io_map(address_map &map) +{ + map.global_mask(0x1f); + map(0x00, 0x00).mirror(0x18).rw(FUNC(mos6532_device::pa_data_r), FUNC(mos6532_device::pa_data_w)); + map(0x01, 0x01).mirror(0x18).rw(FUNC(mos6532_device::pa_ddr_r), FUNC(mos6532_device::pa_ddr_w)); + map(0x02, 0x02).mirror(0x18).rw(FUNC(mos6532_device::pb_data_r), FUNC(mos6532_device::pb_data_w)); + map(0x03, 0x03).mirror(0x18).rw(FUNC(mos6532_device::pb_ddr_r), FUNC(mos6532_device::pb_ddr_w)); + map(0x14, 0x17).w(FUNC(mos6532_device::timer_off_w)); + map(0x1c, 0x1f).w(FUNC(mos6532_device::timer_on_w)); + map(0x04, 0x04).mirror(0x12).r(FUNC(mos6532_device::timer_off_r)); + map(0x0c, 0x0c).mirror(0x12).r(FUNC(mos6532_device::timer_on_r)); + map(0x05, 0x05).mirror(0x1a).r(FUNC(mos6532_device::irq_r)); + map(0x04, 0x07).mirror(0x8).w(FUNC(mos6532_device::edge_w)); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// mos6530_device_base - constructor +//------------------------------------------------- + +mos6530_device_base::mos6530_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, u32 rsize) : + device_t(mconfig, type, tag, owner, clock), + m_ram(*this, finder_base::DUMMY_TAG, rsize, ENDIANNESS_LITTLE), + m_rom(*this, DEVICE_SELF), + m_irq_cb(*this), + m_in8_pa_cb(*this, 0), + m_out8_pa_cb(*this), + m_in8_pb_cb(*this, 0), + m_out8_pb_cb(*this), + m_in_pa_cb(*this, 0), + m_out_pa_cb(*this), + m_in_pb_cb(*this, 0), + m_out_pb_cb(*this), + m_pa_in(0xff), + m_pa_out(0), + m_pa_ddr(0), + m_pa7(0), + m_pa7_dir(0), + m_pb_in(0xff), + m_pb_out(0), + m_pb_ddr(0), + m_ie_timer(false), + m_irq_timer(false), + m_ie_edge(false), + m_irq_edge(false) +{ } + + +//------------------------------------------------- +// mos6530_device - constructor +//------------------------------------------------- + +mos6530_device::mos6530_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + mos6530_device_base(mconfig, MOS6530, tag, owner, clock, 0x40) +{ } + + +//------------------------------------------------- +// mos6532_device - constructor +//------------------------------------------------- + +mos6532_device::mos6532_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + mos6530_device_base(mconfig, MOS6532, tag, owner, clock, 0x80) +{ } + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void mos6530_device_base::device_start() +{ + // allocate timer + m_timer = timer_alloc(FUNC(mos6530_device_base::timer_end), this); + m_timershift = 10; + m_timerstate = TIMER_COUNTING; + m_timer->adjust(attotime::from_ticks(256 << m_timershift, clock())); + + // state saving + save_item(NAME(m_pa_in)); + save_item(NAME(m_pa_out)); + save_item(NAME(m_pa_ddr)); + save_item(NAME(m_pa7)); + save_item(NAME(m_pa7_dir)); + + save_item(NAME(m_pb_in)); + save_item(NAME(m_pb_out)); + save_item(NAME(m_pb_ddr)); + + save_item(NAME(m_ie_timer)); + save_item(NAME(m_irq_timer)); + save_item(NAME(m_ie_edge)); + save_item(NAME(m_irq_edge)); + + save_item(NAME(m_timershift)); + save_item(NAME(m_timerstate)); + save_item(NAME(m_timeout)); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void mos6530_device_base::device_reset() +{ + m_pa_out = 0; + m_pa_ddr = 0; + m_pb_out = 0; + m_pb_ddr = 0; + + m_ie_timer = false; + m_ie_edge = false; + m_irq_edge = false; + m_pa7_dir = 0; + + update_pa(); + update_pb(); + update_irq(); + edge_detect(); +} + + +//------------------------------------------------- +// update_pa - +//------------------------------------------------- + +void mos6530_device_base::update_pa() +{ + uint8_t data = (m_pa_out & m_pa_ddr) | (m_pa_ddr ^ 0xff); + + if (m_out8_pa_cb.isunset()) + { + for (int i = 0; i < 8; i++) + m_out_pa_cb[i](BIT(data, i)); + } + else + m_out8_pa_cb(data); +} + + +//------------------------------------------------- +// update_pb - +//------------------------------------------------- + +void mos6530_device_base::update_pb() +{ + uint8_t data = (m_pb_out & m_pb_ddr) | (m_pb_ddr ^ 0xff); + + if (m_out8_pb_cb.isunset()) + { + for (int i = 0; i < 8; i++) + m_out_pb_cb[i](BIT(data, i)); + } + else + m_out8_pb_cb(data); +} + +void mos6530_device::update_pb() +{ + uint8_t data = (m_pb_out & m_pb_ddr) | (m_pb_ddr ^ 0xff); + + if (!BIT(m_pb_ddr, 7)) + { + // active low! + if (m_ie_timer && m_irq_timer) + data &= ~IRQ_TIMER; + else + data |= IRQ_TIMER; + } + + if (m_out8_pb_cb.isunset()) + { + for (int i = 0; i < 8; i++) + m_out_pb_cb[i](BIT(data, i)); + } + else + m_out8_pb_cb(data); + + m_irq_cb(BIT(data, 7) ? CLEAR_LINE: ASSERT_LINE); +} + + +//------------------------------------------------- +// update_irq - +//------------------------------------------------- + +void mos6530_device_base::update_irq() +{ + int state = CLEAR_LINE; + + if (m_ie_timer && m_irq_timer) state = ASSERT_LINE; + if (m_ie_edge && m_irq_edge) state = ASSERT_LINE; + + m_irq_cb(state); +} + +void mos6530_device::update_irq() +{ + update_pb(); +} + + +//------------------------------------------------- +// get_irq_flags - +//------------------------------------------------- + +uint8_t mos6530_device_base::get_irq_flags() +{ + uint8_t data = 0; + + if (m_irq_timer) data |= IRQ_TIMER; + if (m_irq_edge) data |= IRQ_EDGE; + + return data; +} + +uint8_t mos6530_device::get_irq_flags() +{ + uint8_t data = 0; + + if (m_irq_timer) data |= IRQ_TIMER; + + return data; +} + + +//------------------------------------------------- +// get_timer - return the current timer value +//------------------------------------------------- + +uint8_t mos6530_device_base::get_timer() +{ + // determine the number of ticks remaining + uint8_t shift = (m_timerstate == TIMER_COUNTING) ? m_timershift : 0; + int64_t remain = m_timer->remaining().as_ticks(clock()); + uint8_t val = remain >> shift; + + // timeout is at 255, so round it down + return (remain & ((1 << shift) - 1)) ? val : (val - 1); +} + + +//------------------------------------------------- +// timer_start - restart timer counter +//------------------------------------------------- + +void mos6530_device_base::timer_start(uint8_t data) +{ + m_timerstate = TIMER_COUNTING; + attotime curtime = machine().time(); + int64_t target = curtime.as_ticks(clock()) + 1 + (data << m_timershift); + m_timer->adjust(attotime::from_ticks(target, clock()) - curtime); +} + + +//------------------------------------------------- +// timer_end - +//------------------------------------------------- + +TIMER_CALLBACK_MEMBER(mos6530_device_base::timer_end) +{ + // if we finished counting, signal timer IRQ + if (m_timerstate == TIMER_COUNTING) + { + m_timeout = machine().time(); + m_irq_timer = true; + update_irq(); + } + + // if we finished, keep spinning without the prescaler + m_timerstate = TIMER_SPINNING; + m_timer->adjust(attotime::from_ticks(256, clock())); +} + + +//------------------------------------------------- +// edge_detect - +//------------------------------------------------- + +void mos6530_device_base::edge_detect() +{ + uint8_t data = (m_pa_out & m_pa_ddr) | (m_pa_in & ~m_pa_ddr); + int state = BIT(data, 7); + + if ((m_pa7 ^ state) && !(m_pa7_dir ^ state) && !m_irq_edge) + { + LOG("%s %s edge-detect IRQ\n", machine().time().as_string(), name()); + + m_irq_edge = true; + update_irq(); + } + + m_pa7 = state; +} + + +//------------------------------------------------- +// pa_w - +//------------------------------------------------- + +void mos6530_device_base::pa_w(offs_t offset, uint8_t data, uint8_t mem_mask) +{ + LOG("%s %s %s Port A Data Write %02X Mask %02X\n", machine().time().as_string(), machine().describe_context(), name(), data, mem_mask); + + m_pa_in = (m_pa_in & ~mem_mask) | (data & mem_mask); + edge_detect(); +} + + +//------------------------------------------------- +// pb_w - +//------------------------------------------------- + +void mos6530_device_base::pb_w(offs_t offset, uint8_t data, uint8_t mem_mask) +{ + LOG("%s %s %s Port B Data Write %02X Mask %02X\n", machine().time().as_string(), machine().describe_context(), name(), data, mem_mask); + + m_pb_in = (m_pb_in & ~mem_mask) | (data & mem_mask); +} + + +//------------------------------------------------- +// pa_data_r - +//------------------------------------------------- + +uint8_t mos6530_device_base::pa_data_r() +{ + uint8_t in = 0; + + if (m_in8_pa_cb.isunset()) + { + for (int i = 0; i < 8; i++) + in |= (m_in_pa_cb[i].isunset() ? BIT(m_pa_in, i) : m_in_pa_cb[i]()) << i; + } + else + in = m_in8_pa_cb(); + + uint8_t data = (m_pa_out & m_pa_ddr) | (in & ~m_pa_ddr); + + LOG("%s %s %s Port A Data In %02x\n", machine().time().as_string(), machine().describe_context(), name(), data); + + return data; +} + + +//------------------------------------------------- +// pa_data_w - +//------------------------------------------------- + +void mos6530_device_base::pa_data_w(uint8_t data) +{ + m_pa_out = data; + + LOG("%s %s %s Port A Data Out %02x\n", machine().time().as_string(), machine().describe_context(), name(), data); + + update_pa(); + edge_detect(); +} + + +//------------------------------------------------- +// pa_ddr_w - +//------------------------------------------------- + +void mos6530_device_base::pa_ddr_w(uint8_t data) +{ + m_pa_ddr = data; + + LOG("%s %s %s Port A DDR %02x\n", machine().time().as_string(), machine().describe_context(), name(), data); + + update_pa(); + edge_detect(); +} + + +//------------------------------------------------- +// pb_data_r - +//------------------------------------------------- + +uint8_t mos6530_device_base::pb_data_r() +{ + uint8_t in = 0; + + if (m_in8_pb_cb.isunset()) + { + for (int i = 0; i < 8; i++) + in |= (m_in_pb_cb[i].isunset() ? BIT(m_pb_in, i) : m_in_pb_cb[i]()) << i; + } + else + in = m_in8_pb_cb(); + + uint8_t data = (m_pb_out & m_pb_ddr) | (in & ~m_pb_ddr); + + LOG("%s %s %s Port B Data In %02x\n", machine().time().as_string(), machine().describe_context(), name(), data); + + return data; +} + + +//------------------------------------------------- +// pb_data_w - +//------------------------------------------------- + +void mos6530_device_base::pb_data_w(uint8_t data) +{ + m_pb_out = data; + + LOG("%s %s %s Port B Data Out %02x\n", machine().time().as_string(), machine().describe_context(), name(), data); + + update_pb(); +} + + +//------------------------------------------------- +// pb_ddr_w - +//------------------------------------------------- + +void mos6530_device_base::pb_ddr_w(uint8_t data) +{ + m_pb_ddr = data; + + LOG("%s %s %s Port B DDR %02x\n", machine().time().as_string(), machine().describe_context(), name(), data); + + update_pb(); +} + + +//------------------------------------------------- +// timer_r - +//------------------------------------------------- + +uint8_t mos6530_device_base::timer_off_r() +{ + return timer_r(false); +} + +uint8_t mos6530_device_base::timer_on_r() +{ + return timer_r(true); +} + +uint8_t mos6530_device_base::timer_r(bool ie) +{ + uint8_t data = get_timer(); + + if (!machine().side_effects_disabled()) + { + // IRQ is not cleared when reading at the same time IRQ is raised + if (m_timeout < machine().time() - attotime::from_hz(2 * clock())) + { + m_irq_timer = false; + + // timer goes back to count mode + if (m_timerstate == TIMER_SPINNING) + timer_start(data); + } + + m_ie_timer = ie; + update_irq(); + + LOGTIMER("%s %s %s Timer read %02x IE %u\n", machine().time().as_string(), machine().describe_context(), name(), data, m_ie_timer ? 1 : 0); + } + + return data; +} + + +//------------------------------------------------- +// irq_r - +//------------------------------------------------- + +uint8_t mos6530_device_base::irq_r() +{ + uint8_t data = get_irq_flags(); + + if (!machine().side_effects_disabled() && m_irq_edge) + { + m_irq_edge = false; + update_irq(); + } + + return data; +} + + +//------------------------------------------------- +// timer_w - +//------------------------------------------------- + +void mos6530_device_base::timer_off_w(offs_t offset, uint8_t data) +{ + timer_w(offset, data, false); +} + +void mos6530_device_base::timer_on_w(offs_t offset, uint8_t data) +{ + timer_w(offset, data, true); +} + +void mos6530_device_base::timer_w(offs_t offset, uint8_t data, bool ie) +{ + // A0-A1 contain the prescaler + static const uint8_t timershift[4] = { 0, 3, 6, 10 }; + m_timershift = timershift[offset & 3]; + timer_start(data); + + m_irq_timer = false; + m_ie_timer = ie; + update_irq(); + + LOGTIMER("%s %s %s Timer value %02x prescale %u IE %u\n", machine().time().as_string(), machine().describe_context(), name(), data, 1 << m_timershift, m_ie_timer ? 1 : 0); +} + + +//------------------------------------------------- +// edge_w - +//------------------------------------------------- + +void mos6530_device_base::edge_w(offs_t offset, uint8_t data) +{ + m_pa7_dir = BIT(offset, 0); + m_ie_edge = bool(BIT(offset, 1)); + update_irq(); + + LOG("%s %s %s %s edge-detect, %s interrupt\n", machine().time().as_string(), machine().describe_context(), name(), m_pa7_dir ? "positive" : "negative", m_ie_edge ? "enable" : "disable"); +} diff --git a/src/devices/machine/mos6530.h b/src/devices/machine/mos6530.h new file mode 100644 index 00000000000..1e814623b2c --- /dev/null +++ b/src/devices/machine/mos6530.h @@ -0,0 +1,207 @@ +// license:BSD-3-Clause +// copyright-holders:Curt Coder +/********************************************************************** + + MOS Technology 6530 MIOT, 6532 RIOT + +********************************************************************** + _____ _____ + Vss 1 |* \_/ | 40 PA1 + PA0 2 | | 39 PA2 + phi2 3 | | 38 PA3 + RS0 4 | | 37 PA4 + A9 5 | | 36 PA5 + A8 6 | | 35 PA6 + A7 7 | | 34 PA7 + A6 8 | | 33 DB0 + R/W 9 | | 32 DB1 + A5 10 | MCS6530 | 31 DB2 + A4 11 | | 30 DB3 + A3 12 | | 29 DB4 + A2 13 | | 28 DB5 + A1 14 | | 27 DB6 + A0 15 | | 26 DB7 + _RES 16 | | 25 PB0 + IRQ/PB7 17 | | 24 PB1 + CS1/PB6 18 | | 23 PB2 + CS2/PB5 19 | | 22 PB3 + Vcc 20 |_____________| 21 PB4 + + _____ _____ + Vss 1 |* \_/ | 40 A6 + A5 2 | | 39 phi2 + A4 3 | | 38 CS1 + A3 4 | | 37 _CS2 + A2 5 | | 36 _RS + A1 6 | | 35 R/W + A0 7 | | 34 _RES + PA0 8 | | 33 D0 + PA1 9 | | 32 D1 + PA2 10 | MCS6532 | 31 D2 + PA3 11 | | 30 D3 + PA4 12 | | 29 D4 + PA5 13 | | 28 D5 + PA6 14 | | 27 D6 + PA7 15 | | 26 D7 + PB7 16 | | 25 _IRQ + PB6 17 | | 24 PB0 + PB5 18 | | 23 PB1 + PB4 19 | | 22 PB2 + Vcc 20 |_____________| 21 PB3 + +**********************************************************************/ + +#ifndef MAME_MACHINE_MOS6530_H +#define MAME_MACHINE_MOS6530_H + +#pragma once + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> mos6530_device_base + +class mos6530_device_base : public device_t +{ +public: + // 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(); } + + // _IRQ pin (on 6530 it's shared with PB7) + auto irq_wr_callback() { return m_irq_cb.bind(); } + + // write to port inputs (PA7 can trigger an IRQ, the others are normal inputs) + void pa_w(offs_t offset, uint8_t data, uint8_t mem_mask = 0xff); + void pb_w(offs_t offset, uint8_t data, uint8_t mem_mask = 0xff); + template void pa_bit_w(int state) { pa_w(0, (state & 1) << N, 1 << N); } + template void pb_bit_w(int state) { pb_w(0, (state & 1) << N, 1 << N); } + +protected: + // construction/destruction + mos6530_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, u32 rsize); + + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + + enum + { + IRQ_EDGE = 0x40, + IRQ_TIMER = 0x80 + }; + + enum + { + TIMER_COUNTING, + TIMER_SPINNING + }; + + void update_pa(); + virtual void update_pb(); + virtual void update_irq(); + virtual uint8_t get_irq_flags(); + uint8_t get_timer(); + void timer_start(uint8_t data); + TIMER_CALLBACK_MEMBER(timer_end); + void edge_detect(); + + void timer_w(offs_t offset, uint8_t data, bool ie); + uint8_t timer_r(bool ie); + + uint8_t rom_r(offs_t offset) { return m_rom[offset]; } + uint8_t ram_r(offs_t offset) { return m_ram[offset]; } + void ram_w(offs_t offset, uint8_t data) { m_ram[offset] = data; } + uint8_t pa_data_r(); + void pa_data_w(uint8_t data); + uint8_t pb_data_r(); + void pb_data_w(uint8_t data); + uint8_t pa_ddr_r() { return m_pa_ddr; } + void pa_ddr_w(uint8_t data); + uint8_t pb_ddr_r() { return m_pb_ddr; } + void pb_ddr_w(uint8_t data); + uint8_t timer_off_r(); + uint8_t timer_on_r(); + uint8_t irq_r(); + void timer_off_w(offs_t offset, uint8_t data); + void timer_on_w(offs_t offset, uint8_t data); + void edge_w(offs_t offset, uint8_t data); + + memory_share_creator m_ram; + optional_region_ptr m_rom; + + devcb_write_line m_irq_cb; + devcb_read8 m_in8_pa_cb; + devcb_write8 m_out8_pa_cb; + devcb_read8 m_in8_pb_cb; + devcb_write8 m_out8_pb_cb; + devcb_read_line::array<8> m_in_pa_cb; + devcb_write_line::array<8> m_out_pa_cb; + devcb_read_line::array<8> m_in_pb_cb; + devcb_write_line::array<8> m_out_pb_cb; + + uint8_t m_pa_in; + uint8_t m_pa_out; + uint8_t m_pa_ddr; + int m_pa7; + int m_pa7_dir; + + uint8_t m_pb_in; + uint8_t m_pb_out; + uint8_t m_pb_ddr; + + bool m_ie_timer; + bool m_irq_timer; + bool m_ie_edge; + bool m_irq_edge; + + uint8_t m_timershift; + uint8_t m_timerstate; + emu_timer *m_timer; + attotime m_timeout; +}; + + +class mos6530_device : public mos6530_device_base +{ +public: + // construction/destruction + mos6530_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + virtual void rom_map(address_map &map); + virtual void ram_map(address_map &map); + virtual void io_map(address_map &map); + +protected: + // device-level overrides + void update_pb() override; + void update_irq() override; + uint8_t get_irq_flags() override; +}; + + +class mos6532_device : public mos6530_device_base +{ +public: + // construction/destruction + mos6532_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + virtual void ram_map(address_map &map); + virtual void io_map(address_map &map); +}; + + +// device type definition +DECLARE_DEVICE_TYPE(MOS6530, mos6530_device) +DECLARE_DEVICE_TYPE(MOS6532, mos6532_device) + +#endif // MAME_MACHINE_MOS6530_H diff --git a/src/devices/machine/mos6530n.cpp b/src/devices/machine/mos6530n.cpp deleted file mode 100644 index 57222760bf8..00000000000 --- a/src/devices/machine/mos6530n.cpp +++ /dev/null @@ -1,594 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Curt Coder -/********************************************************************** - - MOS Technology 6530 MIOT (Memory, I/O, Timer Array) - Rockwell calls it RRIOT: ROM, RAM, I/O, Timer - - MOS Technology 6532 RIOT (RAM, I/O, Timer Array) - -**********************************************************************/ - -#include "emu.h" -#include "mos6530n.h" - -#define LOG_TIMER (1U << 1) - -//#define VERBOSE (LOG_GENERAL | LOG_TIMER) -#include "logmacro.h" - -#define LOGTIMER(...) LOGMASKED(LOG_TIMER, __VA_ARGS__) - - - -//************************************************************************** -// DEVICE DEFINITIONS -//************************************************************************** - -DEFINE_DEVICE_TYPE(MOS6530_NEW, mos6530_new_device, "mos6530_new", "MOS 6530 (new)") -DEFINE_DEVICE_TYPE(MOS6532_NEW, mos6532_new_device, "mos6532_new", "MOS 6532 (new)") - - -void mos6530_new_device::rom_map(address_map &map) -{ - map.global_mask(0x3ff); - map(0x000, 0x3ff).r(FUNC(mos6530_new_device::rom_r)); -} - -void mos6530_new_device::ram_map(address_map &map) -{ - map.global_mask(0x3f); - map(0x00, 0x3f).rw(FUNC(mos6530_new_device::ram_r), FUNC(mos6530_new_device::ram_w)); -} - -void mos6530_new_device::io_map(address_map &map) -{ - map.global_mask(0xf); - map(0x00, 0x00).mirror(0x8).rw(FUNC(mos6530_new_device::pa_data_r), FUNC(mos6530_new_device::pa_data_w)); - map(0x01, 0x01).mirror(0x8).rw(FUNC(mos6530_new_device::pa_ddr_r), FUNC(mos6530_new_device::pa_ddr_w)); - map(0x02, 0x02).mirror(0x8).rw(FUNC(mos6530_new_device::pb_data_r), FUNC(mos6530_new_device::pb_data_w)); - map(0x03, 0x03).mirror(0x8).rw(FUNC(mos6530_new_device::pb_ddr_r), FUNC(mos6530_new_device::pb_ddr_w)); - map(0x04, 0x07).w(FUNC(mos6530_new_device::timer_off_w)); - map(0x0c, 0x0f).w(FUNC(mos6530_new_device::timer_on_w)); - map(0x04, 0x04).mirror(0x2).r(FUNC(mos6530_new_device::timer_off_r)); - map(0x0c, 0x0c).mirror(0x2).r(FUNC(mos6530_new_device::timer_on_r)); - map(0x05, 0x05).mirror(0xa).r(FUNC(mos6530_new_device::irq_r)); -} - -void mos6532_new_device::ram_map(address_map &map) -{ - map.global_mask(0x7f); - map(0x00, 0x7f).rw(FUNC(mos6532_new_device::ram_r), FUNC(mos6532_new_device::ram_w)); -} - -void mos6532_new_device::io_map(address_map &map) -{ - map.global_mask(0x1f); - map(0x00, 0x00).mirror(0x18).rw(FUNC(mos6532_new_device::pa_data_r), FUNC(mos6532_new_device::pa_data_w)); - map(0x01, 0x01).mirror(0x18).rw(FUNC(mos6532_new_device::pa_ddr_r), FUNC(mos6532_new_device::pa_ddr_w)); - map(0x02, 0x02).mirror(0x18).rw(FUNC(mos6532_new_device::pb_data_r), FUNC(mos6532_new_device::pb_data_w)); - map(0x03, 0x03).mirror(0x18).rw(FUNC(mos6532_new_device::pb_ddr_r), FUNC(mos6532_new_device::pb_ddr_w)); - map(0x14, 0x17).w(FUNC(mos6532_new_device::timer_off_w)); - map(0x1c, 0x1f).w(FUNC(mos6532_new_device::timer_on_w)); - map(0x04, 0x04).mirror(0x12).r(FUNC(mos6532_new_device::timer_off_r)); - map(0x0c, 0x0c).mirror(0x12).r(FUNC(mos6532_new_device::timer_on_r)); - map(0x05, 0x05).mirror(0x1a).r(FUNC(mos6532_new_device::irq_r)); - map(0x04, 0x07).mirror(0x8).w(FUNC(mos6532_new_device::edge_w)); -} - - -//************************************************************************** -// LIVE DEVICE -//************************************************************************** - -//------------------------------------------------- -// mos6530_device_base - constructor -//------------------------------------------------- - -mos6530_device_base::mos6530_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, u32 rsize) : - device_t(mconfig, type, tag, owner, clock), - m_ram(*this, finder_base::DUMMY_TAG, rsize, ENDIANNESS_LITTLE), - m_rom(*this, DEVICE_SELF), - m_irq_cb(*this), - m_in8_pa_cb(*this, 0), - m_out8_pa_cb(*this), - m_in8_pb_cb(*this, 0), - m_out8_pb_cb(*this), - m_in_pa_cb(*this, 0), - m_out_pa_cb(*this), - m_in_pb_cb(*this, 0), - m_out_pb_cb(*this), - m_pa_in(0xff), - m_pa_out(0), - m_pa_ddr(0), - m_pa7(0), - m_pa7_dir(0), - m_pb_in(0xff), - m_pb_out(0), - m_pb_ddr(0), - m_ie_timer(false), - m_irq_timer(false), - m_ie_edge(false), - m_irq_edge(false) -{ } - - -//------------------------------------------------- -// mos6530_new_device - constructor -//------------------------------------------------- - -mos6530_new_device::mos6530_new_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - mos6530_device_base(mconfig, MOS6530_NEW, tag, owner, clock, 0x40) -{ } - - -//------------------------------------------------- -// mos6532_new_device - constructor -//------------------------------------------------- - -mos6532_new_device::mos6532_new_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - mos6530_device_base(mconfig, MOS6532_NEW, tag, owner, clock, 0x80) -{ } - - -//------------------------------------------------- -// device_start - device-specific startup -//------------------------------------------------- - -void mos6530_device_base::device_start() -{ - // allocate timer - m_timer = timer_alloc(FUNC(mos6530_device_base::timer_end), this); - m_timershift = 10; - m_timerstate = TIMER_COUNTING; - m_timer->adjust(attotime::from_ticks(256 << m_timershift, clock())); - - // state saving - save_item(NAME(m_pa_in)); - save_item(NAME(m_pa_out)); - save_item(NAME(m_pa_ddr)); - save_item(NAME(m_pa7)); - save_item(NAME(m_pa7_dir)); - - save_item(NAME(m_pb_in)); - save_item(NAME(m_pb_out)); - save_item(NAME(m_pb_ddr)); - - save_item(NAME(m_ie_timer)); - save_item(NAME(m_irq_timer)); - save_item(NAME(m_ie_edge)); - save_item(NAME(m_irq_edge)); - - save_item(NAME(m_timershift)); - save_item(NAME(m_timerstate)); - save_item(NAME(m_timeout)); -} - - -//------------------------------------------------- -// device_reset - device-specific reset -//------------------------------------------------- - -void mos6530_device_base::device_reset() -{ - m_pa_out = 0; - m_pa_ddr = 0; - m_pb_out = 0; - m_pb_ddr = 0; - - m_ie_timer = false; - m_ie_edge = false; - m_irq_edge = false; - m_pa7_dir = 0; - - update_pa(); - update_pb(); - update_irq(); - edge_detect(); -} - - -//------------------------------------------------- -// update_pa - -//------------------------------------------------- - -void mos6530_device_base::update_pa() -{ - uint8_t data = (m_pa_out & m_pa_ddr) | (m_pa_ddr ^ 0xff); - - if (m_out8_pa_cb.isunset()) - { - for (int i = 0; i < 8; i++) - m_out_pa_cb[i](BIT(data, i)); - } - else - m_out8_pa_cb(data); -} - - -//------------------------------------------------- -// update_pb - -//------------------------------------------------- - -void mos6530_device_base::update_pb() -{ - uint8_t data = (m_pb_out & m_pb_ddr) | (m_pb_ddr ^ 0xff); - - if (m_out8_pb_cb.isunset()) - { - for (int i = 0; i < 8; i++) - m_out_pb_cb[i](BIT(data, i)); - } - else - m_out8_pb_cb(data); -} - -void mos6530_new_device::update_pb() -{ - uint8_t data = (m_pb_out & m_pb_ddr) | (m_pb_ddr ^ 0xff); - - if (!BIT(m_pb_ddr, 7)) - { - // active low! - if (m_ie_timer && m_irq_timer) - data &= ~IRQ_TIMER; - else - data |= IRQ_TIMER; - } - - if (m_out8_pb_cb.isunset()) - { - for (int i = 0; i < 8; i++) - m_out_pb_cb[i](BIT(data, i)); - } - else - m_out8_pb_cb(data); - - m_irq_cb(BIT(data, 7) ? CLEAR_LINE: ASSERT_LINE); -} - - -//------------------------------------------------- -// update_irq - -//------------------------------------------------- - -void mos6530_device_base::update_irq() -{ - int state = CLEAR_LINE; - - if (m_ie_timer && m_irq_timer) state = ASSERT_LINE; - if (m_ie_edge && m_irq_edge) state = ASSERT_LINE; - - m_irq_cb(state); -} - -void mos6530_new_device::update_irq() -{ - update_pb(); -} - - -//------------------------------------------------- -// get_irq_flags - -//------------------------------------------------- - -uint8_t mos6530_device_base::get_irq_flags() -{ - uint8_t data = 0; - - if (m_irq_timer) data |= IRQ_TIMER; - if (m_irq_edge) data |= IRQ_EDGE; - - return data; -} - -uint8_t mos6530_new_device::get_irq_flags() -{ - uint8_t data = 0; - - if (m_irq_timer) data |= IRQ_TIMER; - - return data; -} - - -//------------------------------------------------- -// get_timer - return the current timer value -//------------------------------------------------- - -uint8_t mos6530_device_base::get_timer() -{ - // determine the number of ticks remaining - uint8_t shift = (m_timerstate == TIMER_COUNTING) ? m_timershift : 0; - int64_t remain = m_timer->remaining().as_ticks(clock()); - uint8_t val = remain >> shift; - - // timeout is at 255, so round it down - return (remain & ((1 << shift) - 1)) ? val : (val - 1); -} - - -//------------------------------------------------- -// timer_start - restart timer counter -//------------------------------------------------- - -void mos6530_device_base::timer_start(uint8_t data) -{ - m_timerstate = TIMER_COUNTING; - attotime curtime = machine().time(); - int64_t target = curtime.as_ticks(clock()) + 1 + (data << m_timershift); - m_timer->adjust(attotime::from_ticks(target, clock()) - curtime); -} - - -//------------------------------------------------- -// timer_end - -//------------------------------------------------- - -TIMER_CALLBACK_MEMBER(mos6530_device_base::timer_end) -{ - // if we finished counting, signal timer IRQ - if (m_timerstate == TIMER_COUNTING) - { - m_timeout = machine().time(); - m_irq_timer = true; - update_irq(); - } - - // if we finished, keep spinning without the prescaler - m_timerstate = TIMER_SPINNING; - m_timer->adjust(attotime::from_ticks(256, clock())); -} - - -//------------------------------------------------- -// edge_detect - -//------------------------------------------------- - -void mos6530_device_base::edge_detect() -{ - uint8_t data = (m_pa_out & m_pa_ddr) | (m_pa_in & ~m_pa_ddr); - int state = BIT(data, 7); - - if ((m_pa7 ^ state) && !(m_pa7_dir ^ state) && !m_irq_edge) - { - LOG("%s %s edge-detect IRQ\n", machine().time().as_string(), name()); - - m_irq_edge = true; - update_irq(); - } - - m_pa7 = state; -} - - -//------------------------------------------------- -// pa_w - -//------------------------------------------------- - -void mos6530_device_base::pa_w(offs_t offset, uint8_t data, uint8_t mem_mask) -{ - LOG("%s %s %s Port A Data Write %02X Mask %02X\n", machine().time().as_string(), machine().describe_context(), name(), data, mem_mask); - - m_pa_in = (m_pa_in & ~mem_mask) | (data & mem_mask); - edge_detect(); -} - - -//------------------------------------------------- -// pb_w - -//------------------------------------------------- - -void mos6530_device_base::pb_w(offs_t offset, uint8_t data, uint8_t mem_mask) -{ - LOG("%s %s %s Port B Data Write %02X Mask %02X\n", machine().time().as_string(), machine().describe_context(), name(), data, mem_mask); - - m_pb_in = (m_pb_in & ~mem_mask) | (data & mem_mask); -} - - -//------------------------------------------------- -// pa_data_r - -//------------------------------------------------- - -uint8_t mos6530_device_base::pa_data_r() -{ - uint8_t in = 0; - - if (m_in8_pa_cb.isunset()) - { - for (int i = 0; i < 8; i++) - in |= (m_in_pa_cb[i].isunset() ? BIT(m_pa_in, i) : m_in_pa_cb[i]()) << i; - } - else - in = m_in8_pa_cb(); - - uint8_t data = (m_pa_out & m_pa_ddr) | (in & ~m_pa_ddr); - - LOG("%s %s %s Port A Data In %02x\n", machine().time().as_string(), machine().describe_context(), name(), data); - - return data; -} - - -//------------------------------------------------- -// pa_data_w - -//------------------------------------------------- - -void mos6530_device_base::pa_data_w(uint8_t data) -{ - m_pa_out = data; - - LOG("%s %s %s Port A Data Out %02x\n", machine().time().as_string(), machine().describe_context(), name(), data); - - update_pa(); - edge_detect(); -} - - -//------------------------------------------------- -// pa_ddr_w - -//------------------------------------------------- - -void mos6530_device_base::pa_ddr_w(uint8_t data) -{ - m_pa_ddr = data; - - LOG("%s %s %s Port A DDR %02x\n", machine().time().as_string(), machine().describe_context(), name(), data); - - update_pa(); - edge_detect(); -} - - -//------------------------------------------------- -// pb_data_r - -//------------------------------------------------- - -uint8_t mos6530_device_base::pb_data_r() -{ - uint8_t in = 0; - - if (m_in8_pb_cb.isunset()) - { - for (int i = 0; i < 8; i++) - in |= (m_in_pb_cb[i].isunset() ? BIT(m_pb_in, i) : m_in_pb_cb[i]()) << i; - } - else - in = m_in8_pb_cb(); - - uint8_t data = (m_pb_out & m_pb_ddr) | (in & ~m_pb_ddr); - - LOG("%s %s %s Port B Data In %02x\n", machine().time().as_string(), machine().describe_context(), name(), data); - - return data; -} - - -//------------------------------------------------- -// pb_data_w - -//------------------------------------------------- - -void mos6530_device_base::pb_data_w(uint8_t data) -{ - m_pb_out = data; - - LOG("%s %s %s Port B Data Out %02x\n", machine().time().as_string(), machine().describe_context(), name(), data); - - update_pb(); -} - - -//------------------------------------------------- -// pb_ddr_w - -//------------------------------------------------- - -void mos6530_device_base::pb_ddr_w(uint8_t data) -{ - m_pb_ddr = data; - - LOG("%s %s %s Port B DDR %02x\n", machine().time().as_string(), machine().describe_context(), name(), data); - - update_pb(); -} - - -//------------------------------------------------- -// timer_r - -//------------------------------------------------- - -uint8_t mos6530_device_base::timer_off_r() -{ - return timer_r(false); -} - -uint8_t mos6530_device_base::timer_on_r() -{ - return timer_r(true); -} - -uint8_t mos6530_device_base::timer_r(bool ie) -{ - uint8_t data = get_timer(); - - if (!machine().side_effects_disabled()) - { - // IRQ is not cleared when reading at the same time IRQ is raised - if (m_timeout < machine().time() - attotime::from_hz(2 * clock())) - { - m_irq_timer = false; - - // timer goes back to count mode - if (m_timerstate == TIMER_SPINNING) - timer_start(data); - } - - m_ie_timer = ie; - update_irq(); - - LOGTIMER("%s %s %s Timer read %02x IE %u\n", machine().time().as_string(), machine().describe_context(), name(), data, m_ie_timer ? 1 : 0); - } - - return data; -} - - -//------------------------------------------------- -// irq_r - -//------------------------------------------------- - -uint8_t mos6530_device_base::irq_r() -{ - uint8_t data = get_irq_flags(); - - if (!machine().side_effects_disabled() && m_irq_edge) - { - m_irq_edge = false; - update_irq(); - } - - return data; -} - - -//------------------------------------------------- -// timer_w - -//------------------------------------------------- - -void mos6530_device_base::timer_off_w(offs_t offset, uint8_t data) -{ - timer_w(offset, data, false); -} - -void mos6530_device_base::timer_on_w(offs_t offset, uint8_t data) -{ - timer_w(offset, data, true); -} - -void mos6530_device_base::timer_w(offs_t offset, uint8_t data, bool ie) -{ - // A0-A1 contain the prescaler - static const uint8_t timershift[4] = { 0, 3, 6, 10 }; - m_timershift = timershift[offset & 3]; - timer_start(data); - - m_irq_timer = false; - m_ie_timer = ie; - update_irq(); - - LOGTIMER("%s %s %s Timer value %02x prescale %u IE %u\n", machine().time().as_string(), machine().describe_context(), name(), data, 1 << m_timershift, m_ie_timer ? 1 : 0); -} - - -//------------------------------------------------- -// edge_w - -//------------------------------------------------- - -void mos6530_device_base::edge_w(offs_t offset, uint8_t data) -{ - m_pa7_dir = BIT(offset, 0); - m_ie_edge = bool(BIT(offset, 1)); - update_irq(); - - LOG("%s %s %s %s edge-detect, %s interrupt\n", machine().time().as_string(), machine().describe_context(), name(), m_pa7_dir ? "positive" : "negative", m_ie_edge ? "enable" : "disable"); -} diff --git a/src/devices/machine/mos6530n.h b/src/devices/machine/mos6530n.h deleted file mode 100644 index 212a90aeafa..00000000000 --- a/src/devices/machine/mos6530n.h +++ /dev/null @@ -1,207 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Curt Coder -/********************************************************************** - - MOS Technology 6530 MIOT, 6532 RIOT - -********************************************************************** - _____ _____ - Vss 1 |* \_/ | 40 PA1 - PA0 2 | | 39 PA2 - phi2 3 | | 38 PA3 - RS0 4 | | 37 PA4 - A9 5 | | 36 PA5 - A8 6 | | 35 PA6 - A7 7 | | 34 PA7 - A6 8 | | 33 DB0 - R/W 9 | | 32 DB1 - A5 10 | MCS6530 | 31 DB2 - A4 11 | | 30 DB3 - A3 12 | | 29 DB4 - A2 13 | | 28 DB5 - A1 14 | | 27 DB6 - A0 15 | | 26 DB7 - _RES 16 | | 25 PB0 - IRQ/PB7 17 | | 24 PB1 - CS1/PB6 18 | | 23 PB2 - CS2/PB5 19 | | 22 PB3 - Vcc 20 |_____________| 21 PB4 - - _____ _____ - Vss 1 |* \_/ | 40 A6 - A5 2 | | 39 phi2 - A4 3 | | 38 CS1 - A3 4 | | 37 _CS2 - A2 5 | | 36 _RS - A1 6 | | 35 R/W - A0 7 | | 34 _RES - PA0 8 | | 33 D0 - PA1 9 | | 32 D1 - PA2 10 | MCS6532 | 31 D2 - PA3 11 | | 30 D3 - PA4 12 | | 29 D4 - PA5 13 | | 28 D5 - PA6 14 | | 27 D6 - PA7 15 | | 26 D7 - PB7 16 | | 25 _IRQ - PB6 17 | | 24 PB0 - PB5 18 | | 23 PB1 - PB4 19 | | 22 PB2 - Vcc 20 |_____________| 21 PB3 - -**********************************************************************/ - -#ifndef MAME_MACHINE_MOS6530N_H -#define MAME_MACHINE_MOS6530N_H - -#pragma once - -//************************************************************************** -// TYPE DEFINITIONS -//************************************************************************** - -// ======================> mos6530_device_base - -class mos6530_device_base : public device_t -{ -public: - // 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(); } - - // _IRQ pin (on 6530 it's shared with PB7) - auto irq_wr_callback() { return m_irq_cb.bind(); } - - // write to port inputs (PA7 can trigger an IRQ, the others are normal inputs) - void pa_w(offs_t offset, uint8_t data, uint8_t mem_mask = 0xff); - void pb_w(offs_t offset, uint8_t data, uint8_t mem_mask = 0xff); - template void pa_bit_w(int state) { pa_w(0, (state & 1) << N, 1 << N); } - template void pb_bit_w(int state) { pb_w(0, (state & 1) << N, 1 << N); } - -protected: - // construction/destruction - mos6530_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, u32 rsize); - - // device-level overrides - virtual void device_start() override; - virtual void device_reset() override; - - enum - { - IRQ_EDGE = 0x40, - IRQ_TIMER = 0x80 - }; - - enum - { - TIMER_COUNTING, - TIMER_SPINNING - }; - - void update_pa(); - virtual void update_pb(); - virtual void update_irq(); - virtual uint8_t get_irq_flags(); - uint8_t get_timer(); - void timer_start(uint8_t data); - TIMER_CALLBACK_MEMBER(timer_end); - void edge_detect(); - - void timer_w(offs_t offset, uint8_t data, bool ie); - uint8_t timer_r(bool ie); - - uint8_t rom_r(offs_t offset) { return m_rom[offset]; } - uint8_t ram_r(offs_t offset) { return m_ram[offset]; } - void ram_w(offs_t offset, uint8_t data) { m_ram[offset] = data; } - uint8_t pa_data_r(); - void pa_data_w(uint8_t data); - uint8_t pb_data_r(); - void pb_data_w(uint8_t data); - uint8_t pa_ddr_r() { return m_pa_ddr; } - void pa_ddr_w(uint8_t data); - uint8_t pb_ddr_r() { return m_pb_ddr; } - void pb_ddr_w(uint8_t data); - uint8_t timer_off_r(); - uint8_t timer_on_r(); - uint8_t irq_r(); - void timer_off_w(offs_t offset, uint8_t data); - void timer_on_w(offs_t offset, uint8_t data); - void edge_w(offs_t offset, uint8_t data); - - memory_share_creator m_ram; - optional_region_ptr m_rom; - - devcb_write_line m_irq_cb; - devcb_read8 m_in8_pa_cb; - devcb_write8 m_out8_pa_cb; - devcb_read8 m_in8_pb_cb; - devcb_write8 m_out8_pb_cb; - devcb_read_line::array<8> m_in_pa_cb; - devcb_write_line::array<8> m_out_pa_cb; - devcb_read_line::array<8> m_in_pb_cb; - devcb_write_line::array<8> m_out_pb_cb; - - uint8_t m_pa_in; - uint8_t m_pa_out; - uint8_t m_pa_ddr; - int m_pa7; - int m_pa7_dir; - - uint8_t m_pb_in; - uint8_t m_pb_out; - uint8_t m_pb_ddr; - - bool m_ie_timer; - bool m_irq_timer; - bool m_ie_edge; - bool m_irq_edge; - - uint8_t m_timershift; - uint8_t m_timerstate; - emu_timer *m_timer; - attotime m_timeout; -}; - - -class mos6530_new_device : public mos6530_device_base -{ -public: - // construction/destruction - mos6530_new_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - virtual void rom_map(address_map &map); - virtual void ram_map(address_map &map); - virtual void io_map(address_map &map); - -protected: - // device-level overrides - void update_pb() override; - void update_irq() override; - uint8_t get_irq_flags() override; -}; - - -class mos6532_new_device : public mos6530_device_base -{ -public: - // construction/destruction - mos6532_new_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - virtual void ram_map(address_map &map); - virtual void io_map(address_map &map); -}; - - -// device type definition -DECLARE_DEVICE_TYPE(MOS6530_NEW, mos6530_new_device) -DECLARE_DEVICE_TYPE(MOS6532_NEW, mos6532_new_device) - -#endif // MAME_MACHINE_MOS6530N_H diff --git a/src/mame/alliedleisure/killcom.cpp b/src/mame/alliedleisure/killcom.cpp index e6472ceb4c2..d3f14839ffa 100644 --- a/src/mame/alliedleisure/killcom.cpp +++ b/src/mame/alliedleisure/killcom.cpp @@ -355,8 +355,8 @@ void killcom_state::piratetr_main_map(address_map &map) void killcom_state::killcom_audio_map(address_map &map) { - map(0x0000, 0x007f).mirror(0x1780).m(m_riot, FUNC(mos6532_new_device::ram_map)); - map(0x0800, 0x081f).mirror(0x17e0).m(m_riot, FUNC(mos6532_new_device::io_map)); + map(0x0000, 0x007f).mirror(0x1780).m(m_riot, FUNC(mos6532_device::ram_map)); + map(0x0800, 0x081f).mirror(0x17e0).m(m_riot, FUNC(mos6532_device::io_map)); map(0xa000, 0xa000).mirror(0x1ffc).w(m_ay, FUNC(ay8910_device::address_w)); map(0xa001, 0xa001).mirror(0x1ffc).r(m_ay, FUNC(ay8910_device::data_r)); map(0xa002, 0xa002).mirror(0x1ffc).w(m_ay, FUNC(ay8910_device::data_w)); @@ -1110,7 +1110,7 @@ void killcom_state::killcom(machine_config &config) M6502(config, m_audiocpu, 3.579545_MHz_XTAL / 4); m_audiocpu->set_addrmap(AS_PROGRAM, &killcom_state::killcom_audio_map); - MOS6532_NEW(config, m_riot, 3.579545_MHz_XTAL / 4); + MOS6532(config, m_riot, 3.579545_MHz_XTAL / 4); m_riot->pb_wr_callback().set(m_via[2], FUNC(via6522_device::write_pb)); m_riot->irq_wr_callback().set_inputline(m_audiocpu, 0); diff --git a/src/mame/alliedleisure/killcom.h b/src/mame/alliedleisure/killcom.h index ef01776c7a5..8e037a0fe4b 100644 --- a/src/mame/alliedleisure/killcom.h +++ b/src/mame/alliedleisure/killcom.h @@ -7,7 +7,7 @@ ***************************************************************************/ #include "machine/6522via.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "sound/ay8910.h" #include "emupal.h" @@ -69,7 +69,7 @@ private: /* devices */ optional_device m_audiocpu; - optional_device m_riot; + optional_device m_riot; optional_device m_ay; void io_select_w(uint8_t data); diff --git a/src/mame/atari/a2600.cpp b/src/mame/atari/a2600.cpp index b6e562c004a..dc436ad36e5 100644 --- a/src/mame/atari/a2600.cpp +++ b/src/mame/atari/a2600.cpp @@ -111,7 +111,7 @@ E1 Prog ROM 42 DEMON/DIAMOND (CX2615) #include "speaker.h" #include "tia.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" //#define VERBOSE (LOG_GENERAL) #include "logmacro.h" @@ -155,7 +155,7 @@ protected: required_shared_ptr m_riot_ram; required_device m_tia; required_device m_maincpu; - required_device m_riot; + required_device m_riot; required_device m_joy1; required_device m_joy2; required_device m_screen; @@ -264,7 +264,7 @@ void a2600_base_state::a2600_mem(address_map &map) // 6507 has 13-bit address sp { map(0x0000, 0x007f).mirror(0x0f00).rw(m_tia, FUNC(tia_video_device::read), FUNC(tia_video_device::write)); map(0x0080, 0x00ff).mirror(0x0d00).ram().share("riot_ram"); - map(0x0280, 0x029f).mirror(0x0d00).m("riot", FUNC(mos6532_new_device::io_map)); + map(0x0280, 0x029f).mirror(0x0d00).m("riot", FUNC(mos6532_device::io_map)); } void a2600_pop_state::memory_map(address_map &map) // 6507 has 13-bit address space, 0x0000 - 0x1fff @@ -619,7 +619,7 @@ void a2600_base_state::a2600_base_ntsc(machine_config &config) TIA(config, "tia", m_xtal/114).add_route(ALL_OUTPUTS, "mono", 0.90); /* devices */ - MOS6532_NEW(config, m_riot, m_xtal / 3); + MOS6532(config, m_riot, m_xtal / 3); m_riot->pa_rd_callback().set(FUNC(a2600_state::switch_A_r)); m_riot->pa_wr_callback().set(FUNC(a2600_state::switch_A_w)); m_riot->pb_rd_callback().set_ioport("SWB"); @@ -652,7 +652,7 @@ void a2600_base_state::a2600_base_pal(machine_config &config) TIA(config, "tia", m_xtal/114).add_route(ALL_OUTPUTS, "mono", 0.90); /* devices */ - MOS6532_NEW(config, m_riot, m_xtal / 3); + MOS6532(config, m_riot, m_xtal / 3); m_riot->pa_rd_callback().set(FUNC(a2600_state::switch_A_r)); m_riot->pa_wr_callback().set(FUNC(a2600_state::switch_A_w)); m_riot->pb_rd_callback().set_ioport("SWB"); diff --git a/src/mame/atari/a7800.cpp b/src/mame/atari/a7800.cpp index 29e09dc7dd4..55c4ccc2317 100644 --- a/src/mame/atari/a7800.cpp +++ b/src/mame/atari/a7800.cpp @@ -103,7 +103,7 @@ #include "bus/a7800/a78_carts.h" #include "cpu/m6502/m6502.h" #include "machine/timer.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "sound/tiaintf.h" #include "emupal.h" @@ -164,7 +164,7 @@ protected: required_device m_maincpu; required_device m_tia; required_device m_maria; - required_device m_riot; + required_device m_riot; required_ioport m_io_joysticks; required_ioport m_io_buttons; required_ioport m_io_console_buttons; @@ -310,8 +310,8 @@ void a7800_state::a7800_mem(address_map &map) map(0x0000, 0x01ff).mirror(0x2000).ram(); // 0x40-0xff, 0x140-0x1ff are mirrors of second 6116 chip map(0x0000, 0x001f).mirror(0x300).rw(FUNC(a7800_state::tia_r), FUNC(a7800_state::tia_w)); map(0x0020, 0x003f).mirror(0x300).rw(m_maria, FUNC(atari_maria_device::read), FUNC(atari_maria_device::write)); - map(0x0280, 0x029f).mirror(0x160).m(m_riot, FUNC(mos6532_new_device::io_map)); - map(0x0480, 0x04ff).mirror(0x100).m(m_riot, FUNC(mos6532_new_device::ram_map)); + map(0x0280, 0x029f).mirror(0x160).m(m_riot, FUNC(mos6532_device::io_map)); + map(0x0480, 0x04ff).mirror(0x100).m(m_riot, FUNC(mos6532_device::ram_map)); map(0x1800, 0x1fff).ram(); map(0x2200, 0x27ff).ram(); // 0x2000-0x21ff, installed in mirror above // According to the official Software Guide, the RAM at 0x2000 is @@ -1398,7 +1398,7 @@ void a7800_state::a7800_common(machine_config &config, uint32_t clock) TIA(config, m_tia, clock/4/114).add_route(ALL_OUTPUTS, "mono", 1.00); // devices - MOS6532_NEW(config, m_riot, clock/8); + MOS6532(config, m_riot, clock/8); m_riot->pa_rd_callback().set(FUNC(a7800_state::riot_joystick_r)); m_riot->pb_rd_callback().set(FUNC(a7800_state::riot_console_button_r)); m_riot->pb_wr_callback().set(FUNC(a7800_state::riot_button_pullup_w)); diff --git a/src/mame/atari/firefox.cpp b/src/mame/atari/firefox.cpp index e5d099ae42a..c74200d882a 100644 --- a/src/mame/atari/firefox.cpp +++ b/src/mame/atari/firefox.cpp @@ -38,7 +38,7 @@ but requires a special level III player for proper control. Video: CAV. Audio: A #include "machine/adc0808.h" #include "machine/ldvp931.h" #include "machine/gen_latch.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "machine/timer.h" #include "machine/watchdog.h" #include "machine/x2212.h" @@ -120,7 +120,7 @@ private: required_device m_maincpu; required_device m_audiocpu; - required_device m_riot; + required_device m_riot; required_device m_gfxdecode; required_device m_screen; required_device m_palette; @@ -469,8 +469,8 @@ 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).m(m_riot, FUNC(mos6532_new_device::ram_map)); - map(0x0880, 0x089f).mirror(0x0760).m(m_riot, FUNC(mos6532_new_device::io_map)); + map(0x0800, 0x087f).mirror(0x0700).m(m_riot, FUNC(mos6532_device::ram_map)); + map(0x0880, 0x089f).mirror(0x0760).m(m_riot, FUNC(mos6532_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)); @@ -647,7 +647,7 @@ void firefox_state::firefox(machine_config &config) X2212(config, "nvram_1c").set_auto_save(true); X2212(config, "nvram_1d").set_auto_save(true); - MOS6532_NEW(config, m_riot, MASTER_XTAL/8); + MOS6532(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)); @@ -662,12 +662,12 @@ void firefox_state::firefox(machine_config &config) SPEAKER(config, "rspeaker").front_right(); GENERIC_LATCH_8(config, soundlatch[0]); - soundlatch[0]->data_pending_callback().set(m_riot, FUNC(mos6532_new_device::pa_bit_w<7>)); // MAINFLAG + soundlatch[0]->data_pending_callback().set(m_riot, FUNC(mos6532_device::pa_bit_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, soundlatch[1]); - soundlatch[1]->data_pending_callback().set(m_riot, FUNC(mos6532_new_device::pa_bit_w<6>)); // SOUNDFLAG + soundlatch[1]->data_pending_callback().set(m_riot, FUNC(mos6532_device::pa_bit_w<6>)); // SOUNDFLAG for (int i = 0; i < 4; i++) { diff --git a/src/mame/atari/starwars.cpp b/src/mame/atari/starwars.cpp index 4924cdebaea..e949cf51e47 100644 --- a/src/mame/atari/starwars.cpp +++ b/src/mame/atari/starwars.cpp @@ -148,8 +148,8 @@ void starwars_state::sound_map(address_map &map) { map(0x0000, 0x07ff).w(m_mainlatch, FUNC(generic_latch_8_device::write)); map(0x0800, 0x0fff).r(m_soundlatch, FUNC(generic_latch_8_device::read)); /* SIN Read */ - map(0x1000, 0x107f).m(m_riot, FUNC(mos6532_new_device::ram_map)); - map(0x1080, 0x109f).m(m_riot, FUNC(mos6532_new_device::io_map)); + map(0x1000, 0x107f).m(m_riot, FUNC(mos6532_device::ram_map)); + map(0x1080, 0x109f).m(m_riot, FUNC(mos6532_device::io_map)); map(0x1800, 0x183f).w(FUNC(starwars_state::quad_pokeyn_w)); map(0x2000, 0x27ff).ram(); /* program RAM */ map(0x4000, 0x7fff).rom(); /* sound roms */ @@ -287,7 +287,7 @@ void starwars_state::starwars(machine_config &config) adc.in_callback<1>().set_ioport("STICKX"); // yaw adc.in_callback<2>().set_constant(0); // thrust (unused) - MOS6532_NEW(config, m_riot, MASTER_CLOCK / 8); + MOS6532(config, m_riot, MASTER_CLOCK / 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)); @@ -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::pa_bit_w<7>)); + m_soundlatch->data_pending_callback().set(m_riot, FUNC(mos6532_device::pa_bit_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::pa_bit_w<6>)); + m_mainlatch->data_pending_callback().set(m_riot, FUNC(mos6532_device::pa_bit_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/atari/starwars.h b/src/mame/atari/starwars.h index ba0fde6920d..a6a1f2e1955 100644 --- a/src/mame/atari/starwars.h +++ b/src/mame/atari/starwars.h @@ -11,7 +11,7 @@ #pragma once #include "machine/gen_latch.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "slapstic.h" #include "machine/x2212.h" #include "sound/pokey.h" @@ -47,7 +47,7 @@ public: private: required_device m_soundlatch; required_device m_mainlatch; - required_device m_riot; + required_device m_riot; required_shared_ptr m_mathram; required_device m_maincpu; required_device m_audiocpu; diff --git a/src/mame/atari/tomcat.cpp b/src/mame/atari/tomcat.cpp index 75c90c0c23e..192d1611e61 100644 --- a/src/mame/atari/tomcat.cpp +++ b/src/mame/atari/tomcat.cpp @@ -33,7 +33,7 @@ #include "video/vector.h" #include "machine/74259.h" #include "machine/adc0808.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "machine/timekpr.h" #include "machine/nvram.h" #include "machine/watchdog.h" @@ -270,8 +270,8 @@ void tomcat_state::sound_map(address_map &map) map(0x2000, 0x2001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); map(0x3000, 0x30df).w(FUNC(tomcat_state::soundlatches_w)); map(0x30e0, 0x30e0).noprw(); // COINRD Inputs: D7 = Coin L, D6 = Coin R, D5 = SOUNDFLAG - map(0x5000, 0x507f).m("riot", FUNC(mos6532_new_device::ram_map)); - map(0x5080, 0x509f).m("riot", FUNC(mos6532_new_device::io_map)); + map(0x5000, 0x507f).m("riot", FUNC(mos6532_device::ram_map)); + map(0x5080, 0x509f).m("riot", FUNC(mos6532_device::io_map)); map(0x6000, 0x601f).rw("pokey1", FUNC(pokey_device::read), FUNC(pokey_device::write)); map(0x7000, 0x701f).rw("pokey2", FUNC(pokey_device::read), FUNC(pokey_device::write)); map(0x8000, 0xffff).noprw(); // main sound program rom @@ -330,7 +330,7 @@ void tomcat_state::tomcat(machine_config &config) m_adc->in_callback<0>().set_ioport("STICKY"); m_adc->in_callback<1>().set_ioport("STICKX"); - MOS6532_NEW(config, "riot", 14.318181_MHz_XTAL / 8); + MOS6532(config, "riot", 14.318181_MHz_XTAL / 8); /* PA0 = /WS OUTPUT (TMS-5220 WRITE STROBE) PA1 = /RS OUTPUT (TMS-5220 READ STROBE) diff --git a/src/mame/atari/tourtabl.cpp b/src/mame/atari/tourtabl.cpp index 10d704aa247..308d52810f5 100644 --- a/src/mame/atari/tourtabl.cpp +++ b/src/mame/atari/tourtabl.cpp @@ -10,7 +10,7 @@ #include "emu.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "cpu/m6502/m6507.h" #include "machine/watchdog.h" #include "sound/tiaintf.h" @@ -42,7 +42,7 @@ protected: private: required_device m_maincpu; - required_device_array m_riot; + required_device_array m_riot; required_device m_tia; required_ioport_array<6> m_tia_inputs; required_device m_screen; @@ -70,10 +70,10 @@ void tourtabl_state::tourtabl_led_w(uint8_t data) void tourtabl_state::main_map(address_map &map) { map(0x0000, 0x007f).mirror(0x0100).rw(m_tia, FUNC(tia_video_device::read), FUNC(tia_video_device::write)); - map(0x0080, 0x00ff).mirror(0x0100).m(m_riot[0], FUNC(mos6532_new_device::ram_map)); - map(0x0280, 0x029f).m(m_riot[0], FUNC(mos6532_new_device::io_map)); - map(0x0400, 0x047f).m(m_riot[1], FUNC(mos6532_new_device::ram_map)); - map(0x0500, 0x051f).m(m_riot[1], FUNC(mos6532_new_device::io_map)); + map(0x0080, 0x00ff).mirror(0x0100).m(m_riot[0], FUNC(mos6532_device::ram_map)); + map(0x0280, 0x029f).m(m_riot[0], FUNC(mos6532_device::io_map)); + map(0x0400, 0x047f).m(m_riot[1], FUNC(mos6532_device::ram_map)); + map(0x0500, 0x051f).m(m_riot[1], FUNC(mos6532_device::io_map)); map(0x0800, 0x1fff).rom(); } @@ -158,12 +158,12 @@ void tourtabl_state::tourtabl(machine_config &config) M6507(config, m_maincpu, MASTER_CLOCK / 3); m_maincpu->set_addrmap(AS_PROGRAM, &tourtabl_state::main_map); - MOS6532_NEW(config, m_riot[0], MASTER_CLOCK / 3); + MOS6532(config, m_riot[0], MASTER_CLOCK / 3); m_riot[0]->pa_rd_callback().set_ioport("RIOT0_SWA"); m_riot[0]->pb_rd_callback().set_ioport("RIOT0_SWB"); m_riot[0]->pb_wr_callback().set("watchdog", FUNC(watchdog_timer_device::reset_line_w)).bit(0); - MOS6532_NEW(config, m_riot[1], MASTER_CLOCK / 3); + MOS6532(config, m_riot[1], MASTER_CLOCK / 3); m_riot[1]->pa_rd_callback().set_ioport("RIOT1_SWA"); m_riot[1]->pb_rd_callback().set_ioport("RIOT1_SWB"); m_riot[1]->pb_wr_callback().set(FUNC(tourtabl_state::tourtabl_led_w)); diff --git a/src/mame/commodore/chessmate.cpp b/src/mame/commodore/chessmate.cpp index 4f2b00e6d47..56b683de6a7 100644 --- a/src/mame/commodore/chessmate.cpp +++ b/src/mame/commodore/chessmate.cpp @@ -45,7 +45,7 @@ MOS MPS 6332 005 2179 #include "emu.h" #include "cpu/m6502/m6504.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "sound/dac.h" #include "video/pwm.h" #include "speaker.h" @@ -83,7 +83,7 @@ protected: private: // devices/pointers required_device m_maincpu; - required_device m_miot; + required_device m_miot; required_device m_display; required_device m_dac; optional_ioport_array<5> m_inputs; @@ -176,9 +176,9 @@ void chmate_state::main_map(address_map &map) { map.global_mask(0x1fff); map(0x0000, 0x00ff).mirror(0x0100).ram(); - map(0x0b00, 0x0b0f).mirror(0x0030).m(m_miot, FUNC(mos6530_new_device::io_map)); - map(0x0b80, 0x0bbf).m(m_miot, FUNC(mos6530_new_device::ram_map)); - map(0x0c00, 0x0fff).m(m_miot, FUNC(mos6530_new_device::rom_map)); + map(0x0b00, 0x0b0f).mirror(0x0030).m(m_miot, FUNC(mos6530_device::io_map)); + map(0x0b80, 0x0bbf).m(m_miot, FUNC(mos6530_device::ram_map)); + map(0x0c00, 0x0fff).m(m_miot, FUNC(mos6530_device::rom_map)); map(0x1000, 0x1fff).rom(); } @@ -264,7 +264,7 @@ void chmate_state::chmate(machine_config &config) M6504(config, m_maincpu, 8_MHz_XTAL/8); m_maincpu->set_addrmap(AS_PROGRAM, &chmate_state::main_map); - MOS6530_NEW(config, m_miot, 8_MHz_XTAL/8); + MOS6530(config, m_miot, 8_MHz_XTAL/8); m_miot->pa_rd_callback().set(FUNC(chmate_state::input_r)); m_miot->pa_wr_callback().set(FUNC(chmate_state::digit_w)); m_miot->pb_wr_callback().set(FUNC(chmate_state::control_w)); diff --git a/src/mame/commodore/kim1.cpp b/src/mame/commodore/kim1.cpp index 918d456c321..caccdc99b3d 100644 --- a/src/mame/commodore/kim1.cpp +++ b/src/mame/commodore/kim1.cpp @@ -69,7 +69,7 @@ TODO: #include "cpu/m6502/m6502.h" #include "formats/kim1_cas.h" #include "imagedev/cassette.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "machine/timer.h" #include "video/pwm.h" @@ -108,7 +108,7 @@ protected: private: required_device m_maincpu; - required_device_array m_miot; + required_device_array m_miot; required_device m_digit_pwm; required_device m_cass; required_ioport_array<3> m_row; @@ -252,12 +252,12 @@ void kim1_state::mem_map(address_map &map) { map.global_mask(0x1fff); map(0x0000, 0x03ff).ram(); - map(0x1700, 0x170f).mirror(0x0030).m(m_miot[1], FUNC(mos6530_new_device::io_map)); - map(0x1740, 0x174f).mirror(0x0030).m(m_miot[0], FUNC(mos6530_new_device::io_map)); - map(0x1780, 0x17bf).m(m_miot[1], FUNC(mos6530_new_device::ram_map)); - map(0x17c0, 0x17ff).m(m_miot[0], FUNC(mos6530_new_device::ram_map)); - map(0x1800, 0x1bff).m(m_miot[1], FUNC(mos6530_new_device::rom_map)); - map(0x1c00, 0x1fff).m(m_miot[0], FUNC(mos6530_new_device::rom_map)); + map(0x1700, 0x170f).mirror(0x0030).m(m_miot[1], FUNC(mos6530_device::io_map)); + map(0x1740, 0x174f).mirror(0x0030).m(m_miot[0], FUNC(mos6530_device::io_map)); + map(0x1780, 0x17bf).m(m_miot[1], FUNC(mos6530_device::ram_map)); + map(0x17c0, 0x17ff).m(m_miot[0], FUNC(mos6530_device::ram_map)); + map(0x1800, 0x1bff).m(m_miot[1], FUNC(mos6530_device::rom_map)); + map(0x1c00, 0x1fff).m(m_miot[0], FUNC(mos6530_device::rom_map)); } void kim1_state::sync_map(address_map &map) @@ -323,13 +323,13 @@ void kim1_state::kim1(machine_config &config) config.set_default_layout(layout_kim1); // devices - MOS6530_NEW(config, m_miot[0], 1_MHz_XTAL); // U2 + MOS6530(config, m_miot[0], 1_MHz_XTAL); // U2 m_miot[0]->pa_rd_callback().set(FUNC(kim1_state::u2_read_a)); m_miot[0]->pa_wr_callback().set(FUNC(kim1_state::u2_write_a)); m_miot[0]->pb_rd_callback().set(FUNC(kim1_state::u2_read_b)); m_miot[0]->pb_wr_callback().set(FUNC(kim1_state::u2_write_b)); - MOS6530_NEW(config, m_miot[1], 1_MHz_XTAL); // U3 + MOS6530(config, m_miot[1], 1_MHz_XTAL); // U3 CASSETTE(config, m_cass); m_cass->set_formats(kim1_cassette_formats); diff --git a/src/mame/elektor/junior.cpp b/src/mame/elektor/junior.cpp index 5e58c38116e..e761e73a6c7 100644 --- a/src/mame/elektor/junior.cpp +++ b/src/mame/elektor/junior.cpp @@ -38,7 +38,7 @@ To Do: #include "emu.h" #include "cpu/m6502/m6502.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "machine/timer.h" #include "video/pwm.h" #include "junior.lh" @@ -72,7 +72,7 @@ private: void mem_map(address_map &map); - required_device m_riot; + required_device m_riot; required_device m_maincpu; required_device m_display; required_ioport_array<4> m_io_keyboard; @@ -86,8 +86,8 @@ void junior_state::mem_map(address_map &map) map.global_mask(0x1FFF); map.unmap_value_high(); map(0x0000, 0x03ff).ram(); // 1K RAM - map(0x1a00, 0x1a7f).m(m_riot, FUNC(mos6532_new_device::ram_map)); - map(0x1a80, 0x1a9f).m(m_riot, FUNC(mos6532_new_device::io_map)); + map(0x1a00, 0x1a7f).m(m_riot, FUNC(mos6532_device::ram_map)); + map(0x1a80, 0x1a9f).m(m_riot, FUNC(mos6532_device::io_map)); map(0x1c00, 0x1fff).rom().region("maincpu", 0); // Monitor } @@ -203,7 +203,7 @@ void junior_state::junior(machine_config &config) m_display->set_segmask(0x3f0, 0x7f); /* Devices */ - MOS6532_NEW(config, m_riot, 1_MHz_XTAL); + MOS6532(config, m_riot, 1_MHz_XTAL); m_riot->pa_rd_callback().set(FUNC(junior_state::riot_a_r)); m_riot->pa_wr_callback().set(FUNC(junior_state::riot_a_w)); m_riot->pb_wr_callback().set(FUNC(junior_state::riot_b_w)); diff --git a/src/mame/pinball/allied.cpp b/src/mame/pinball/allied.cpp index 35333ba828b..b39ffceb1dd 100644 --- a/src/mame/pinball/allied.cpp +++ b/src/mame/pinball/allied.cpp @@ -47,7 +47,7 @@ ToDo: #include "cpu/m6502/m6504.h" #include "machine/input_merger.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "machine/6821pia.h" #include "machine/timer.h" @@ -116,10 +116,10 @@ private: required_device m_maincpu; required_device m_ic1; required_device m_ic2; - required_device m_ic3; + required_device m_ic3; required_device m_ic4; - required_device m_ic5; - required_device m_ic6; + required_device m_ic5; + required_device m_ic6; required_device m_ic7; required_device m_ic8; output_finder<42> m_digits; @@ -130,18 +130,18 @@ private: void allied_state::mem_map(address_map &map) { - map(0x0000, 0x003f).m(m_ic6, FUNC(mos6530_new_device::ram_map)); + map(0x0000, 0x003f).m(m_ic6, FUNC(mos6530_device::ram_map)); map(0x0044, 0x0047).rw(m_ic2, FUNC(pia6821_device::read), FUNC(pia6821_device::write)); map(0x0048, 0x004b).rw(m_ic1, FUNC(pia6821_device::read), FUNC(pia6821_device::write)); map(0x0050, 0x0053).rw(m_ic7, FUNC(pia6821_device::read), FUNC(pia6821_device::write)); map(0x0060, 0x0063).rw(m_ic4, FUNC(pia6821_device::read), FUNC(pia6821_device::write)); - map(0x0080, 0x008f).m(m_ic5, FUNC(mos6530_new_device::io_map)); - map(0x0840, 0x084f).m(m_ic6, FUNC(mos6530_new_device::io_map)); + map(0x0080, 0x008f).m(m_ic5, FUNC(mos6530_device::io_map)); + map(0x0840, 0x084f).m(m_ic6, FUNC(mos6530_device::io_map)); map(0x00c0, 0x00c3).rw(m_ic8, FUNC(pia6821_device::read), FUNC(pia6821_device::write)); - map(0x0100, 0x013f).m(m_ic5, FUNC(mos6530_new_device::ram_map)); - map(0x1400, 0x17ff).m(m_ic5, FUNC(mos6530_new_device::rom_map)); - map(0x1800, 0x1bff).m(m_ic6, FUNC(mos6530_new_device::rom_map)); - map(0x1c00, 0x1fff).m(m_ic3, FUNC(mos6530_new_device::rom_map)); + map(0x0100, 0x013f).m(m_ic5, FUNC(mos6530_device::ram_map)); + map(0x1400, 0x17ff).m(m_ic5, FUNC(mos6530_device::rom_map)); + map(0x1800, 0x1bff).m(m_ic6, FUNC(mos6530_device::rom_map)); + map(0x1c00, 0x1fff).m(m_ic3, FUNC(mos6530_device::rom_map)); } static INPUT_PORTS_START( allied ) @@ -726,17 +726,17 @@ void allied_state::allied(machine_config &config) m_ic8->irqa_handler().set("main_irqs", FUNC(input_merger_device::in_w<8>)); m_ic8->irqb_handler().set("main_irqs", FUNC(input_merger_device::in_w<9>)); - MOS6530_NEW(config, m_ic3, 3.579545_MHz_XTAL/4); // unknown where the ram and i/o is located + MOS6530(config, m_ic3, 3.579545_MHz_XTAL/4); // unknown where the ram and i/o is located m_ic3->irq_wr_callback().set("main_irqs", FUNC(input_merger_device::in_w<10>)); - MOS6530_NEW(config, m_ic5, 3.579545_MHz_XTAL/4); + MOS6530(config, m_ic5, 3.579545_MHz_XTAL/4); m_ic5->pa_rd_callback().set(FUNC(allied_state::ic5_a_r)); //m_ic5->pa_wr_callback().set(FUNC(allied_state::ic5_a_w)); //m_ic5->pb_rd_callback().set(FUNC(allied_state::ic5_b_r)); m_ic5->pb_wr_callback().set(FUNC(allied_state::ic5_b_w)); m_ic5->irq_wr_callback().set("main_irqs", FUNC(input_merger_device::in_w<11>)); - MOS6530_NEW(config, m_ic6, 3.579545_MHz_XTAL/4); + MOS6530(config, m_ic6, 3.579545_MHz_XTAL/4); m_ic6->pa_rd_callback().set(FUNC(allied_state::ic6_a_r)); //m_ic6->pa_wr_callback().set(FUNC(allied_state::ic6_a_w)); m_ic6->pb_rd_callback().set(FUNC(allied_state::ic6_b_r)); diff --git a/src/mame/pinball/gts80.cpp b/src/mame/pinball/gts80.cpp index be0e3252d14..eeeb6d36a3a 100644 --- a/src/mame/pinball/gts80.cpp +++ b/src/mame/pinball/gts80.cpp @@ -101,9 +101,9 @@ private: u8 m_sol_state[9][2]{}; required_device m_maincpu; - required_device m_riot1; - required_device m_riot2; - required_device m_riot3; + required_device m_riot1; + required_device m_riot2; + required_device m_riot3; required_ioport_array<4> m_io_dips; required_ioport_array<9> m_io_keyboard; optional_device m_p2_sound; @@ -115,13 +115,13 @@ private: void gts80_state::gts80_map(address_map &map) { map.global_mask(0x3fff); - map(0x0000, 0x007f).m(m_riot1, FUNC(mos6532_new_device::ram_map)); - map(0x0080, 0x00ff).m(m_riot2, FUNC(mos6532_new_device::ram_map)); - map(0x0100, 0x017f).m(m_riot3, FUNC(mos6532_new_device::ram_map)); + map(0x0000, 0x007f).m(m_riot1, FUNC(mos6532_device::ram_map)); + map(0x0080, 0x00ff).m(m_riot2, FUNC(mos6532_device::ram_map)); + map(0x0100, 0x017f).m(m_riot3, FUNC(mos6532_device::ram_map)); map(0x01cb, 0x01cb).lr8(NAME([] () { return 0xff; })); // continual read - map(0x0200, 0x021f).mirror(0x0060).m(m_riot1, FUNC(mos6532_new_device::io_map)); - map(0x0280, 0x029f).mirror(0x0060).m(m_riot2, FUNC(mos6532_new_device::io_map)); - map(0x0300, 0x031f).mirror(0x0060).m(m_riot3, FUNC(mos6532_new_device::io_map)); + map(0x0200, 0x021f).mirror(0x0060).m(m_riot1, FUNC(mos6532_device::io_map)); + map(0x0280, 0x029f).mirror(0x0060).m(m_riot2, FUNC(mos6532_device::io_map)); + map(0x0300, 0x031f).mirror(0x0060).m(m_riot3, FUNC(mos6532_device::io_map)); map(0x1000, 0x17ff).rom(); map(0x1800, 0x18ff).ram().share("nvram"); // 5101L-1 256x4 map(0x2000, 0x2fff).rom(); @@ -515,18 +515,18 @@ void gts80_state::p0(machine_config &config) config.set_default_layout(layout_gts80); /* Devices */ - MOS6532_NEW(config, m_riot1, XTAL(3'579'545)/4); + MOS6532(config, m_riot1, XTAL(3'579'545)/4); m_riot1->pa_rd_callback().set(FUNC(gts80_state::port1a_r)); // sw_r m_riot1->pb_wr_callback().set(FUNC(gts80_state::port1b_w)); // sw_w m_riot1->irq_wr_callback().set("irq", FUNC(input_merger_device::in_w<0>)); - MOS6532_NEW(config, m_riot2, XTAL(3'579'545)/4); + MOS6532(config, m_riot2, XTAL(3'579'545)/4); m_riot2->pa_rd_callback().set(FUNC(gts80_state::port2a_r)); // pa7 - slam tilt m_riot2->pa_wr_callback().set(FUNC(gts80_state::port2a_w)); // digit select m_riot2->pb_wr_callback().set(FUNC(gts80_state::port2b_w)); // seg m_riot2->irq_wr_callback().set("irq", FUNC(input_merger_device::in_w<1>)); - MOS6532_NEW(config, m_riot3, XTAL(3'579'545)/4); + MOS6532(config, m_riot3, XTAL(3'579'545)/4); m_riot3->pa_wr_callback().set(FUNC(gts80_state::port3a_w)); // sol, snd m_riot3->pb_wr_callback().set(FUNC(gts80_state::port3b_w)); // lamps m_riot3->irq_wr_callback().set("irq", FUNC(input_merger_device::in_w<2>)); diff --git a/src/mame/pinball/gts80a.cpp b/src/mame/pinball/gts80a.cpp index 99436b9ff0d..7ca52c601af 100644 --- a/src/mame/pinball/gts80a.cpp +++ b/src/mame/pinball/gts80a.cpp @@ -113,9 +113,9 @@ private: u8 m_sol_state[9][2]{}; required_device m_maincpu; - required_device m_riot1; - required_device m_riot2; - required_device m_riot3; + required_device m_riot1; + required_device m_riot2; + required_device m_riot3; required_ioport_array<4> m_io_dips; required_ioport_array<9> m_io_keyboard; optional_device m_p2_sound; @@ -128,13 +128,13 @@ private: void gts80a_state::gts80a_map(address_map &map) { map.global_mask(0x3fff); - map(0x0000, 0x007f).m(m_riot1, FUNC(mos6532_new_device::ram_map)); - map(0x0080, 0x00ff).m(m_riot2, FUNC(mos6532_new_device::ram_map)); - map(0x0100, 0x017f).m(m_riot3, FUNC(mos6532_new_device::ram_map)); + map(0x0000, 0x007f).m(m_riot1, FUNC(mos6532_device::ram_map)); + map(0x0080, 0x00ff).m(m_riot2, FUNC(mos6532_device::ram_map)); + map(0x0100, 0x017f).m(m_riot3, FUNC(mos6532_device::ram_map)); map(0x01cb, 0x01cb).lr8(NAME([] () { return 0xff; })); // continual read - map(0x0200, 0x021f).mirror(0x0060).m(m_riot1, FUNC(mos6532_new_device::io_map)); - map(0x0280, 0x029f).mirror(0x0060).m(m_riot2, FUNC(mos6532_new_device::io_map)); - map(0x0300, 0x031f).mirror(0x0060).m(m_riot3, FUNC(mos6532_new_device::io_map)); + map(0x0200, 0x021f).mirror(0x0060).m(m_riot1, FUNC(mos6532_device::io_map)); + map(0x0280, 0x029f).mirror(0x0060).m(m_riot2, FUNC(mos6532_device::io_map)); + map(0x0300, 0x031f).mirror(0x0060).m(m_riot3, FUNC(mos6532_device::io_map)); map(0x1000, 0x17ff).rom(); map(0x1800, 0x18ff).ram().share("nvram"); // 5101L-1 256x4 map(0x2000, 0x2fff).rom(); @@ -534,18 +534,18 @@ void gts80a_state::p0(machine_config &config) config.set_default_layout(layout_gts80a); /* Devices */ - MOS6532_NEW(config, m_riot1, XTAL(3'579'545)/4); + MOS6532(config, m_riot1, XTAL(3'579'545)/4); m_riot1->pa_rd_callback().set(FUNC(gts80a_state::port1a_r)); // sw_r m_riot1->pb_wr_callback().set(FUNC(gts80a_state::port1b_w)); // sw_w m_riot1->irq_wr_callback().set("irq", FUNC(input_merger_device::in_w<0>)); - MOS6532_NEW(config, m_riot2, XTAL(3'579'545)/4); + MOS6532(config, m_riot2, XTAL(3'579'545)/4); m_riot2->pa_rd_callback().set(FUNC(gts80a_state::port2a_r)); // pa7 - slam tilt m_riot2->pa_wr_callback().set(FUNC(gts80a_state::port2a_w)); // digit select m_riot2->pb_wr_callback().set(FUNC(gts80a_state::port2b_w)); // seg m_riot2->irq_wr_callback().set("irq", FUNC(input_merger_device::in_w<1>)); - MOS6532_NEW(config, m_riot3, XTAL(3'579'545)/4); + MOS6532(config, m_riot3, XTAL(3'579'545)/4); m_riot3->pa_wr_callback().set(FUNC(gts80a_state::port3a_w)); // sol, snd m_riot3->pb_wr_callback().set(FUNC(gts80a_state::port3b_w)); // lamps m_riot3->irq_wr_callback().set("irq", FUNC(input_merger_device::in_w<2>)); diff --git a/src/mame/pinball/gts80b.cpp b/src/mame/pinball/gts80b.cpp index cbc12d9eca4..d3f11d247d5 100644 --- a/src/mame/pinball/gts80b.cpp +++ b/src/mame/pinball/gts80b.cpp @@ -7,7 +7,7 @@ Gottlieb System 80B Same as system 80, except that the displays are 20-digit alphanumeric driven by Rockwell 10939/10941 chips. -The test rom says U4 is faulty. Using MOS6532_NEW fixes this error, but the games ramdomly slam-tilt instead. +The test rom says U4 is faulty. Using MOS6532 fixes this error, but the games ramdomly slam-tilt instead. PinMAME used for the display character generator. @@ -132,9 +132,9 @@ private: bool m_slam_low = false; required_device m_maincpu; - required_device m_riot1; - required_device m_riot2; - required_device m_riot3; + required_device m_riot1; + required_device m_riot2; + required_device m_riot3; required_ioport_array<4> m_io_dips; required_ioport_array<9> m_io_keyboard; optional_device m_p3_sound; @@ -149,13 +149,13 @@ private: void gts80b_state::gts80b_map(address_map &map) { map.global_mask(0xbfff); - map(0x0000, 0x007f).mirror(0x8000).m(m_riot1, FUNC(mos6532_new_device::ram_map)); - map(0x0080, 0x00ff).mirror(0x8000).m(m_riot2, FUNC(mos6532_new_device::ram_map)); - map(0x0100, 0x017f).mirror(0x8000).m(m_riot3, FUNC(mos6532_new_device::ram_map)); + map(0x0000, 0x007f).mirror(0x8000).m(m_riot1, FUNC(mos6532_device::ram_map)); + map(0x0080, 0x00ff).mirror(0x8000).m(m_riot2, FUNC(mos6532_device::ram_map)); + map(0x0100, 0x017f).mirror(0x8000).m(m_riot3, FUNC(mos6532_device::ram_map)); map(0x01cb, 0x01cb).lr8(NAME([] () { return 0xff; })); // continual read - map(0x0200, 0x021f).mirror(0x8060).m(m_riot1, FUNC(mos6532_new_device::io_map)); - map(0x0280, 0x029f).mirror(0x8060).m(m_riot2, FUNC(mos6532_new_device::io_map)); - map(0x0300, 0x031f).mirror(0x8060).m(m_riot3, FUNC(mos6532_new_device::io_map)); + map(0x0200, 0x021f).mirror(0x8060).m(m_riot1, FUNC(mos6532_device::io_map)); + map(0x0280, 0x029f).mirror(0x8060).m(m_riot2, FUNC(mos6532_device::io_map)); + map(0x0300, 0x031f).mirror(0x8060).m(m_riot3, FUNC(mos6532_device::io_map)); map(0x1000, 0x17ff).rom(); map(0x1800, 0x18ff).mirror(0x8000).ram().share("nvram"); // 5101L-1 256x4 map(0x2000, 0x2fff).rom(); @@ -167,13 +167,13 @@ void gts80b_state::gts80b_map(address_map &map) void gts80b_state::master_map(address_map &map) { map(0x0000, 0x7fff).mirror(0x8000).rom(); - map(0x0000, 0x007f).mirror(0x8000).m(m_riot1, FUNC(mos6532_new_device::ram_map)); - map(0x0080, 0x00ff).mirror(0x8000).m(m_riot2, FUNC(mos6532_new_device::ram_map)); - map(0x0100, 0x017f).mirror(0x8000).m(m_riot3, FUNC(mos6532_new_device::ram_map)); + map(0x0000, 0x007f).mirror(0x8000).m(m_riot1, FUNC(mos6532_device::ram_map)); + map(0x0080, 0x00ff).mirror(0x8000).m(m_riot2, FUNC(mos6532_device::ram_map)); + map(0x0100, 0x017f).mirror(0x8000).m(m_riot3, FUNC(mos6532_device::ram_map)); map(0x01cb, 0x01cb).lr8(NAME([] () { return 0xff; })); // continual read - map(0x0200, 0x021f).mirror(0x8060).m(m_riot1, FUNC(mos6532_new_device::io_map)); - map(0x0280, 0x029f).mirror(0x8060).m(m_riot2, FUNC(mos6532_new_device::io_map)); - map(0x0300, 0x031f).mirror(0x8060).m(m_riot3, FUNC(mos6532_new_device::io_map)); + map(0x0200, 0x021f).mirror(0x8060).m(m_riot1, FUNC(mos6532_device::io_map)); + map(0x0280, 0x029f).mirror(0x8060).m(m_riot2, FUNC(mos6532_device::io_map)); + map(0x0300, 0x031f).mirror(0x8060).m(m_riot3, FUNC(mos6532_device::io_map)); map(0x1800, 0x18ff).mirror(0x8000).ram().share("nvram"); // 5101L-1 256x4 } @@ -618,18 +618,18 @@ void gts80b_state::p0(machine_config &config) config.set_default_layout(layout_gts80b); /* Devices */ - MOS6532_NEW(config, m_riot1, XTAL(3'579'545)/4); + MOS6532(config, m_riot1, XTAL(3'579'545)/4); m_riot1->pa_rd_callback().set(FUNC(gts80b_state::port1a_r)); // sw_r m_riot1->pb_wr_callback().set(FUNC(gts80b_state::port1b_w)); // sw_w m_riot1->irq_wr_callback().set("irq", FUNC(input_merger_device::in_w<0>)); - MOS6532_NEW(config, m_riot2, XTAL(3'579'545)/4); + MOS6532(config, m_riot2, XTAL(3'579'545)/4); m_riot2->pa_rd_callback().set(FUNC(gts80b_state::port2a_r)); // pa7 - slam tilt m_riot2->pa_wr_callback().set(FUNC(gts80b_state::port2a_w)); // digit select m_riot2->pb_wr_callback().set(FUNC(gts80b_state::port2b_w)); // seg m_riot2->irq_wr_callback().set("irq", FUNC(input_merger_device::in_w<1>)); - MOS6532_NEW(config, m_riot3, XTAL(3'579'545)/4); + MOS6532(config, m_riot3, XTAL(3'579'545)/4); m_riot3->pa_wr_callback().set(FUNC(gts80b_state::port3a_w)); // sol, snd m_riot3->pb_wr_callback().set(FUNC(gts80b_state::port3b_w)); // lamps m_riot3->irq_wr_callback().set("irq", FUNC(input_merger_device::in_w<2>)); diff --git a/src/mame/pinball/spectra.cpp b/src/mame/pinball/spectra.cpp index 6e1e9f81c85..583ca51ca88 100644 --- a/src/mame/pinball/spectra.cpp +++ b/src/mame/pinball/spectra.cpp @@ -41,7 +41,7 @@ ToDo: #include "genpin.h" #include "cpu/m6502/m6503.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "machine/timer.h" #include "sound/sn76477.h" #include "speaker.h" @@ -85,7 +85,7 @@ private: u8 m_out_offs = 0U; required_device m_maincpu; - required_device m_riot; + required_device m_riot; required_device m_snsnd; required_ioport_array<4> m_io_keyboard; required_shared_ptr m_p_ram; @@ -98,8 +98,8 @@ void spectra_state::spectra_map(address_map &map) { map.unmap_value_high(); map(0x0000, 0x00ff).ram().share("nvram"); // battery backed, 2x 5101L - map(0x0100, 0x017f).m(m_riot, FUNC(mos6532_new_device::ram_map)); - map(0x0180, 0x019f).m(m_riot, FUNC(mos6532_new_device::io_map)); + map(0x0100, 0x017f).m(m_riot, FUNC(mos6532_device::ram_map)); + map(0x0180, 0x019f).m(m_riot, FUNC(mos6532_device::io_map)); map(0x0400, 0x0fff).rom(); } @@ -271,7 +271,7 @@ void spectra_state::spectra(machine_config &config) M6503(config, m_maincpu, XTAL(3'579'545)/4); m_maincpu->set_addrmap(AS_PROGRAM, &spectra_state::spectra_map); - MOS6532_NEW(config, m_riot, XTAL(3'579'545)/4); + MOS6532(config, m_riot, XTAL(3'579'545)/4); m_riot->pa_rd_callback().set(FUNC(spectra_state::porta_r)); m_riot->pa_wr_callback().set(FUNC(spectra_state::porta_w)); m_riot->pb_rd_callback().set(FUNC(spectra_state::portb_r)); diff --git a/src/mame/pitronics/beta.cpp b/src/mame/pitronics/beta.cpp index 20f838f8047..50be23a04eb 100644 --- a/src/mame/pitronics/beta.cpp +++ b/src/mame/pitronics/beta.cpp @@ -34,7 +34,7 @@ #include "cpu/m6502/m6502.h" #include "imagedev/floppy.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "machine/ram.h" #include "sound/spkrdev.h" @@ -113,8 +113,8 @@ private: void beta_state::beta_mem(address_map &map) { - map(0x0000, 0x007f).mirror(0x7f00).m(M6532_TAG, FUNC(mos6532_new_device::ram_map)); - map(0x0080, 0x00ff).mirror(0x7f00).m(M6532_TAG, FUNC(mos6532_new_device::io_map)); + map(0x0000, 0x007f).mirror(0x7f00).m(M6532_TAG, FUNC(mos6532_device::ram_map)); + map(0x0080, 0x00ff).mirror(0x7f00).m(M6532_TAG, FUNC(mos6532_device::io_map)); map(0x8000, 0x87ff).mirror(0x7800).rom(); } @@ -360,7 +360,7 @@ void beta_state::beta(machine_config &config) SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.25); /* devices */ - mos6532_new_device &m6532(MOS6532_NEW(config, M6532_TAG, XTAL(4'000'000)/4)); + mos6532_device &m6532(MOS6532(config, M6532_TAG, XTAL(4'000'000)/4)); m6532.pa_rd_callback().set(FUNC(beta_state::riot_pa_r)); m6532.pa_wr_callback().set(FUNC(beta_state::riot_pa_w)); m6532.pb_rd_callback().set(FUNC(beta_state::riot_pb_r)); diff --git a/src/mame/rockwell/aim65.cpp b/src/mame/rockwell/aim65.cpp index b4fc72b8b15..fd931234106 100644 --- a/src/mame/rockwell/aim65.cpp +++ b/src/mame/rockwell/aim65.cpp @@ -50,8 +50,8 @@ void aim65_state::mem_map(address_map &map) map(0x4000, 0x7fff).rom(); /* 4 ROM sockets in 16K PROM/ROM module */ map(0x8000, 0x9fff).noprw(); /* User available expansions */ map(0xa000, 0xa00f).mirror(0x3f0).m(m_via1, FUNC(via6522_device::map)); // user via - map(0xa400, 0xa47f).m(m_riot, FUNC(mos6532_new_device::ram_map)); - map(0xa480, 0xa497).m(m_riot, FUNC(mos6532_new_device::io_map)); + map(0xa400, 0xa47f).m(m_riot, FUNC(mos6532_device::ram_map)); + map(0xa480, 0xa497).m(m_riot, FUNC(mos6532_device::io_map)); map(0xa498, 0xa7ff).noprw(); /* Not available */ map(0xa800, 0xa80f).mirror(0x3f0).m(m_via0, FUNC(via6522_device::map)); // system via map(0xac00, 0xac03).rw(m_pia, FUNC(pia6821_device::read), FUNC(pia6821_device::write)); @@ -246,7 +246,7 @@ void aim65_state::aim65(machine_config &config) SPEAKER(config, "mono").front_center(); /* other devices */ - MOS6532_NEW(config, m_riot, AIM65_CLOCK); + MOS6532(config, m_riot, AIM65_CLOCK); m_riot->pa_wr_callback().set([this] (u8 data) { m_riot_port_a = data; }); m_riot->pb_rd_callback().set([this] () { return aim65_state::z33_pb_r(); }); m_riot->irq_wr_callback().set_inputline(m_maincpu, M6502_IRQ_LINE); diff --git a/src/mame/rockwell/aim65.h b/src/mame/rockwell/aim65.h index b9ed9a91779..1f5bf08ac60 100644 --- a/src/mame/rockwell/aim65.h +++ b/src/mame/rockwell/aim65.h @@ -19,7 +19,7 @@ #include "bus/rs232/rs232.h" #include "machine/6522via.h" #include "machine/6821pia.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "machine/ram.h" #include "video/dl1416.h" #include "emupal.h" @@ -125,7 +125,7 @@ private: required_device m_via0; required_device m_via1; required_device m_pia; - required_device m_riot; + required_device m_riot; required_ioport_array<8> m_io_keyboard; }; diff --git a/src/mame/shared/exidysound.cpp b/src/mame/shared/exidysound.cpp index 521ea98afed..30071c2fb2e 100644 --- a/src/mame/shared/exidysound.cpp +++ b/src/mame/shared/exidysound.cpp @@ -624,8 +624,8 @@ void venture_sound_device::filter_w(uint8_t data) void venture_sound_device::venture_audio_map(address_map &map) { map.global_mask(0x7fff); - map(0x0000, 0x007f).mirror(0x0780).m(m_riot, FUNC(mos6532_new_device::ram_map)); - map(0x0800, 0x081f).mirror(0x07e0).m(m_riot, FUNC(mos6532_new_device::io_map)); + map(0x0000, 0x007f).mirror(0x0780).m(m_riot, FUNC(mos6532_device::ram_map)); + map(0x0800, 0x081f).mirror(0x07e0).m(m_riot, FUNC(mos6532_device::io_map)); map(0x1000, 0x1003).mirror(0x07fc).rw(m_pia, FUNC(pia6821_device::read), FUNC(pia6821_device::write)); map(0x1800, 0x1803).mirror(0x07fc).w(FUNC(venture_sound_device::sh8253_w)).nopr(); // no /RD map(0x2000, 0x2000).mirror(0x07ff).w(FUNC(venture_sound_device::filter_w)); @@ -644,7 +644,7 @@ void venture_sound_device::device_add_mconfig(machine_config &config) m6502_device &audiocpu(M6502(config, "audiocpu", 3.579545_MHz_XTAL / 4)); audiocpu.set_addrmap(AS_PROGRAM, &venture_sound_device::venture_audio_map); - MOS6532_NEW(config, m_riot, SH6532_CLOCK); + MOS6532(config, m_riot, SH6532_CLOCK); m_riot->irq_wr_callback().set("audioirq", FUNC(input_merger_device::in_w<0>)); PIA6821(config, m_pia, 0); @@ -915,9 +915,9 @@ void victory_sound_device::main_ack_w(int state) void victory_sound_device::victory_audio_map(address_map &map) { - map(0x0000, 0x007f).mirror(0x0f00).m(m_riot, FUNC(mos6532_new_device::ram_map)); + map(0x0000, 0x007f).mirror(0x0f00).m(m_riot, FUNC(mos6532_device::ram_map)); map(0x0080, 0x00ff).mirror(0x0f00).ram(); - map(0x1000, 0x101f).mirror(0x0fe0).m(m_riot, FUNC(mos6532_new_device::io_map)); + map(0x1000, 0x101f).mirror(0x0fe0).m(m_riot, FUNC(mos6532_device::io_map)); map(0x2000, 0x2003).mirror(0x0ffc).rw(m_pia, FUNC(pia6821_device::read), FUNC(pia6821_device::write)); map(0x3000, 0x3003).mirror(0x0ffc).w(FUNC(victory_sound_device::sh8253_w)).nopr(); // no /RD map(0x4000, 0x4fff).noprw(); @@ -937,7 +937,7 @@ void victory_sound_device::device_add_mconfig(machine_config &config) m6502_device &audiocpu(M6502(config, "audiocpu", 3.579545_MHz_XTAL / 4)); audiocpu.set_addrmap(AS_PROGRAM, &victory_sound_device::victory_audio_map); - MOS6532_NEW(config, m_riot, SH6532_CLOCK); + MOS6532(config, m_riot, SH6532_CLOCK); m_riot->pa_wr_callback().set(m_tms, FUNC(tms5220_device::data_w)); m_riot->pa_rd_callback().set(m_tms, FUNC(tms5220_device::status_r)); m_riot->pb_wr_callback<0>().set(m_tms, FUNC(tms5220_device::rsq_w)); diff --git a/src/mame/shared/exidysound.h b/src/mame/shared/exidysound.h index 0aeb03cf488..2f2cfde28db 100644 --- a/src/mame/shared/exidysound.h +++ b/src/mame/shared/exidysound.h @@ -6,7 +6,7 @@ #pragma once #include "machine/6821pia.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "machine/timer.h" #include "sound/flt_biquad.h" #include "sound/hc55516.h" @@ -111,7 +111,7 @@ protected: sh8253_timer_channel m_sh8253_timer[3]; - required_device m_riot; + required_device m_riot; required_device m_pia; }; diff --git a/src/mame/shared/gottlieb_a.cpp b/src/mame/shared/gottlieb_a.cpp index c4d0e04c604..a97ec995c0e 100644 --- a/src/mame/shared/gottlieb_a.cpp +++ b/src/mame/shared/gottlieb_a.cpp @@ -87,10 +87,10 @@ void gottlieb_sound_p2_device::write(u8 data) void gottlieb_sound_p2_device::p2_map(address_map &map) { map.unmap_value_high(); - map(0x0000, 0x003f).mirror(0x1c0).m(m_r6530, FUNC(mos6530_new_device::ram_map)); - map(0x0200, 0x020f).mirror(0x1f0).m(m_r6530, FUNC(mos6530_new_device::io_map)); + map(0x0000, 0x003f).mirror(0x1c0).m(m_r6530, FUNC(mos6530_device::ram_map)); + map(0x0200, 0x020f).mirror(0x1f0).m(m_r6530, FUNC(mos6530_device::io_map)); map(0x0400, 0x07ff).rom(); - map(0x0c00, 0x0fff).m(m_r6530, FUNC(mos6530_new_device::rom_map)); + map(0x0c00, 0x0fff).m(m_r6530, FUNC(mos6530_device::rom_map)); } @@ -135,7 +135,7 @@ void gottlieb_sound_p2_device::device_add_mconfig(machine_config &config) m_cpu->set_addrmap(AS_PROGRAM, &gottlieb_sound_p2_device::p2_map); // I/O configuration - MOS6530_NEW(config, m_r6530, 800'000); // same as cpu + MOS6530(config, m_r6530, 800'000); // same as cpu m_r6530->pa_wr_callback().set("dac", FUNC(dac_byte_interface::data_w)); // sound devices @@ -308,8 +308,8 @@ void gottlieb_sound_r1_device::r1_map(address_map &map) // A15 not decoded except in expansion socket map.global_mask(0x7fff); map.unmap_value_high(); - map(0x0000, 0x007f).mirror(0x0d80).m(m_riot, FUNC(mos6532_new_device::ram_map)); - map(0x0200, 0x021f).mirror(0x0de0).m(m_riot, FUNC(mos6532_new_device::io_map)); + map(0x0000, 0x007f).mirror(0x0d80).m(m_riot, FUNC(mos6532_device::ram_map)); + map(0x0200, 0x021f).mirror(0x0de0).m(m_riot, FUNC(mos6532_device::io_map)); map(0x1000, 0x1000).mirror(0x0fff).w("dac", FUNC(dac_byte_interface::data_w)); map(0x6000, 0x7fff).rom(); } @@ -352,7 +352,7 @@ void gottlieb_sound_r1_device::device_add_mconfig(machine_config &config) INPUT_MERGER_ANY_HIGH(config, "nmi").output_handler().set_inputline("audiocpu", INPUT_LINE_NMI); // I/O configuration - MOS6532_NEW(config, m_riot, SOUND1_CLOCK/4); + MOS6532(config, m_riot, SOUND1_CLOCK/4); m_riot->pb_rd_callback().set_ioport("SB1"); m_riot->pb_wr_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_wr_callback().set_inputline("audiocpu", M6502_IRQ_LINE); diff --git a/src/mame/shared/gottlieb_a.h b/src/mame/shared/gottlieb_a.h index 92019250482..2786273fa0b 100644 --- a/src/mame/shared/gottlieb_a.h +++ b/src/mame/shared/gottlieb_a.h @@ -8,7 +8,7 @@ #include "cpu/m6502/m6502.h" #include "cpu/m6502/m6503.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "sound/ay8910.h" #include "sound/dac.h" #include "sound/okim6295.h" @@ -63,7 +63,7 @@ protected: // devices required_device m_cpu; - required_device m_r6530; + required_device m_r6530; private: u8 m_dummy; // needed for save-state support @@ -121,7 +121,7 @@ protected: // devices required_device m_dac; - required_device m_riot; + required_device m_riot; private: u8 m_dummy; // needed for save-state support diff --git a/src/mame/synertek/sym1.cpp b/src/mame/synertek/sym1.cpp index 0aa764a7551..44b93d1c63b 100644 --- a/src/mame/synertek/sym1.cpp +++ b/src/mame/synertek/sym1.cpp @@ -25,7 +25,7 @@ TODO: #include "machine/6522via.h" #include "machine/74145.h" #include "machine/input_merger.h" -#include "machine/mos6530n.h" +#include "machine/mos6530.h" #include "machine/ram.h" #include "machine/timer.h" #include "sound/spkrdev.h" @@ -393,7 +393,7 @@ void sym1_state::sym1_map(address_map &map) map(0x0c00, 0x0fff).bankr("bank6").bankw("bank7"); // U18/U19 OPT RAM map(0x8000, 0x8fff).rom(); // U20 Monitor ROM map(0xa000, 0xa00f).m("via1", FUNC(via6522_device::map)); // U25 VIA #1 - map(0xa400, 0xa41f).m("riot", FUNC(mos6532_new_device::io_map)); // U27 RIOT + map(0xa400, 0xa41f).m("riot", FUNC(mos6532_device::io_map)); // U27 RIOT map(0xa600, 0xa67f).bankr("bank0").bankw("bank1"); // U27 RIOT RAM map(0xa800, 0xa80f).m("via2", FUNC(via6522_device::map)); // U28 VIA #2 map(0xac00, 0xac0f).m("via3", FUNC(via6522_device::map)); // U29 VIA #3 @@ -419,7 +419,7 @@ void sym1_state::sym1(machine_config &config) SPEAKER_SOUND(config, "speaker").add_route(ALL_OUTPUTS, "mono", 1.0); // devices - mos6532_new_device &riot(MOS6532_NEW(config, "riot", SYM1_CLOCK)); + mos6532_device &riot(MOS6532(config, "riot", SYM1_CLOCK)); riot.pa_rd_callback().set(FUNC(sym1_state::riot_a_r)); riot.pa_wr_callback().set(FUNC(sym1_state::riot_a_w)); riot.pb_rd_callback().set(FUNC(sym1_state::riot_b_r)); -- cgit v1.2.3