tms7000: Removed MCFG. [Ryan Holtz]

This commit is contained in:
mooglyguy 2018-12-06 22:00:54 +01:00
parent 6056c917ed
commit ce12c84ead
6 changed files with 67 additions and 81 deletions

View File

@ -108,7 +108,7 @@ namespace
uint8_t m_tms7000_portc; uint8_t m_tms7000_portc;
uint8_t m_tms7000_portd; uint8_t m_tms7000_portd;
emu_timer *m_tms7000_busy_timer; emu_timer *m_tms7000_busy_timer;
required_device<cpu_device> m_tms7040; required_device<tms7040_device> m_tms7040;
required_device<ram_device> m_staticram; required_device<ram_device> m_staticram;
required_device<ay8910_device> m_ay; required_device<ay8910_device> m_ay;
required_device<sp0256_device> m_spo; required_device<sp0256_device> m_spo;
@ -153,13 +153,13 @@ DEFINE_DEVICE_TYPE(COCOSSC_SAC, cocossc_sac_device, "cocossc_sac", "CoCo SSC Sou
//************************************************************************** //**************************************************************************
MACHINE_CONFIG_START(coco_ssc_device::device_add_mconfig) MACHINE_CONFIG_START(coco_ssc_device::device_add_mconfig)
MCFG_DEVICE_ADD(PIC_TAG, TMS7040, DERIVED_CLOCK(2, 1)) TMS7040(config, m_tms7040, DERIVED_CLOCK(2, 1));
MCFG_TMS7000_IN_PORTA_CB(READ8(*this, coco_ssc_device, ssc_port_a_r)) m_tms7040->in_porta().set(FUNC(coco_ssc_device::ssc_port_a_r));
MCFG_TMS7000_OUT_PORTB_CB(WRITE8(*this, coco_ssc_device, ssc_port_b_w)) m_tms7040->out_portb().set(FUNC(coco_ssc_device::ssc_port_b_w));
MCFG_TMS7000_IN_PORTC_CB(READ8(*this, coco_ssc_device, ssc_port_c_r)) m_tms7040->in_portc().set(FUNC(coco_ssc_device::ssc_port_c_r));
MCFG_TMS7000_OUT_PORTC_CB(WRITE8(*this, coco_ssc_device, ssc_port_c_w)) m_tms7040->out_portc().set(FUNC(coco_ssc_device::ssc_port_c_w));
MCFG_TMS7000_IN_PORTD_CB(READ8(*this, coco_ssc_device, ssc_port_d_r)) m_tms7040->in_portd().set(FUNC(coco_ssc_device::ssc_port_d_r));
MCFG_TMS7000_OUT_PORTD_CB(WRITE8(*this, coco_ssc_device, ssc_port_d_w)) m_tms7040->out_portd().set(FUNC(coco_ssc_device::ssc_port_d_w));
RAM(config, "staticram").set_default_size("2K").set_default_value(0); RAM(config, "staticram").set_default_size("2K").set_default_value(0);

View File

@ -13,34 +13,6 @@
#include "debugger.h" #include "debugger.h"
// read-only on 70x0
#define MCFG_TMS7000_IN_PORTA_CB(_devcb) \
downcast<tms7000_device &>(*device).set_port_read_cb(0, DEVCB_##_devcb);
#define MCFG_TMS7000_OUT_PORTA_CB(_devcb) \
downcast<tms7000_device &>(*device).set_port_write_cb(0, DEVCB_##_devcb);
// write-only
#define MCFG_TMS7000_OUT_PORTB_CB(_devcb) \
downcast<tms7000_device &>(*device).set_port_write_cb(1, DEVCB_##_devcb);
#define MCFG_TMS7000_IN_PORTC_CB(_devcb) \
downcast<tms7000_device &>(*device).set_port_read_cb(2, DEVCB_##_devcb);
#define MCFG_TMS7000_OUT_PORTC_CB(_devcb) \
downcast<tms7000_device &>(*device).set_port_write_cb(2, DEVCB_##_devcb);
#define MCFG_TMS7000_IN_PORTD_CB(_devcb) \
downcast<tms7000_device &>(*device).set_port_read_cb(3, DEVCB_##_devcb);
#define MCFG_TMS7000_OUT_PORTD_CB(_devcb) \
downcast<tms7000_device &>(*device).set_port_write_cb(3, DEVCB_##_devcb);
// TMS70C46 only
#define MCFG_TMS7000_IN_PORTE_CB(_devcb) \
downcast<tms7000_device &>(*device).set_port_read_cb(4, DEVCB_##_devcb);
#define MCFG_TMS7000_OUT_PORTE_CB(_devcb) \
downcast<tms7000_device &>(*device).set_port_write_cb(4, DEVCB_##_devcb);
enum { TMS7000_PC=1, TMS7000_SP, TMS7000_ST }; enum { TMS7000_PC=1, TMS7000_SP, TMS7000_ST };
enum enum
@ -57,9 +29,21 @@ public:
// construction/destruction // construction/destruction
tms7000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); tms7000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration // read-only on 70x0
template<class Object> devcb_base &set_port_read_cb(int p, Object &&cb) { return m_port_in_cb[p].set_callback(std::forward<Object>(cb)); } auto in_porta() { return m_port_in_cb[0].bind(); }
template<class Object> devcb_base &set_port_write_cb(int p, Object &&cb) { return m_port_out_cb[p].set_callback(std::forward<Object>(cb)); } auto out_porta() { return m_port_out_cb[0].bind(); }
// write-only
auto out_portb() { return m_port_out_cb[1].bind(); }
auto in_portc() { return m_port_in_cb[2].bind(); }
auto out_portc() { return m_port_out_cb[2].bind(); }
auto in_portd() { return m_port_in_cb[3].bind(); }
auto out_portd() { return m_port_out_cb[3].bind(); }
// TMS70C46 only
auto in_porte() { return m_port_in_cb[4].bind(); }
auto out_porte() { return m_port_out_cb[4].bind(); }
DECLARE_READ8_MEMBER(tms7000_unmapped_rf_r) { if (!machine().side_effects_disabled()) logerror("'%s' (%04X): unmapped_rf_r @ $%04x\n", tag(), m_pc, offset + 0x80); return 0; }; DECLARE_READ8_MEMBER(tms7000_unmapped_rf_r) { if (!machine().side_effects_disabled()) logerror("'%s' (%04X): unmapped_rf_r @ $%04x\n", tag(), m_pc, offset + 0x80); return 0; };
DECLARE_WRITE8_MEMBER(tms7000_unmapped_rf_w) { logerror("'%s' (%04X): unmapped_rf_w @ $%04x = $%02x\n", tag(), m_pc, offset + 0x80, data); }; DECLARE_WRITE8_MEMBER(tms7000_unmapped_rf_w) { logerror("'%s' (%04X): unmapped_rf_w @ $%04x = $%02x\n", tag(), m_pc, offset + 0x80, data); };

View File

@ -585,10 +585,10 @@ void cc40_state::machine_start()
MACHINE_CONFIG_START(cc40_state::cc40) MACHINE_CONFIG_START(cc40_state::cc40)
/* basic machine hardware */ /* basic machine hardware */
MCFG_DEVICE_ADD("maincpu", TMS70C20, XTAL(5'000'000) / 2) TMS70C20(config, m_maincpu, XTAL(5'000'000) / 2);
MCFG_DEVICE_PROGRAM_MAP(main_map) m_maincpu->set_addrmap(AS_PROGRAM, &cc40_state::main_map);
MCFG_TMS7000_IN_PORTA_CB(READ8(*this, cc40_state, keyboard_r)) m_maincpu->in_porta().set(FUNC(cc40_state::keyboard_r));
MCFG_TMS7000_OUT_PORTB_CB(WRITE8(*this, cc40_state, keyboard_w)) m_maincpu->out_portb().set(FUNC(cc40_state::keyboard_w));
NVRAM(config, "sysram.0", nvram_device::DEFAULT_ALL_0); NVRAM(config, "sysram.0", nvram_device::DEFAULT_ALL_0);
NVRAM(config, "sysram.1", nvram_device::DEFAULT_ALL_0); NVRAM(config, "sysram.1", nvram_device::DEFAULT_ALL_0);

View File

@ -76,6 +76,7 @@ public:
exelv_state(const machine_config &mconfig, device_type type, const char *tag) exelv_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag), : driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"), m_maincpu(*this, "maincpu"),
m_subcpu(*this, "subcpu"),
m_tms3556(*this, "tms3556"), m_tms3556(*this, "tms3556"),
m_tms5220c(*this, "tms5220c"), m_tms5220c(*this, "tms5220c"),
m_cart(*this, "cartslot") m_cart(*this, "cartslot")
@ -85,7 +86,8 @@ public:
void exl100(machine_config &config); void exl100(machine_config &config);
private: private:
required_device<cpu_device> m_maincpu; required_device<tms7000_device> m_maincpu;
required_device<tms7000_device> m_subcpu;
required_device<tms3556_device> m_tms3556; required_device<tms3556_device> m_tms3556;
required_device<tms5220c_device> m_tms5220c; required_device<tms5220c_device> m_tms5220c;
optional_device<generic_slot_device> m_cart; optional_device<generic_slot_device> m_cart;
@ -484,21 +486,21 @@ MACHINE_START_MEMBER( exelv_state, exeltel)
MACHINE_CONFIG_START(exelv_state::exl100) MACHINE_CONFIG_START(exelv_state::exl100)
/* basic machine hardware */ /* basic machine hardware */
MCFG_DEVICE_ADD("maincpu", TMS7020_EXL, XTAL(4'915'200)) TMS7020_EXL(config, m_maincpu, XTAL(4'915'200));
MCFG_DEVICE_PROGRAM_MAP(tms7020_mem) m_maincpu->set_addrmap(AS_PROGRAM, &exelv_state::tms7020_mem);
MCFG_TMS7000_IN_PORTA_CB(READ8(*this, exelv_state, tms7020_porta_r)) m_maincpu->in_porta().set(FUNC(exelv_state::tms7020_porta_r));
MCFG_TMS7000_OUT_PORTB_CB(WRITE8(*this, exelv_state, tms7020_portb_w)) m_maincpu->out_portb().set(FUNC(exelv_state::tms7020_portb_w));
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", exelv_state, exelv_hblank_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", exelv_state, exelv_hblank_interrupt, "screen", 0, 1)
MCFG_MACHINE_START_OVERRIDE(exelv_state, exl100) MCFG_MACHINE_START_OVERRIDE(exelv_state, exl100)
MCFG_DEVICE_ADD("tms7041", TMS7041, XTAL(4'915'200)) TMS7041(config, m_subcpu, XTAL(4'915'200));
MCFG_TMS7000_IN_PORTA_CB(READ8(*this, exelv_state, tms7041_porta_r)) m_subcpu->in_porta().set(FUNC(exelv_state::tms7041_porta_r));
MCFG_TMS7000_OUT_PORTB_CB(WRITE8(*this, exelv_state, tms7041_portb_w)) m_subcpu->out_portb().set(FUNC(exelv_state::tms7041_portb_w));
MCFG_TMS7000_IN_PORTC_CB(READ8(*this, exelv_state, tms7041_portc_r)) m_subcpu->in_portc().set(FUNC(exelv_state::tms7041_portc_r));
MCFG_TMS7000_OUT_PORTC_CB(WRITE8(*this, exelv_state, tms7041_portc_w)) m_subcpu->out_portc().set(FUNC(exelv_state::tms7041_portc_w));
MCFG_TMS7000_IN_PORTD_CB(READ8(*this, exelv_state, tms7041_portd_r)) m_subcpu->in_portd().set(FUNC(exelv_state::tms7041_portd_r));
MCFG_TMS7000_OUT_PORTD_CB(WRITE8(*this, exelv_state, tms7041_portd_w)) m_subcpu->out_portd().set(FUNC(exelv_state::tms7041_portd_w));
MCFG_QUANTUM_PERFECT_CPU("maincpu") MCFG_QUANTUM_PERFECT_CPU("maincpu")
@ -540,21 +542,21 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(exelv_state::exeltel) MACHINE_CONFIG_START(exelv_state::exeltel)
/* basic machine hardware */ /* basic machine hardware */
MCFG_DEVICE_ADD("maincpu", TMS7040, XTAL(4'915'200)) TMS7040(config, m_maincpu, XTAL(4'915'200));
MCFG_DEVICE_PROGRAM_MAP(tms7040_mem) m_maincpu->set_addrmap(AS_PROGRAM, &exelv_state::tms7040_mem);
MCFG_TMS7000_IN_PORTA_CB(READ8(*this, exelv_state, tms7020_porta_r)) m_maincpu->in_porta().set(FUNC(exelv_state::tms7020_porta_r));
MCFG_TMS7000_OUT_PORTB_CB(WRITE8(*this, exelv_state, tms7020_portb_w)) m_maincpu->out_portb().set(FUNC(exelv_state::tms7020_portb_w));
MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", exelv_state, exelv_hblank_interrupt, "screen", 0, 1) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", exelv_state, exelv_hblank_interrupt, "screen", 0, 1)
MCFG_MACHINE_START_OVERRIDE(exelv_state, exeltel) MCFG_MACHINE_START_OVERRIDE(exelv_state, exeltel)
MCFG_DEVICE_ADD("tms7042", TMS7042, XTAL(4'915'200)) TMS7042(config, m_subcpu, XTAL(4'915'200));
MCFG_TMS7000_IN_PORTA_CB(READ8(*this, exelv_state, tms7041_porta_r)) m_subcpu->in_porta().set(FUNC(exelv_state::tms7041_porta_r));
MCFG_TMS7000_OUT_PORTB_CB(WRITE8(*this, exelv_state, tms7041_portb_w)) m_subcpu->out_portb().set(FUNC(exelv_state::tms7041_portb_w));
MCFG_TMS7000_IN_PORTC_CB(READ8(*this, exelv_state, tms7041_portc_r)) m_subcpu->in_portc().set(FUNC(exelv_state::tms7041_portc_r));
MCFG_TMS7000_OUT_PORTC_CB(WRITE8(*this, exelv_state, tms7041_portc_w)) m_subcpu->out_portc().set(FUNC(exelv_state::tms7041_portc_w));
MCFG_TMS7000_IN_PORTD_CB(READ8(*this, exelv_state, tms7041_portd_r)) m_subcpu->in_portd().set(FUNC(exelv_state::tms7041_portd_r));
MCFG_TMS7000_OUT_PORTD_CB(WRITE8(*this, exelv_state, tms7041_portd_w)) m_subcpu->out_portd().set(FUNC(exelv_state::tms7041_portd_w));
MCFG_QUANTUM_PERFECT_CPU("maincpu") MCFG_QUANTUM_PERFECT_CPU("maincpu")

View File

@ -39,7 +39,7 @@ public:
private: private:
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
required_device<pc_noppi_mb_device> m_mb; required_device<pc_noppi_mb_device> m_mb;
required_device<cpu_device> m_kbc; required_device<tms7000_device> m_kbc;
required_device<m24_keyboard_device> m_keyboard; required_device<m24_keyboard_device> m_keyboard;
optional_device<m24_z8000_device> m_z8000_apb; optional_device<m24_z8000_device> m_z8000_apb;
@ -278,10 +278,10 @@ MACHINE_CONFIG_START(m24_state::olivetti)
/* internal ram */ /* internal ram */
RAM(config, RAM_TAG).set_default_size("640K").set_extra_options("64K, 128K, 256K, 512K"); RAM(config, RAM_TAG).set_default_size("640K").set_extra_options("64K, 128K, 256K, 512K");
MCFG_DEVICE_ADD("kbc", TMS7000, XTAL(4'000'000)) TMS7000(config, m_kbc, XTAL(4'000'000));
MCFG_DEVICE_PROGRAM_MAP(kbc_map) m_kbc->set_addrmap(AS_PROGRAM, &m24_state::kbc_map);
MCFG_TMS7000_IN_PORTA_CB(READ8(*this, m24_state, pa_r)) m_kbc->in_porta().set(FUNC(m24_state::pa_r));
MCFG_TMS7000_OUT_PORTB_CB(WRITE8(*this, m24_state, pb_w)) m_kbc->out_portb().set(FUNC(m24_state::pb_w));
M24_KEYBOARD(config, m_keyboard, 0); M24_KEYBOARD(config, m_keyboard, 0);
m_keyboard->out_data_handler().set(FUNC(m24_state::kbcin_w)); m_keyboard->out_data_handler().set(FUNC(m24_state::kbcin_w));

View File

@ -520,11 +520,11 @@ void ti74_state::machine_start()
MACHINE_CONFIG_START(ti74_state::ti74) MACHINE_CONFIG_START(ti74_state::ti74)
/* basic machine hardware */ /* basic machine hardware */
MCFG_DEVICE_ADD("maincpu", TMS70C46, XTAL(4'000'000)) TMS70C46(config, m_maincpu, XTAL(4'000'000));
MCFG_DEVICE_PROGRAM_MAP(main_map) m_maincpu->set_addrmap(AS_PROGRAM, &ti74_state::main_map);
MCFG_TMS7000_IN_PORTA_CB(READ8(*this, ti74_state, keyboard_r)) m_maincpu->in_porta().set(FUNC(ti74_state::keyboard_r));
MCFG_TMS7000_OUT_PORTB_CB(WRITE8(*this, ti74_state, bankswitch_w)) m_maincpu->out_portb().set(FUNC(ti74_state::bankswitch_w));
MCFG_TMS7000_OUT_PORTE_CB(WRITE8(*this, ti74_state, keyboard_w)) m_maincpu->out_porte().set(FUNC(ti74_state::keyboard_w));
NVRAM(config, "sysram.ic3", nvram_device::DEFAULT_ALL_0); NVRAM(config, "sysram.ic3", nvram_device::DEFAULT_ALL_0);
@ -556,11 +556,11 @@ MACHINE_CONFIG_END
MACHINE_CONFIG_START(ti74_state::ti95) MACHINE_CONFIG_START(ti74_state::ti95)
/* basic machine hardware */ /* basic machine hardware */
MCFG_DEVICE_ADD("maincpu", TMS70C46, XTAL(4'000'000)) TMS70C46(config, m_maincpu, XTAL(4'000'000));
MCFG_DEVICE_PROGRAM_MAP(main_map) m_maincpu->set_addrmap(AS_PROGRAM, &ti74_state::main_map);
MCFG_TMS7000_IN_PORTA_CB(READ8(*this, ti74_state, keyboard_r)) m_maincpu->in_porta().set(FUNC(ti74_state::keyboard_r));
MCFG_TMS7000_OUT_PORTB_CB(WRITE8(*this, ti74_state, bankswitch_w)) m_maincpu->out_portb().set(FUNC(ti74_state::bankswitch_w));
MCFG_TMS7000_OUT_PORTE_CB(WRITE8(*this, ti74_state, keyboard_w)) m_maincpu->out_porte().set(FUNC(ti74_state::keyboard_w));
NVRAM(config, "sysram.ic3", nvram_device::DEFAULT_ALL_0); NVRAM(config, "sysram.ic3", nvram_device::DEFAULT_ALL_0);