summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/mos6560.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound/mos6560.cpp')
-rw-r--r--src/devices/sound/mos6560.cpp48
1 files changed, 17 insertions, 31 deletions
diff --git a/src/devices/sound/mos6560.cpp b/src/devices/sound/mos6560.cpp
index a140e63602b..6434621f13d 100644
--- a/src/devices/sound/mos6560.cpp
+++ b/src/devices/sound/mos6560.cpp
@@ -59,7 +59,7 @@
#include "emu.h"
-#include "sound/mos6560.h"
+#include "mos6560.h"
/*****************************************************************************
@@ -325,6 +325,8 @@ void mos6560_device::drawlines( int first, int last )
void mos6560_device::write(offs_t offset, uint8_t data)
{
+ offset &= 0xf;
+
DBG_LOG(1, "mos6560_port_w", ("%.4x:%.2x\n", offset, data));
switch (offset)
@@ -403,6 +405,8 @@ void mos6560_device::write(offs_t offset, uint8_t data)
uint8_t mos6560_device::read(offs_t offset)
{
+ offset &= 0xf;
+
int val;
switch (offset)
@@ -459,7 +463,7 @@ uint8_t mos6560_device::bus_r()
mos6560_raster_interrupt_gen
-------------------------------------------------*/
-void mos6560_device::raster_interrupt_gen()
+TIMER_CALLBACK_MEMBER(mos6560_device::raster_interrupt_gen)
{
m_rasterline++;
if (m_rasterline >= m_total_lines)
@@ -680,16 +684,16 @@ void mos6560_device::mos6560_colorram_map(address_map &map)
map(0x000, 0x3ff).ram();
}
-mos6560_device::mos6560_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint32_t variant)
- : device_t(mconfig, type, tag, owner, clock),
- device_memory_interface(mconfig, *this),
- device_sound_interface(mconfig, *this),
- device_video_interface(mconfig, *this),
- m_variant(variant),
- m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 14, 0, address_map_constructor(FUNC(mos6560_device::mos6560_videoram_map), this)),
- m_colorram_space_config("colorram", ENDIANNESS_LITTLE, 8, 10, 0, address_map_constructor(FUNC(mos6560_device::mos6560_colorram_map), this)),
- m_read_potx(*this),
- m_read_poty(*this)
+mos6560_device::mos6560_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint32_t variant) :
+ device_t(mconfig, type, tag, owner, clock),
+ device_memory_interface(mconfig, *this),
+ device_sound_interface(mconfig, *this),
+ device_video_interface(mconfig, *this),
+ m_variant(variant),
+ m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 14, 0, address_map_constructor(FUNC(mos6560_device::mos6560_videoram_map), this)),
+ m_colorram_space_config("colorram", ENDIANNESS_LITTLE, 8, 10, 0, address_map_constructor(FUNC(mos6560_device::mos6560_colorram_map), this)),
+ m_read_potx(*this, 0xff),
+ m_read_poty(*this, 0xff)
{
}
@@ -731,10 +735,6 @@ void mos6560_device::device_start()
{
screen().register_screen_bitmap(m_bitmap);
- // resolve callbacks
- m_read_potx.resolve_safe(0xff);
- m_read_poty.resolve_safe(0xff);
-
switch (m_variant)
{
case TYPE_6560:
@@ -760,7 +760,7 @@ void mos6560_device::device_start()
}
// allocate timers
- m_line_timer = timer_alloc(TIMER_LINE);
+ m_line_timer = timer_alloc(FUNC(mos6560_device::raster_interrupt_gen), this);
m_line_timer->adjust(screen().scan_period(), 0, screen().scan_period());
// initialize sound
@@ -862,20 +862,6 @@ void mos6560_device::device_reset()
//-------------------------------------------------
-// device_timer - handler timer events
-//-------------------------------------------------
-
-void mos6560_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
-{
- switch (id)
- {
- case TIMER_LINE:
- raster_interrupt_gen();
- break;
- }
-}
-
-//-------------------------------------------------
// sound_stream_update - handle a stream update
//-------------------------------------------------