summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2019-04-18 18:38:27 -0400
committer AJR <ajrhacker@users.noreply.github.com>2019-04-18 18:40:08 -0400
commitb5206d3f5dabfb33e2b188811ad40b7673f42ac8 (patch)
tree0c5e0108644e1a4231b2148e865876d00ff800d5
parent72a90d61d25ff55167705370d7ae61a69b4ffefa (diff)
mcd212: Misc. updates (nw)
- Remove spurious second interrupt output (was already dummied out) - Take ownership of shared pointers to video RAM - Improve device name
-rw-r--r--src/mame/drivers/cdi.cpp25
-rw-r--r--src/mame/includes/cdi.h4
-rw-r--r--src/mame/video/mcd212.cpp41
-rw-r--r--src/mame/video/mcd212.h6
4 files changed, 28 insertions, 48 deletions
diff --git a/src/mame/drivers/cdi.cpp b/src/mame/drivers/cdi.cpp
index f6552364a25..d43c60f18c4 100644
--- a/src/mame/drivers/cdi.cpp
+++ b/src/mame/drivers/cdi.cpp
@@ -77,8 +77,8 @@ static inline void ATTR_PRINTF(3,4) verboselog(device_t& device, int n_level, co
void cdi_state::cdimono1_mem(address_map &map)
{
- map(0x00000000, 0x0007ffff).ram().share("planea");
- map(0x00200000, 0x0027ffff).ram().share("planeb");
+ map(0x00000000, 0x0007ffff).ram().share("mcd212:planea");
+ map(0x00200000, 0x0027ffff).ram().share("mcd212:planeb");
map(0x00300000, 0x00303bff).rw(m_cdic, FUNC(cdicdic_device::ram_r), FUNC(cdicdic_device::ram_w));
#if ENABLE_UART_PRINTING
map(0x00301400, 0x00301403).r(m_maincpu, FUNC(scc68070_device::uart_loopback_enable));
@@ -96,8 +96,8 @@ void cdi_state::cdimono1_mem(address_map &map)
void cdi_state::cdimono2_mem(address_map &map)
{
- map(0x00000000, 0x0007ffff).ram().share("planea");
- map(0x00200000, 0x0027ffff).ram().share("planeb");
+ map(0x00000000, 0x0007ffff).ram().share("mcd212:planea");
+ map(0x00200000, 0x0027ffff).ram().share("mcd212:planeb");
#if ENABLE_UART_PRINTING
map(0x00301400, 0x00301403).r(m_maincpu, FUNC(scc68070_device::uart_loopback_enable));
#endif
@@ -115,10 +115,10 @@ void cdi_state::cdimono2_mem(address_map &map)
void cdi_state::cdi910_mem(address_map &map)
{
- map(0x00000000, 0x0007ffff).ram().share("planea");
+ map(0x00000000, 0x0007ffff).ram().share("mcd212:planea");
map(0x00180000, 0x001fffff).rom().region("maincpu", 0); // boot vectors point here
- map(0x00200000, 0x0027ffff).ram().share("planeb");
+ map(0x00200000, 0x0027ffff).ram().share("mcd212:planeb");
#if ENABLE_UART_PRINTING
map(0x00301400, 0x00301403).r(m_maincpu, FUNC(scc68070_device::uart_loopback_enable));
#endif
@@ -828,8 +828,7 @@ void cdi_state::cdimono1_base(machine_config &config)
MCD212(config, m_mcd212, CLOCK_A);
m_mcd212->set_screen("screen");
- m_mcd212->int1_callback().set(m_maincpu, FUNC(scc68070_device::int1_w));
- m_mcd212->int2_callback().set(m_maincpu, FUNC(scc68070_device::int2_w));
+ m_mcd212->int_callback().set(m_maincpu, FUNC(scc68070_device::int1_w));
m_mcd212->set_scanline_callback(FUNC(cdi_state::draw_lcd));
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
@@ -884,8 +883,7 @@ void cdi_state::cdimono2(machine_config &config)
MCD212(config, m_mcd212, CLOCK_A);
m_mcd212->set_screen("screen");
- m_mcd212->int1_callback().set(m_maincpu, FUNC(scc68070_device::int1_w));
- m_mcd212->int2_callback().set(m_maincpu, FUNC(scc68070_device::int2_w));
+ m_mcd212->int_callback().set(m_maincpu, FUNC(scc68070_device::int1_w));
m_mcd212->set_scanline_callback(FUNC(cdi_state::draw_lcd));
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
@@ -930,7 +928,7 @@ void cdi_state::cdimono2(machine_config &config)
m_cdda->add_route(ALL_OUTPUTS, "lspeaker", 1.0);
m_cdda->add_route(ALL_OUTPUTS, "rspeaker", 1.0);
- MK48T08(config, "mk48t08", 0);
+ MK48T08(config, "mk48t08");
}
void cdi_state::cdi910(machine_config &config)
@@ -940,8 +938,7 @@ void cdi_state::cdi910(machine_config &config)
MCD212(config, m_mcd212, CLOCK_A);
m_mcd212->set_screen("screen");
- m_mcd212->int1_callback().set(m_maincpu, FUNC(scc68070_device::int1_w));
- m_mcd212->int2_callback().set(m_maincpu, FUNC(scc68070_device::int2_w));
+ m_mcd212->int_callback().set(m_maincpu, FUNC(scc68070_device::int1_w));
m_mcd212->set_scanline_callback(FUNC(cdi_state::draw_lcd));
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
@@ -986,7 +983,7 @@ void cdi_state::cdi910(machine_config &config)
m_cdda->add_route(ALL_OUTPUTS, "lspeaker", 1.0);
m_cdda->add_route(ALL_OUTPUTS, "rspeaker", 1.0);
- MK48T08(config, "mk48t08", 0);
+ MK48T08(config, "mk48t08");
}
// CD-i Mono-I, with CD-ROM image device (MESS) and Software List (MESS)
diff --git a/src/mame/includes/cdi.h b/src/mame/includes/cdi.h
index 5caf579a772..66c6526d3ba 100644
--- a/src/mame/includes/cdi.h
+++ b/src/mame/includes/cdi.h
@@ -20,8 +20,7 @@ public:
cdi_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
- , m_planea(*this, "planea")
- , m_planeb(*this, "planeb")
+ , m_planea(*this, "mcd212:planea")
, m_input1(*this, "INPUT1")
, m_input2(*this, "INPUT2")
, m_slave_hle(*this, "slave_hle")
@@ -72,7 +71,6 @@ public:
required_device<scc68070_device> m_maincpu;
required_shared_ptr<uint16_t> m_planea;
- required_shared_ptr<uint16_t> m_planeb;
optional_ioport m_input1;
optional_ioport m_input2;
optional_device<cdislave_device> m_slave_hle;
diff --git a/src/mame/video/mcd212.cpp b/src/mame/video/mcd212.cpp
index 7458b4b5fdb..45ac18184bb 100644
--- a/src/mame/video/mcd212.cpp
+++ b/src/mame/video/mcd212.cpp
@@ -3,7 +3,7 @@
/******************************************************************************
- CD-i MCD212 video emulation
+ CD-i MCD212 Video Decoder and System Controller emulation
-------------------
written by Ryan Holtz
@@ -30,7 +30,7 @@ TODO:
// device type definition
-DEFINE_DEVICE_TYPE(MCD212, mcd212_device, "mcd212", "MCD212 Video")
+DEFINE_DEVICE_TYPE(MCD212, mcd212_device, "mcd212", "MCD212 VDSC")
#if ENABLE_VERBOSE_LOG
static inline void ATTR_PRINTF(3,4) verboselog(device_t& device, int n_level, const char *s_fmt, ...)
@@ -546,11 +546,7 @@ void mcd212_device::process_ica(int channel)
verboselog(*this, 11, "%08x: %08x: ICA %d: INTERRUPT\n", addr * 2 + channel * 0x200000, cmd, channel );
m_channel[1].csrr |= 1 << (2 - channel);
if(m_channel[1].csrr & (MCD212_CSR2R_IT1 | MCD212_CSR2R_IT2))
- m_int1_callback(ASSERT_LINE);
-#if 0
- if(m_channel[1].csrr & MCD212_CSR2R_IT2)
- m_int2_callback(ASSERT_LINE);
-#endif
+ m_int_callback(ASSERT_LINE);
break;
case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: // RELOAD DISPLAY PARAMETERS
verboselog(*this, 6, "%08x: %08x: ICA %d: RELOAD DISPLAY PARAMETERS\n", addr * 2 + channel * 0x200000, cmd, channel );
@@ -621,11 +617,7 @@ void mcd212_device::process_dca(int channel)
verboselog(*this, 11, "%08x: %08x: DCA %d: INTERRUPT\n", addr * 2 + channel * 0x200000, cmd, channel );
m_channel[1].csrr |= 1 << (2 - channel);
if(m_channel[1].csrr & (MCD212_CSR2R_IT1 | MCD212_CSR2R_IT2))
- m_int1_callback(ASSERT_LINE);
-#if 0
- if(m_channel[1].csrr & MCD212_CSR2R_IT2)
- m_int2_callback(ASSERT_LINE);
-#endif
+ m_int_callback(ASSERT_LINE);
break;
case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: // RELOAD DISPLAY PARAMETERS
verboselog(*this, 6, "%08x: %08x: DCA %d: RELOAD DISPLAY PARAMETERS\n", addr * 2 + channel * 0x200000, cmd, channel );
@@ -1250,18 +1242,16 @@ READ16_MEMBER( mcd212_device::regs_r )
if(ACCESSING_BITS_0_7)
{
verboselog(*this, 12, "mcd212_r: Status Register %d: %02x & %04x\n", channel + 1, m_channel[1 - (offset / 8)].csrr, mem_mask);
- if(channel == 0)
+ if(channel == 0 || machine().side_effects_disabled())
{
- return m_channel[0].csrr;
+ return m_channel[channel].csrr;
}
- else if (!machine().side_effects_disabled())
+ else
{
uint8_t old_csr = m_channel[1].csrr;
m_channel[1].csrr &= ~(MCD212_CSR2R_IT1 | MCD212_CSR2R_IT2);
- if (old_csr & MCD212_CSR2R_IT1)
- m_int1_callback(CLEAR_LINE);
- if (old_csr & MCD212_CSR2R_IT2)
- m_int2_callback(CLEAR_LINE);
+ if (old_csr & (MCD212_CSR2R_IT1 | MCD212_CSR2R_IT2))
+ m_int_callback(CLEAR_LINE);
return old_csr;
}
}
@@ -1416,8 +1406,7 @@ void mcd212_device::device_reset()
memset(m_region_flag_0, 0, 768);
memset(m_region_flag_1, 0, 768);
- m_int1_callback(CLEAR_LINE);
- m_int2_callback(CLEAR_LINE);
+ m_int_callback(CLEAR_LINE);
}
//-------------------------------------------------
@@ -1427,10 +1416,9 @@ void mcd212_device::device_reset()
mcd212_device::mcd212_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, MCD212, tag, owner, clock)
, device_video_interface(mconfig, *this)
- , m_int1_callback(*this)
- , m_int2_callback(*this)
- , m_planea(*this, "^planea")
- , m_planeb(*this, "^planeb")
+ , m_int_callback(*this)
+ , m_planea(*this, "planea")
+ , m_planeb(*this, "planeb")
{
}
@@ -1442,8 +1430,7 @@ mcd212_device::mcd212_device(const machine_config &mconfig, const char *tag, dev
void mcd212_device::device_resolve_objects()
{
- m_int1_callback.resolve_safe();
- m_int2_callback.resolve_safe();
+ m_int_callback.resolve_safe();
m_scanline_callback.bind_relative_to(*owner());
}
diff --git a/src/mame/video/mcd212.h b/src/mame/video/mcd212.h
index a4881e80d08..cae78f3159d 100644
--- a/src/mame/video/mcd212.h
+++ b/src/mame/video/mcd212.h
@@ -124,8 +124,7 @@ public:
// construction/destruction
mcd212_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- auto int1_callback() { return m_int1_callback.bind(); }
- auto int2_callback() { return m_int2_callback.bind(); }
+ auto int_callback() { return m_int_callback.bind(); }
template <typename Object> void set_scanline_callback(Object &&cb) { m_scanline_callback = std::forward<Object>(cb); }
void set_scanline_callback(scanline_callback_delegate callback) { m_scanline_callback = callback; }
@@ -218,8 +217,7 @@ protected:
private:
// interrupt callbacks
- devcb_write_line m_int1_callback;
- devcb_write_line m_int2_callback;
+ devcb_write_line m_int_callback;
scanline_callback_delegate m_scanline_callback;