summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Michael Zapf <michael.zapf@mizapf.de>2013-11-03 14:39:45 +0000
committer Michael Zapf <michael.zapf@mizapf.de>2013-11-03 14:39:45 +0000
commit9ca0768eadda01d1c1d5d82b1ab6fafc9f1f2fc9 (patch)
tree8d296431f050f5f45dad7403447a822e1ddc018e
parent59414e62a2de384310184099f4c99e356f147061 (diff)
Added compile switch for legacy / new CPU implementation.(nw)
-rw-r--r--src/mame/drivers/jubilee.c25
-rw-r--r--src/mess/drivers/cortex.c26
-rw-r--r--src/mess/drivers/tutor.c18
3 files changed, 64 insertions, 5 deletions
diff --git a/src/mame/drivers/jubilee.c b/src/mame/drivers/jubilee.c
index cf514c58931..649de8101be 100644
--- a/src/mame/drivers/jubilee.c
+++ b/src/mame/drivers/jubilee.c
@@ -82,11 +82,16 @@
*******************************************************************************/
+#define MODERN 0
#define MASTER_CLOCK XTAL_8MHz /* guess */
#include "emu.h"
+#if MODERN
#include "cpu/tms9900/tms9980a.h"
+#else
+#include "cpu/tms9900/tms9900l.h"
+#endif
#include "video/mc6845.h"
@@ -157,8 +162,12 @@ void jubilee_state::palette_init()
INTERRUPT_GEN_MEMBER(jubilee_state::jubileep_interrupt)
{
/* doesn't seems to work properly. need to set level1 interrupts */
+#if MODERN
m_maincpu->set_input_line(INT_9980A_LEVEL1, ASSERT_LINE);
m_maincpu->set_input_line(INT_9980A_LEVEL1, CLEAR_LINE);
+#else
+ device.execute().set_input_line_and_vector(0, ASSERT_LINE, 3);//2=nmi 3,4,5,6
+#endif
}
@@ -409,6 +418,16 @@ static MC6845_INTERFACE( mc6845_intf )
NULL /* update address callback */
};
+#if MODERN
+static TMS9980A_CONFIG( cpuconf )
+{
+ DEVCB_NULL,
+ DEVCB_NULL, // Instruction acquisition
+ DEVCB_NULL, // Clock out
+ DEVCB_NULL, // Hold acknowledge
+ DEVCB_NULL // DBIN
+};
+#endif
static TMS9980A_CONFIG( cpuconf )
{
@@ -426,7 +445,13 @@ static TMS9980A_CONFIG( cpuconf )
static MACHINE_CONFIG_START( jubileep, jubilee_state )
/* basic machine hardware */
+#if MODERN
MCFG_TMS99xx_ADD("maincpu", TMS9980A, MASTER_CLOCK/2, jubileep_map, jubileep_cru_map, cpuconf)
+#else
+ MCFG_CPU_ADD("maincpu", TMS9980L, MASTER_CLOCK/2) /* guess */
+ MCFG_CPU_PROGRAM_MAP(jubileep_map)
+ MCFG_CPU_IO_MAP(jubileep_cru_map)
+#endif
MCFG_CPU_VBLANK_INT_DRIVER("screen", jubilee_state, jubileep_interrupt)
/* video hardware */
diff --git a/src/mess/drivers/cortex.c b/src/mess/drivers/cortex.c
index 2ae214ff03e..fb50940e2f6 100644
--- a/src/mess/drivers/cortex.c
+++ b/src/mess/drivers/cortex.c
@@ -22,8 +22,14 @@
****************************************************************************/
+#define MODERN 1
+
#include "emu.h"
+#if MODERN
#include "cpu/tms9900/tms9995.h"
+#else
+#include "cpu/tms9900/tms9900l.h"
+#endif
#include "video/tms9928a.h"
class cortex_state : public driver_device
@@ -71,9 +77,14 @@ void cortex_state::machine_reset()
{
UINT8* ROM = memregion("maincpu")->base();
memcpy(m_p_ram, ROM, 0x6000);
+#if MODERN
static_cast<tms9995_device*>(machine().device("maincpu"))->set_ready(ASSERT_LINE);
+#else
+ m_maincpu->reset();
+#endif
}
+#if MODERN
static TMS9995_CONFIG( cpuconf95 )
{
DEVCB_NULL, // external op
@@ -84,6 +95,14 @@ static TMS9995_CONFIG( cpuconf95 )
INTERNAL_RAM, // use internal RAM
NO_OVERFLOW_INT // The generally available versions of TMS9995 have a deactivated overflow interrupt
};
+#else
+static const struct tms9995reset_param cortex_processor_config =
+{
+ 0, /* disable automatic wait state generation */
+ 0, /* no IDLE callback */
+ 0 /* no MP9537 mask */
+};
+#endif
static TMS9928A_INTERFACE(cortex_tms9929a_interface)
{
@@ -94,7 +113,14 @@ static TMS9928A_INTERFACE(cortex_tms9929a_interface)
static MACHINE_CONFIG_START( cortex, cortex_state )
/* basic machine hardware */
/* TMS9995 CPU @ 12.0 MHz */
+#if MODERN
MCFG_TMS99xx_ADD("maincpu", TMS9995, 12000000, cortex_mem, cortex_io, cpuconf95)
+#else
+ MCFG_CPU_ADD("maincpu", TMS9995L, 12000000)
+ MCFG_CPU_CONFIG(cortex_processor_config)
+ MCFG_CPU_PROGRAM_MAP(cortex_mem)
+ MCFG_CPU_IO_MAP(cortex_io)
+#endif
/* video hardware */
MCFG_TMS9928A_ADD( "tms9928a", TMS9929A, cortex_tms9929a_interface )
diff --git a/src/mess/drivers/tutor.c b/src/mess/drivers/tutor.c
index f048de1ab85..66e100a399e 100644
--- a/src/mess/drivers/tutor.c
+++ b/src/mess/drivers/tutor.c
@@ -192,7 +192,7 @@ public:
m_centronics(*this, "centronics")
{ }
- required_device<cpu_device> m_maincpu;
+ required_device<tms9995_device> m_maincpu;
optional_device<cassette_image_device> m_cass;
optional_device<centronics_device> m_centronics;
DECLARE_READ8_MEMBER(key_r);
@@ -202,6 +202,8 @@ public:
DECLARE_WRITE8_MEMBER(tutor_cassette_w);
DECLARE_READ8_MEMBER(tutor_printer_r);
DECLARE_WRITE8_MEMBER(tutor_printer_w);
+
+ DECLARE_READ8_MEMBER(tutor_highmem_r);
char m_cartridge_enable;
char m_tape_interrupt_enable;
emu_timer *m_tape_interrupt_timer;
@@ -393,6 +395,12 @@ WRITE8_MEMBER( tutor_state::tutor_mapper_w )
}
}
+READ8_MEMBER( tutor_state::tutor_highmem_r )
+{
+ if (m_maincpu->is_onchip(offset | 0xf000)) return m_maincpu->debug_read_onchip_memory(offset&0xff);
+ return 0;
+}
+
/*
Cassette interface:
@@ -416,7 +424,7 @@ TIMER_CALLBACK_MEMBER(tutor_state::tape_interrupt_handler)
{
//assert(m_tape_interrupt_enable);
#if MODERN
- m_maincpu->set_input_line(INT_9995_INT1, (m_cass->input() > 0.0) ? ASSERT_LINE : CLEAR_LINE);
+ m_maincpu->set_input_line(INT_9995_INT4, (m_cass->input() > 0.0) ? ASSERT_LINE : CLEAR_LINE);
#else
m_maincpu->set_input_line(1, (m_cass->input() > 0.0) ? ASSERT_LINE : CLEAR_LINE);
#endif
@@ -456,7 +464,7 @@ WRITE8_MEMBER( tutor_state::tutor_cassette_w )
{
m_tape_interrupt_timer->adjust(attotime::never);
#if MODERN
- m_maincpu->set_input_line(INT_9995_INT1, CLEAR_LINE);
+ m_maincpu->set_input_line(INT_9995_INT4, CLEAR_LINE);
#else
m_maincpu->set_input_line(1, CLEAR_LINE);
#endif
@@ -575,7 +583,7 @@ static ADDRESS_MAP_START(tutor_memmap, AS_PROGRAM, 8, tutor_state)
AM_RANGE(0xe800, 0xe8ff) AM_READWRITE(tutor_printer_r, tutor_printer_w) /*printer*/
AM_RANGE(0xee00, 0xeeff) AM_READNOP AM_WRITE( tutor_cassette_w) /*cassette interface*/
- AM_RANGE(0xf000, 0xffff) AM_NOP /*free for expansion (and internal processor RAM)*/
+ AM_RANGE(0xf000, 0xffff) AM_READ(tutor_highmem_r) AM_WRITENOP /*free for expansion (and internal processor RAM)*/
ADDRESS_MAP_END
static ADDRESS_MAP_START(pyuutajr_mem, AS_PROGRAM, 8, tutor_state)
@@ -590,7 +598,7 @@ static ADDRESS_MAP_START(pyuutajr_mem, AS_PROGRAM, 8, tutor_state)
AM_RANGE(0xea00, 0xea00) AM_READ_PORT("LINE1")
AM_RANGE(0xec00, 0xec00) AM_READ_PORT("LINE2")
AM_RANGE(0xee00, 0xee00) AM_READ_PORT("LINE3")
- AM_RANGE(0xf000, 0xffff) AM_NOP /*free for expansion (and internal processor RAM)*/
+ AM_RANGE(0xf000, 0xffff) AM_READ(tutor_highmem_r) AM_WRITENOP /*free for expansion (and internal processor RAM)*/
ADDRESS_MAP_END
/*