From 5fb35cc10e9672ec2a01fc00b5dbad90da3b747f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Banaan=20Ananas?= Date: Thu, 3 Jul 2014 00:13:37 +0000 Subject: [PATCH] added more cpu types for tms7000 family --- src/emu/cpu/tms7000/tms7000.c | 55 ++++++++++++++++++++++++++++------ src/emu/cpu/tms7000/tms7000.h | 56 ++++++++++++++++++++++++++++++----- src/mess/drivers/exelv.c | 45 +++++++++++++--------------- 3 files changed, 114 insertions(+), 42 deletions(-) diff --git a/src/emu/cpu/tms7000/tms7000.c b/src/emu/cpu/tms7000/tms7000.c index 3ad4c441009..82de359b252 100644 --- a/src/emu/cpu/tms7000/tms7000.c +++ b/src/emu/cpu/tms7000/tms7000.c @@ -49,14 +49,28 @@ const device_type TMS7000 = &device_creator; -const device_type TMS7000_EXL = &device_creator; - +const device_type TMS7020 = &device_creator; +const device_type TMS7020_EXL = &device_creator; +const device_type TMS7040 = &device_creator; +const device_type TMS70C00 = &device_creator; +const device_type TMS70C20 = &device_creator; +const device_type TMS70C40 = &device_creator; static ADDRESS_MAP_START(tms7000_mem, AS_PROGRAM, 8, tms7000_device ) - AM_RANGE(0x0000, 0x007f) AM_RAM + AM_RANGE(0x0000, 0x007f) AM_RAM // 128 bytes internal RAM AM_RANGE(0x0100, 0x010f) AM_READWRITE(tms70x0_pf_r, tms70x0_pf_w) /* tms7000 internal I/O ports */ ADDRESS_MAP_END +static ADDRESS_MAP_START(tms7020_mem, AS_PROGRAM, 8, tms7000_device ) + AM_RANGE(0xf000, 0xffff) AM_ROM // 2kB internal ROM + AM_IMPORT_FROM( tms7000_mem ) +ADDRESS_MAP_END + +static ADDRESS_MAP_START(tms7040_mem, AS_PROGRAM, 8, tms7000_device ) + AM_RANGE(0xf000, 0xffff) AM_ROM // 4kB internal ROM + AM_IMPORT_FROM( tms7000_mem ) +ADDRESS_MAP_END + tms7000_device::tms7000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : cpu_device(mconfig, TMS7000, "TMS7000", tag, owner, clock, "tms7000", __FILE__) @@ -66,18 +80,41 @@ tms7000_device::tms7000_device(const machine_config &mconfig, const char *tag, d { } - -tms7000_device::tms7000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +tms7000_device::tms7000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor internal, const opcode_func *opcode, const char *shortname, const char *source) : cpu_device(mconfig, type, name, tag, owner, clock, shortname, source) - , m_program_config("program", ENDIANNESS_BIG, 8, 16, 0, ADDRESS_MAP_NAME(tms7000_mem)) + , m_program_config("program", ENDIANNESS_BIG, 8, 16, 0, internal) , m_io_config("io", ENDIANNESS_BIG, 8, 8, 0) - , m_opcode(s_opfn_exl) + , m_opcode(opcode) { } +tms7020_device::tms7020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms7000_device(mconfig, TMS7020, "TMS7020", tag, owner, clock, ADDRESS_MAP_NAME(tms7020_mem), s_opfn, "tms7020", __FILE__) +{ +} -tms7000_exl_device::tms7000_exl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms7000_device(mconfig, TMS7000_EXL, "TMS7000_EXL", tag, owner, clock, "tms7000_exl", __FILE__) +tms7020_exl_device::tms7020_exl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms7000_device(mconfig, TMS7020_EXL, "TMS7020 (EXL 100)", tag, owner, clock, ADDRESS_MAP_NAME(tms7020_mem), s_opfn_exl, "tms7020_exl", __FILE__) +{ +} + +tms7040_device::tms7040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms7000_device(mconfig, TMS7040, "TMS7040", tag, owner, clock, ADDRESS_MAP_NAME(tms7040_mem), s_opfn, "tms7040", __FILE__) +{ +} + +tms70c00_device::tms70c00_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms7000_device(mconfig, TMS70C00, "TMS70C00", tag, owner, clock, ADDRESS_MAP_NAME(tms7000_mem), s_opfn, "tms70c00", __FILE__) +{ +} + +tms70c20_device::tms70c20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms7000_device(mconfig, TMS70C20, "TMS70C20", tag, owner, clock, ADDRESS_MAP_NAME(tms7020_mem), s_opfn, "tms70c20", __FILE__) +{ +} + +tms70c40_device::tms70c40_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms7000_device(mconfig, TMS70C40, "TMS70C40", tag, owner, clock, ADDRESS_MAP_NAME(tms7040_mem), s_opfn, "tms70c40", __FILE__) { } diff --git a/src/emu/cpu/tms7000/tms7000.h b/src/emu/cpu/tms7000/tms7000.h index 14559696dac..ca7db60678e 100644 --- a/src/emu/cpu/tms7000/tms7000.h +++ b/src/emu/cpu/tms7000/tms7000.h @@ -45,9 +45,13 @@ enum class tms7000_device : public cpu_device { public: + typedef void ( tms7000_device::*opcode_func ) (); + static const opcode_func s_opfn[0x100]; + static const opcode_func s_opfn_exl[0x100]; + // construction/destruction tms7000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - tms7000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + tms7000_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, address_map_constructor internal, const opcode_func *opcode, const char *shortname, const char *source); DECLARE_WRITE8_MEMBER( tms70x0_pf_w ); DECLARE_READ8_MEMBER( tms70x0_pf_r ); @@ -79,9 +83,6 @@ private: address_space_config m_program_config; address_space_config m_io_config; - typedef void ( tms7000_device::*opcode_func ) (); - static const opcode_func s_opfn[0x100]; - static const opcode_func s_opfn_exl[0x100]; const opcode_func *m_opcode; inline UINT8 bcd_add( UINT8 a, UINT8 b, UINT8 c ); @@ -345,16 +346,55 @@ private: }; -class tms7000_exl_device : public tms7000_device +class tms7020_device : public tms7000_device { public: - // construction/destruction - tms7000_exl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + tms7020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + + +class tms7020_exl_device : public tms7000_device +{ +public: + tms7020_exl_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + + +class tms7040_device : public tms7000_device +{ +public: + tms7040_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + + +class tms70c00_device : public tms7000_device +{ +public: + tms70c00_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + + +class tms70c20_device : public tms7000_device +{ +public: + tms70c20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + + +class tms70c40_device : public tms7000_device +{ +public: + tms70c40_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; extern const device_type TMS7000; -extern const device_type TMS7000_EXL; +extern const device_type TMS7020; +extern const device_type TMS7020_EXL; +extern const device_type TMS7040; +extern const device_type TMS70C00; +extern const device_type TMS70C20; +extern const device_type TMS70C40; #endif /* __TMS7000_H__ */ diff --git a/src/mess/drivers/exelv.c b/src/mess/drivers/exelv.c index a2c0130e2e3..7c189f3f1de 100644 --- a/src/mess/drivers/exelv.c +++ b/src/mess/drivers/exelv.c @@ -462,7 +462,6 @@ static ADDRESS_MAP_START(tms7020_mem, AS_PROGRAM, 8, exelv_state) AM_RANGE(0x8000, 0xbfff) AM_NOP AM_RANGE(0xc000, 0xc7ff) AM_RAM /* CPU RAM */ AM_RANGE(0xc800, 0xf7ff) AM_NOP - AM_RANGE(0xf800, 0xffff) AM_ROM AM_REGION("maincpu",0x0000) /* tms7020 internal ROM */ ADDRESS_MAP_END @@ -473,7 +472,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START(tms7041_map, AS_PROGRAM, 8, exelv_state) - AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION("tms7041",0x0000) + AM_RANGE(0x0080, 0x00ff) AM_RAM ADDRESS_MAP_END @@ -497,12 +496,11 @@ static ADDRESS_MAP_START(tms7040_mem, AS_PROGRAM, 8, exelv_state) AM_RANGE(0x8000, 0xbfff) AM_NOP AM_RANGE(0xc000, 0xc7ff) AM_RAM /* CPU RAM */ AM_RANGE(0xc800, 0xefff) AM_NOP - AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION("maincpu",0x0000) /* tms7040 internal ROM */ ADDRESS_MAP_END static ADDRESS_MAP_START(tms7042_map, AS_PROGRAM, 8, exelv_state) - AM_RANGE(0xf000, 0xffff) AM_ROM AM_REGION("tms7042",0x0000) + AM_RANGE(0x0080, 0x00ff) AM_RAM ADDRESS_MAP_END @@ -550,17 +548,16 @@ void exelv_state::machine_start() static MACHINE_CONFIG_START( exl100, exelv_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", TMS7000_EXL, XTAL_4_9152MHz) /* TMS7020 */ + MCFG_CPU_ADD("maincpu", TMS7020_EXL, XTAL_4_9152MHz) MCFG_CPU_PROGRAM_MAP(tms7020_mem) MCFG_CPU_IO_MAP(tms7020_port) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", exelv_state, exelv_hblank_interrupt, "screen", 0, 1) - MCFG_CPU_ADD("tms7041", TMS7000, XTAL_4_9152MHz) + MCFG_CPU_ADD("tms7041", TMS7040, XTAL_4_9152MHz) // should be TMS7041 MCFG_CPU_PROGRAM_MAP(tms7041_map) MCFG_CPU_IO_MAP(tms7041_port) MCFG_QUANTUM_PERFECT_CPU("maincpu") - MCFG_QUANTUM_PERFECT_CPU("tms7041") MCFG_TMS3556_ADD("tms3556") @@ -591,29 +588,27 @@ static MACHINE_CONFIG_START( exl100, exelv_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) /* cartridge */ - MCFG_CARTSLOT_ADD("cart") - MCFG_CARTSLOT_EXTENSION_LIST("bin,rom") - MCFG_CARTSLOT_NOT_MANDATORY - MCFG_CARTSLOT_LOAD(exelv_state,exelvision_cartridge) - MCFG_CARTSLOT_INTERFACE("exelvision_cart") - MCFG_SOFTWARE_LIST_ADD("cart_list","exelvision_cart") - + MCFG_CARTSLOT_ADD("cart") + MCFG_CARTSLOT_EXTENSION_LIST("bin,rom") + MCFG_CARTSLOT_NOT_MANDATORY + MCFG_CARTSLOT_LOAD(exelv_state,exelvision_cartridge) + MCFG_CARTSLOT_INTERFACE("exelvision_cart") + MCFG_SOFTWARE_LIST_ADD("cart_list","exelvision_cart") MACHINE_CONFIG_END static MACHINE_CONFIG_START( exeltel, exelv_state ) /* basic machine hardware */ - MCFG_CPU_ADD("maincpu", TMS7000_EXL, XTAL_4_9152MHz) /* TMS7040 */ + MCFG_CPU_ADD("maincpu", TMS7040, XTAL_4_9152MHz) MCFG_CPU_PROGRAM_MAP(tms7040_mem) MCFG_CPU_IO_MAP(tms7020_port) MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", exelv_state, exelv_hblank_interrupt, "screen", 0, 1) - MCFG_CPU_ADD("tms7042", TMS7000, XTAL_4_9152MHz) + MCFG_CPU_ADD("tms7042", TMS7040, XTAL_4_9152MHz) // should be TMS7042 MCFG_CPU_PROGRAM_MAP(tms7042_map) MCFG_CPU_IO_MAP(tms7041_port) MCFG_QUANTUM_PERFECT_CPU("maincpu") - MCFG_QUANTUM_PERFECT_CPU("tms7042") MCFG_TMS3556_ADD("tms3556") @@ -649,11 +644,11 @@ MACHINE_CONFIG_END ROM loading */ ROM_START(exl100) - ROM_REGION(0x800, "maincpu", 0) - ROM_LOAD("exl100in.bin", 0x0000, 0x0800, CRC(049109a3) SHA1(98a07297dcdacef41c793c197b6496dac1e8e744)) /* TMS7020 ROM, correct */ + ROM_REGION(0x10000, "maincpu", 0) + ROM_LOAD("exl100in.bin", 0xf800, 0x0800, CRC(049109a3) SHA1(98a07297dcdacef41c793c197b6496dac1e8e744)) /* TMS7020 ROM, correct */ - ROM_REGION(0x1000, "tms7041", 0) - ROM_LOAD("exl100_7041.bin", 0x0000, 0x1000, CRC(38f6fc7a) SHA1(b71d545664a974d8ad39bdf600c5b9884c3efab6)) /* TMS7041 internal ROM, correct */ + ROM_REGION(0x10000, "tms7041", 0) + ROM_LOAD("exl100_7041.bin", 0xf000, 0x1000, CRC(38f6fc7a) SHA1(b71d545664a974d8ad39bdf600c5b9884c3efab6)) /* TMS7041 internal ROM, correct */ // ROM_REGION(0x8000, "vsm", 0) ROM_REGION(0x10000, "user1", ROMREGION_ERASEFF) /* cartridge area */ @@ -661,11 +656,11 @@ ROM_END ROM_START(exeltel) - ROM_REGION(0x1000, "maincpu", 0) - ROM_LOAD("exeltel_7040.bin", 0x0000, 0x1000, CRC(2792f02f) SHA1(442a852eb68ef78974733d169084752a131de23d)) /* TMS7040 internal ROM */ + ROM_REGION(0x10000, "maincpu", 0) + ROM_LOAD("exeltel_7040.bin", 0xf000, 0x1000, CRC(2792f02f) SHA1(442a852eb68ef78974733d169084752a131de23d)) /* TMS7040 internal ROM */ - ROM_REGION(0x1000, "tms7042", 0) - ROM_LOAD("exeltel_7042.bin", 0x0000, 0x1000, BAD_DUMP CRC(a0163507) SHA1(8452849df7eac8a89cf03ee98e2306047c1c4c38)) /* TMS7042 internal ROM, needs redump */ + ROM_REGION(0x10000, "tms7042", 0) + ROM_LOAD("exeltel_7042.bin", 0xf000, 0x1000, BAD_DUMP CRC(a0163507) SHA1(8452849df7eac8a89cf03ee98e2306047c1c4c38)) /* TMS7042 internal ROM, needs redump */ ROM_REGION(0x10000,"user1",0) ROM_SYSTEM_BIOS( 0, "french", "French v1.4" )