diff options
Diffstat (limited to 'src/mess/video/mos6566.c')
-rw-r--r-- | src/mess/video/mos6566.c | 84 |
1 files changed, 36 insertions, 48 deletions
diff --git a/src/mess/video/mos6566.c b/src/mess/video/mos6566.c index 4b5762f9124..102c0067042 100644 --- a/src/mess/video/mos6566.c +++ b/src/mess/video/mos6566.c @@ -267,7 +267,7 @@ inline void mos6566_device::set_interrupt( int mask ) { DBG_LOG(2, "vic2", ("irq start %.2x\n", mask)); m_reg[0x19] |= 0x80; - m_out_irq_func(ASSERT_LINE); + m_write_irq(ASSERT_LINE); } } m_reg[0x19] |= mask; @@ -280,7 +280,7 @@ inline void mos6566_device::clear_interrupt( int mask ) { DBG_LOG(2, "vic2", ("irq end %.2x\n", mask)); m_reg[0x19] &= ~0x80; - m_out_irq_func(CLEAR_LINE); + m_write_irq(CLEAR_LINE); } } @@ -586,17 +586,26 @@ mos6566_device::mos6566_device(const machine_config &mconfig, const char *tag, d m_icount(0), m_variant(TYPE_6566), m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 14, 0, NULL, *ADDRESS_MAP_NAME(mos6566_videoram_map)), - m_colorram_space_config("colorram", ENDIANNESS_LITTLE, 8, 10, 0, NULL, *ADDRESS_MAP_NAME(mos6566_colorram_map)) + m_colorram_space_config("colorram", ENDIANNESS_LITTLE, 8, 10, 0, NULL, *ADDRESS_MAP_NAME(mos6566_colorram_map)), + m_write_irq(*this), + m_write_ba(*this), + m_write_aec(*this), + m_write_k(*this) { } -mos6566_device::mos6566_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) +mos6566_device::mos6566_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant) : device_t(mconfig, type, name, tag, owner, clock), device_memory_interface(mconfig, *this), device_execute_interface(mconfig, *this), m_icount(0), + m_variant(variant), m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 14, 0, NULL, *ADDRESS_MAP_NAME(mos6566_videoram_map)), m_colorram_space_config("colorram", ENDIANNESS_LITTLE, 8, 10, 0, NULL, *ADDRESS_MAP_NAME(mos6566_colorram_map)), + m_write_irq(*this), + m_write_ba(*this), + m_write_aec(*this), + m_write_k(*this), m_phi0(1), m_ba(ASSERT_LINE), m_aec(ASSERT_LINE) @@ -604,52 +613,28 @@ mos6566_device::mos6566_device(const machine_config &mconfig, device_type type, } mos6567_device::mos6567_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - :mos6566_device(mconfig, MOS6567, "MOS6567", tag, owner, clock) { m_variant = TYPE_6567; } + :mos6566_device(mconfig, MOS6567, "MOS6567", tag, owner, clock, TYPE_6567) { } -mos6567_device::mos6567_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) - :mos6566_device(mconfig, type, name, tag, owner, clock) { } +mos6567_device::mos6567_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant) + :mos6566_device(mconfig, type, name, tag, owner, clock, TYPE_6567) { } mos8562_device::mos8562_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - :mos6567_device(mconfig, MOS8562, "MOS8562", tag, owner, clock) { m_variant = TYPE_8562; } + :mos6567_device(mconfig, MOS8562, "MOS8562", tag, owner, clock, TYPE_8562) { } mos8564_device::mos8564_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - :mos6567_device(mconfig, MOS8564, "MOS8564", tag, owner, clock) { m_variant = TYPE_8564; } + :mos6567_device(mconfig, MOS8564, "MOS8564", tag, owner, clock, TYPE_8564) { } mos6569_device::mos6569_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - :mos6566_device(mconfig, MOS6566, "MOS6569", tag, owner, clock) { m_variant = TYPE_6569; } + :mos6566_device(mconfig, MOS6566, "MOS6569", tag, owner, clock, TYPE_6569) { } -mos6569_device::mos6569_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) - :mos6566_device(mconfig, type, name, tag, owner, clock) { } +mos6569_device::mos6569_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, UINT32 variant) + :mos6566_device(mconfig, type, name, tag, owner, clock, TYPE_6569) { } mos8565_device::mos8565_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - :mos6569_device(mconfig, MOS8565, "MOS8565", tag, owner, clock) { m_variant = TYPE_8565; } + :mos6569_device(mconfig, MOS8565, "MOS8565", tag, owner, clock, TYPE_8565) { } mos8566_device::mos8566_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - :mos6569_device(mconfig, MOS8566, "MOS8566", tag, owner, clock) { m_variant = TYPE_8566; } - - -//------------------------------------------------- -// device_config_complete - perform any -// operations now that the configuration is -// complete -//------------------------------------------------- - -void mos6566_device::device_config_complete() -{ - // inherit a copy of the static data - const mos6566_interface *intf = reinterpret_cast<const mos6566_interface *>(static_config()); - if (intf != NULL) - *static_cast<mos6566_interface *>(this) = *intf; - - // or initialize to defaults if none provided - else - { - memset(&m_out_irq_cb, 0, sizeof(m_out_irq_cb)); - memset(&m_out_ba_cb, 0, sizeof(m_out_ba_cb)); - memset(&m_out_aec_cb, 0, sizeof(m_out_aec_cb)); - memset(&m_out_k_cb, 0, sizeof(m_out_k_cb)); - } -} + :mos6569_device(mconfig, MOS8566, "MOS8566", tag, owner, clock, TYPE_8566) { } //------------------------------------------------- @@ -662,12 +647,15 @@ void mos6566_device::device_start() m_icountptr = &m_icount; // resolve callbacks - m_out_irq_func.resolve(m_out_irq_cb, *this); - m_out_ba_func.resolve(m_out_ba_cb, *this); - m_out_aec_func.resolve(m_out_aec_cb, *this); - m_out_k_func.resolve(m_out_k_cb, *this); + m_write_irq.resolve_safe(); + m_write_ba.resolve_safe(); + m_write_aec.resolve_safe(); + m_write_k.resolve_safe(); - m_cpu = machine().device<cpu_device>(m_cpu_tag); + if (m_cpu_tag != NULL) + m_cpu = machine().device<cpu_device>(m_cpu_tag); + else + m_cpu = machine().firstcpu; m_screen = machine().device<screen_device>(m_screen_tag); m_screen->register_screen_bitmap(m_bitmap); @@ -1439,8 +1427,8 @@ void mos6566_device::execute_run() m_phi0 = 1; set_aec(BIT(m_aec_delay, 2)); - m_out_ba_func(m_ba); - m_out_aec_func(m_aec); + m_write_ba(m_ba); + m_write_aec(m_aec); m_raster_x += 8; if (m_raster_x == 0x1fc) m_raster_x = 0x004; @@ -2008,8 +1996,8 @@ void mos6569_device::execute_run() m_phi0 = 1; set_aec(BIT(m_aec_delay, 2)); - m_out_ba_func(m_ba); - m_out_aec_func(m_aec); + m_write_ba(m_ba); + m_write_aec(m_aec); m_raster_x += 8; if (m_raster_x == 0x1fc) m_raster_x = 0x004; @@ -2789,7 +2777,7 @@ WRITE8_MEMBER( mos6566_device::write ) { m_reg[offset] = data | 0xf8; - m_out_k_func(0, data & 0x07); + m_write_k((offs_t)0, data & 0x07); } break; |