mcd212: Misc. updates (nw)

- Remove spurious second interrupt output (was already dummied out)
- Take ownership of shared pointers to video RAM
- Improve device name
This commit is contained in:
AJR 2019-04-18 18:38:27 -04:00
parent 72a90d61d2
commit b5206d3f5d
4 changed files with 28 additions and 48 deletions

View File

@ -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) void cdi_state::cdimono1_mem(address_map &map)
{ {
map(0x00000000, 0x0007ffff).ram().share("planea"); map(0x00000000, 0x0007ffff).ram().share("mcd212:planea");
map(0x00200000, 0x0027ffff).ram().share("planeb"); map(0x00200000, 0x0027ffff).ram().share("mcd212:planeb");
map(0x00300000, 0x00303bff).rw(m_cdic, FUNC(cdicdic_device::ram_r), FUNC(cdicdic_device::ram_w)); map(0x00300000, 0x00303bff).rw(m_cdic, FUNC(cdicdic_device::ram_r), FUNC(cdicdic_device::ram_w));
#if ENABLE_UART_PRINTING #if ENABLE_UART_PRINTING
map(0x00301400, 0x00301403).r(m_maincpu, FUNC(scc68070_device::uart_loopback_enable)); 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) void cdi_state::cdimono2_mem(address_map &map)
{ {
map(0x00000000, 0x0007ffff).ram().share("planea"); map(0x00000000, 0x0007ffff).ram().share("mcd212:planea");
map(0x00200000, 0x0027ffff).ram().share("planeb"); map(0x00200000, 0x0027ffff).ram().share("mcd212:planeb");
#if ENABLE_UART_PRINTING #if ENABLE_UART_PRINTING
map(0x00301400, 0x00301403).r(m_maincpu, FUNC(scc68070_device::uart_loopback_enable)); map(0x00301400, 0x00301403).r(m_maincpu, FUNC(scc68070_device::uart_loopback_enable));
#endif #endif
@ -115,10 +115,10 @@ void cdi_state::cdimono2_mem(address_map &map)
void cdi_state::cdi910_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(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 #if ENABLE_UART_PRINTING
map(0x00301400, 0x00301403).r(m_maincpu, FUNC(scc68070_device::uart_loopback_enable)); map(0x00301400, 0x00301403).r(m_maincpu, FUNC(scc68070_device::uart_loopback_enable));
#endif #endif
@ -828,8 +828,7 @@ void cdi_state::cdimono1_base(machine_config &config)
MCD212(config, m_mcd212, CLOCK_A); MCD212(config, m_mcd212, CLOCK_A);
m_mcd212->set_screen("screen"); m_mcd212->set_screen("screen");
m_mcd212->int1_callback().set(m_maincpu, FUNC(scc68070_device::int1_w)); m_mcd212->int_callback().set(m_maincpu, FUNC(scc68070_device::int1_w));
m_mcd212->int2_callback().set(m_maincpu, FUNC(scc68070_device::int2_w));
m_mcd212->set_scanline_callback(FUNC(cdi_state::draw_lcd)); m_mcd212->set_scanline_callback(FUNC(cdi_state::draw_lcd));
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); 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); MCD212(config, m_mcd212, CLOCK_A);
m_mcd212->set_screen("screen"); m_mcd212->set_screen("screen");
m_mcd212->int1_callback().set(m_maincpu, FUNC(scc68070_device::int1_w)); m_mcd212->int_callback().set(m_maincpu, FUNC(scc68070_device::int1_w));
m_mcd212->int2_callback().set(m_maincpu, FUNC(scc68070_device::int2_w));
m_mcd212->set_scanline_callback(FUNC(cdi_state::draw_lcd)); m_mcd212->set_scanline_callback(FUNC(cdi_state::draw_lcd));
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); 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, "lspeaker", 1.0);
m_cdda->add_route(ALL_OUTPUTS, "rspeaker", 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) void cdi_state::cdi910(machine_config &config)
@ -940,8 +938,7 @@ void cdi_state::cdi910(machine_config &config)
MCD212(config, m_mcd212, CLOCK_A); MCD212(config, m_mcd212, CLOCK_A);
m_mcd212->set_screen("screen"); m_mcd212->set_screen("screen");
m_mcd212->int1_callback().set(m_maincpu, FUNC(scc68070_device::int1_w)); m_mcd212->int_callback().set(m_maincpu, FUNC(scc68070_device::int1_w));
m_mcd212->int2_callback().set(m_maincpu, FUNC(scc68070_device::int2_w));
m_mcd212->set_scanline_callback(FUNC(cdi_state::draw_lcd)); m_mcd212->set_scanline_callback(FUNC(cdi_state::draw_lcd));
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); 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, "lspeaker", 1.0);
m_cdda->add_route(ALL_OUTPUTS, "rspeaker", 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) // CD-i Mono-I, with CD-ROM image device (MESS) and Software List (MESS)

View File

