summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine
diff options
context:
space:
mode:
author angelosa <salese_corp_ltd@email.it>2016-06-15 19:38:04 +0200
committer angelosa <salese_corp_ltd@email.it>2016-06-15 19:38:04 +0200
commitb49b23b7dfa48377bf5e7abfdd45630248cadc01 (patch)
treec4dda142a7d354de3a19a015695f0627852e0cb3 /src/devices/machine
parent1dd74e3eb7986e87f287a74d1ec348e7234cee0c (diff)
Added command strobe callback interface for LDV1000, and hooked it up to esh.cpp driver. [Angelo Salese]
(out of whatsnew: also fixed irq 0 hookup, using device_timer to ack an irq for MAME is never a good idea)
Diffstat (limited to 'src/devices/machine')
-rw-r--r--src/devices/machine/ldv1000.cpp10
-rw-r--r--src/devices/machine/ldv1000.h8
2 files changed, 16 insertions, 2 deletions
diff --git a/src/devices/machine/ldv1000.cpp b/src/devices/machine/ldv1000.cpp
index 36dae481853..27c874eadf7 100644
--- a/src/devices/machine/ldv1000.cpp
+++ b/src/devices/machine/ldv1000.cpp
@@ -63,8 +63,8 @@ const device_type PIONEER_LDV1000 = &device_creator<pioneer_ldv1000_device>;
static ADDRESS_MAP_START( ldv1000_map, AS_PROGRAM, 8, pioneer_ldv1000_device )
AM_RANGE(0x0000, 0x1fff) AM_MIRROR(0x6000) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x3800) AM_RAM
- AM_RANGE(0xc000, 0xc003) AM_MIRROR(0x9ff0) AM_DEVREADWRITE("ldvppi0", i8255_device, read, write)
- AM_RANGE(0xc004, 0xc007) AM_MIRROR(0x9ff0) AM_DEVREADWRITE("ldvppi1", i8255_device, read, write)
+ AM_RANGE(0xc000, 0xc003) AM_MIRROR(0x1ff0) AM_DEVREADWRITE("ldvppi0", i8255_device, read, write)
+ AM_RANGE(0xc004, 0xc007) AM_MIRROR(0x1ff0) AM_DEVREADWRITE("ldvppi1", i8255_device, read, write)
ADDRESS_MAP_END
@@ -126,6 +126,7 @@ pioneer_ldv1000_device::pioneer_ldv1000_device(const machine_config &mconfig, co
m_z80_cpu(*this, "ldv1000"),
m_z80_ctc(*this, "ldvctc"),
m_multitimer(nullptr),
+ m_command_strobe_cb(*this),
m_command(0),
m_status(0),
m_vsync(false),
@@ -175,6 +176,8 @@ void pioneer_ldv1000_device::device_start()
// allocate timers
m_multitimer = timer_alloc(TID_MULTIJUMP);
+
+ m_command_strobe_cb.resolve_safe();
}
@@ -648,6 +651,9 @@ WRITE8_MEMBER( pioneer_ldv1000_device::ppi1_portc_w )
printf("\n");
}
+ // bit 4 sends a command strobe signal to Host CPU
+ m_command_strobe_cb(bool(data & 0x10));
+
// video squelch is controlled by bit 3
set_video_squelch((data & 0x08) == 0);
diff --git a/src/devices/machine/ldv1000.h b/src/devices/machine/ldv1000.h
index c2f9ead67a6..c7d798d89df 100644
--- a/src/devices/machine/ldv1000.h
+++ b/src/devices/machine/ldv1000.h
@@ -26,6 +26,10 @@
#define MCFG_LASERDISC_LDV1000_ADD(_tag) \
MCFG_DEVICE_ADD(_tag, PIONEER_LDV1000, 0)
+#define MCFG_LASERDISC_LDV1000_COMMAND_STROBE_CB(_cb) \
+ downcast<pioneer_ldv1000_device *>(device)->set_command_strobe_callback(DEVCB_##_cb);
+
+
//**************************************************************************
// GLOBAL VARIABLES
@@ -49,6 +53,8 @@ public:
// construction/destruction
pioneer_ldv1000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+ template<class _cmd_strobe_cb> void set_command_strobe_callback(_cmd_strobe_cb latch) { m_command_strobe_cb.set_callback(latch); }
+
// input and output
void data_w(UINT8 data);
void enter_w(UINT8 data);
@@ -102,6 +108,7 @@ protected:
required_device<z80_device> m_z80_cpu; /* CPU index of the Z80 */
required_device<z80ctc_device> m_z80_ctc; /* CTC device */
emu_timer * m_multitimer; /* multi-jump timer device */
+ devcb_write_line m_command_strobe_cb;
/* communication status */
UINT8 m_command; /* command byte to the player */
@@ -122,6 +129,7 @@ protected:
UINT8 m_vbi[7*3]; /* VBI data */
bool m_vbiready; /* VBI ready flag */
UINT8 m_vbiindex; /* index within the VBI data */
+
};