summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/jubilee.c
diff options
context:
space:
mode:
author Michael Zapf <michael.zapf@mizapf.de>2013-11-04 22:06:14 +0000
committer Michael Zapf <michael.zapf@mizapf.de>2013-11-04 22:06:14 +0000
commitff97022b21e98ce3c8d1e2f8197553063af30ba4 (patch)
treeeb6a9d8ab64d589f4229de2daf0364931b7cf41c /src/mame/drivers/jubilee.c
parent86fecdf47f5d8d4f7e7b3064caa41edd5e933224 (diff)
jubilee.c: Switched to new TMS9980 implementation and tried to bring the
driver in better shape. [Michael Zapf]
Diffstat (limited to 'src/mame/drivers/jubilee.c')
-rw-r--r--src/mame/drivers/jubilee.c53
1 files changed, 29 insertions, 24 deletions
diff --git a/src/mame/drivers/jubilee.c b/src/mame/drivers/jubilee.c
index 40f1ec702f7..3dff37c1be7 100644
--- a/src/mame/drivers/jubilee.c
+++ b/src/mame/drivers/jubilee.c
@@ -82,16 +82,10 @@
*******************************************************************************/
-#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"
@@ -107,6 +101,7 @@ public:
tilemap_t *m_bg_tilemap;
DECLARE_WRITE8_MEMBER(jubileep_videoram_w);
DECLARE_READ8_MEMBER(unk_r);
+ DECLARE_WRITE8_MEMBER(unk_w);
TILE_GET_INFO_MEMBER(get_bg_tile_info);
virtual void video_start();
virtual void palette_init();
@@ -161,13 +156,7 @@ 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
}
@@ -191,17 +180,41 @@ ADDRESS_MAP_END
*/
-
+/*
+ TODO: I/O lines handling. This is still work to be done; someone needs to
+ check the schematics. Here, we need to deliver some reasonable return values
+ instead of the 0. Returning a random number will create a nondeterministic
+ behavior at best.
+*/
READ8_MEMBER(jubilee_state::unk_r)
{
- return (machine().rand() & 0xff);
+// return (machine().rand() & 0xff);
+ logerror("CRU read from address %04x\n", offset<<4);
+ return 0;
+}
+
+WRITE8_MEMBER(jubilee_state::unk_w)
+{
+// return (machine().rand() & 0xff);
+ logerror("CRU write to address %04x: %d\n", offset<<1, data & 1);
+
+ // In particular, the interrupt from above must be cleared. We assume that
+ // this is done by one of the output lines, and from the 32 lines that are
+ // set right after an interrupt is serviced, all are set to 0, and only one
+ // is set to one. Maybe this one clears the interrupt.
+ // TODO: Check the schematics.
+ if (((offset<<1)==0x0ce2)&&(data==1))
+ {
+ m_maincpu->set_input_line(INT_9980A_LEVEL1, CLEAR_LINE);
+ }
}
static ADDRESS_MAP_START( jubileep_cru_map, AS_IO, 8, jubilee_state )
-// AM_RANGE(0x0000, 0xffff) AM_READ(unk_r)
+ AM_RANGE(0x0000, 0x01ff) AM_READ(unk_r)
+ AM_RANGE(0x0000, 0x0fff) AM_WRITE(unk_w)
// AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("crtc", mc6845_device, status_r, address_w)
// AM_RANGE(0x01, 0x01) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
- AM_RANGE(0xc8, 0xc8) AM_READ(unk_r)
+// AM_RANGE(0xc8, 0xc8) AM_READ(unk_r)
ADDRESS_MAP_END
/* I/O byte R/W
@@ -418,7 +431,6 @@ static MC6845_INTERFACE( mc6845_intf )
NULL /* update address callback */
};
-#if MODERN
static TMS9980A_CONFIG( cpuconf )
{
DEVCB_NULL,
@@ -427,7 +439,6 @@ static TMS9980A_CONFIG( cpuconf )
DEVCB_NULL, // Hold acknowledge
DEVCB_NULL // DBIN
};
-#endif
/*************************
* Machine Drivers *
@@ -436,13 +447,7 @@ 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 */