@ -20,8 +20,7 @@ public:
cdi_state(const machine_config &mconfig, device_type type, const char *tag) cdi_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag) : driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu") , m_maincpu(*this, "maincpu")
, m_planea(*this, "planea") , m_planea(*this, "mcd212:planea")
, m_planeb(*this, "planeb")
, m_input1(*this, "INPUT1") , m_input1(*this, "INPUT1")
, m_input2(*this, "INPUT2") , m_input2(*this, "INPUT2")
, m_slave_hle(*this, "slave_hle") , m_slave_hle(*this, "slave_hle")
@ -72,7 +71,6 @@ public:
required_device<scc68070_device> m_maincpu; required_device<scc68070_device> m_maincpu;
required_shared_ptr<uint16_t> m_planea; required_shared_ptr<uint16_t> m_planea;
required_shared_ptr<uint16_t> m_planeb;
optional_ioport m_input1; optional_ioport m_input1;
optional_ioport m_input2; optional_ioport m_input2;
optional_device<cdislave_device> m_slave_hle; optional_device<cdislave_device> m_slave_hle;

View File

@ -3,7 +3,7 @@
/****************************************************************************** /******************************************************************************
CD-i MCD212 video emulation CD-i MCD212 Video Decoder and System Controller emulation
------------------- -------------------
written by Ryan Holtz written by Ryan Holtz
@ -30,7 +30,7 @@ TODO:
// device type definition // 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 #if ENABLE_VERBOSE_LOG
static inline void ATTR_PRINTF(3,4) verboselog(device_t& device, int n_level, const char *s_fmt, ...) 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 ); verboselog(*this, 11, "%08x: %08x: ICA %d: INTERRUPT\n", addr * 2 + channel * 0x200000, cmd, channel );
m_channel[1].csrr |= 1 << (2 - channel); m_channel[1].csrr |= 1 << (2 - channel);
if(m_channel[1].csrr & (MCD212_CSR2R_IT1 | MCD212_CSR2R_IT2)) if(m_channel[1].csrr & (MCD212_CSR2R_IT1 | MCD212_CSR2R_IT2))
m_int1_callback(ASSERT_LINE); m_int_callback(ASSERT_LINE);
#if 0
if(m_channel[1].csrr & MCD212_CSR2R_IT2)
m_int2_callback(ASSERT_LINE);
#endif
break; break;
case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: // RELOAD DISPLAY PARAMETERS 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 ); 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 ); verboselog(*this, 11, "%08x: %08x: DCA %d: INTERRUPT\n", addr * 2 + channel * 0x200000, cmd, channel );
m_channel[1].csrr |= 1 << (2 - channel); m_channel[1].csrr |= 1 << (2 - channel);
if(m_channel[1].csrr & (MCD212_CSR2R_IT1 | MCD212_CSR2R_IT2)) if(m_channel[1].csrr & (MCD212_CSR2R_IT1 | MCD212_CSR2R_IT2))
m_int1_callback(ASSERT_LINE); m_int_callback(ASSERT_LINE);
#if 0
if(m_channel[1].csrr & MCD212_CSR2R_IT2)
m_int2_callback(ASSERT_LINE);
#endif
break; break;
case 0x78: case 0x79: case 0x7a: case 0x7b: case 0x7c: case 0x7d: case 0x7e: case 0x7f: // RELOAD DISPLAY PARAMETERS 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 ); 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) 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); 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; uint8_t old_csr = m_channel[1].csrr;
m_channel[1].csrr &= ~(MCD212_CSR2R_IT1 | MCD212_CSR2R_IT2); m_channel[1].csrr &= ~(MCD212_CSR2R_IT1 | MCD212_CSR2R_IT2);
if (old_csr & MCD212_CSR2R_IT1) if (old_csr & (MCD212_CSR2R_IT1 | MCD212_CSR2R_IT2))
m_int1_callback(CLEAR_LINE); m_int_callback(CLEAR_LINE);
if (old_csr & MCD212_CSR2R_IT2)
m_int2_callback(CLEAR_LINE);
return old_csr; return old_csr;
} }
} }
@ -1416,8 +1406,7 @@ void mcd212_device::device_reset()
memset(m_region_flag_0, 0, 768); memset(m_region_flag_0, 0, 768);
memset(m_region_flag_1, 0, 768); memset(m_region_flag_1, 0, 768);
m_int1_callback(CLEAR_LINE); m_int_callback(CLEAR_LINE);
m_int2_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) 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_t(mconfig, MCD212, tag, owner, clock)
, device_video_interface(mconfig, *this) , device_video_interface(mconfig, *this)
, m_int1_callback(*this) , m_int_callback(*this)
, m_int2_callback(*this) , m_planea(*this, "planea")
, m_planea(*this, "^planea") , m_planeb(*this, "planeb")
, 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() void mcd212_device::device_resolve_objects()
{ {
m_int1_callback.resolve_safe(); m_int_callback.resolve_safe();
m_int2_callback.resolve_safe();
m_scanline_callback.bind_relative_to(*owner()); m_scanline_callback.bind_relative_to(*owner());
} }

View File

@ -124,8 +124,7 @@ public:
// construction/destruction // construction/destruction
mcd212_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); mcd212_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
auto int1_callback() { return m_int1_callback.bind(); } auto int_callback() { return m_int_callback.bind(); }
auto int2_callback() { return m_int2_callback.bind(); }
template <typename Object> void set_scanline_callback(Object &&cb) { m_scanline_callback = std::forward<Object>(cb); } 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; } void set_scanline_callback(scanline_callback_delegate callback) { m_scanline_callback = callback; }
@ -218,8 +217,7 @@ protected:
private: private:
// interrupt callbacks // interrupt callbacks
devcb_write_line m_int1_callback; devcb_write_line m_int_callback;
devcb_write_line m_int2_callback;
scanline_callback_delegate m_scanline_callback; scanline_callback_delegate m_scanline_callback;