diff options
author | 2019-03-10 14:08:24 -0400 | |
---|---|---|
committer | 2019-03-10 14:08:24 -0400 | |
commit | 52e991ec3c057789134fb9d973c7162b8c63ac99 (patch) | |
tree | 4c4dcb985b4528b0ee6764b552b7f8c1b0ee999b /src/devices/sound/k051649.cpp | |
parent | afce0258563d56af767f9723517bfe346eaf445c (diff) |
k051649: Simplify read/write handlers (nw)
Diffstat (limited to 'src/devices/sound/k051649.cpp')
-rw-r--r-- | src/devices/sound/k051649.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/devices/sound/k051649.cpp b/src/devices/sound/k051649.cpp index 815abb26739..a47fb93fced 100644 --- a/src/devices/sound/k051649.cpp +++ b/src/devices/sound/k051649.cpp @@ -37,7 +37,7 @@ void k051649_device::scc_map(address_map &map) map(0x80, 0x89).w(FUNC(k051649_device::k051649_frequency_w)); map(0x8a, 0x8e).w(FUNC(k051649_device::k051649_volume_w)); map(0x8f, 0x8f).w(FUNC(k051649_device::k051649_keyonoff_w)); - map(0xe0, 0xff).rw(FUNC(k051649_device::k051649_test_r), FUNC(k051649_device::k051649_test_w)); + map(0xe0, 0xe0).mirror(0x1f).rw(FUNC(k051649_device::k051649_test_r), FUNC(k051649_device::k051649_test_w)); } // device type definition @@ -177,7 +177,7 @@ void k051649_device::sound_stream_update(sound_stream &stream, stream_sample_t * /********************************************************************************/ -WRITE8_MEMBER( k051649_device::k051649_waveform_w ) +void k051649_device::k051649_waveform_w(offs_t offset, uint8_t data) { // waveram is read-only? if (m_test & 0x40 || (m_test & 0x80 && offset >= 0x60)) @@ -196,7 +196,7 @@ WRITE8_MEMBER( k051649_device::k051649_waveform_w ) } -READ8_MEMBER ( k051649_device::k051649_waveform_r ) +uint8_t k051649_device::k051649_waveform_r(offs_t offset) { // test-register bits 6/7 expose the internal counter if (m_test & 0xc0) @@ -212,7 +212,7 @@ READ8_MEMBER ( k051649_device::k051649_waveform_r ) } -WRITE8_MEMBER( k051649_device::k052539_waveform_w ) +void k051649_device::k052539_waveform_w(offs_t offset, uint8_t data) { // waveram is read-only? if (m_test & 0x40) @@ -223,7 +223,7 @@ WRITE8_MEMBER( k051649_device::k052539_waveform_w ) } -READ8_MEMBER ( k051649_device::k052539_waveform_r ) +uint8_t k051649_device::k052539_waveform_r(offs_t offset) { // test-register bit 6 exposes the internal counter if (m_test & 0x40) @@ -235,14 +235,14 @@ READ8_MEMBER ( k051649_device::k052539_waveform_r ) } -WRITE8_MEMBER( k051649_device::k051649_volume_w ) +void k051649_device::k051649_volume_w(offs_t offset, uint8_t data) { m_stream->update(); m_channel_list[offset&0x7].volume=data&0xf; } -WRITE8_MEMBER( k051649_device::k051649_frequency_w ) +void k051649_device::k051649_frequency_w(offs_t offset, uint8_t data) { int freq_hi = offset & 1; offset >>= 1; @@ -263,7 +263,7 @@ WRITE8_MEMBER( k051649_device::k051649_frequency_w ) } -WRITE8_MEMBER( k051649_device::k051649_keyonoff_w ) +void k051649_device::k051649_keyonoff_w(uint8_t data) { int i; m_stream->update(); @@ -276,16 +276,17 @@ WRITE8_MEMBER( k051649_device::k051649_keyonoff_w ) } -WRITE8_MEMBER( k051649_device::k051649_test_w ) +void k051649_device::k051649_test_w(uint8_t data) { m_test = data; } -READ8_MEMBER ( k051649_device::k051649_test_r ) +uint8_t k051649_device::k051649_test_r() { // reading the test register sets it to $ff! - k051649_test_w(space, offset, 0xff); + if (machine().side_effects_disabled()) + k051649_test_w(0xff); return 0xff; } |