diff options
author | Vas Crabb <vas@vastheman.com> | 2018-06-08 01:29:39 +1000 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2018-06-08 01:29:39 +1000 |
commit | 93eaa6a4943ade6513257a740fcde97ca9468559 (patch) | |
tree | 1340f2160a7064a839b7ca649b2257489cdd3d6d /src/devices/sound | |
parent | fafafe7050e4d04230656215b840ac53aad081e7 (diff) |
as if millions of this pointers suddenly cried out in terror, and were suddenly silenced
* streamline templates in addrmap.h
* get rid of overloads on read/write member names - this will become even more important in the near future
Diffstat (limited to 'src/devices/sound')
-rw-r--r-- | src/devices/sound/ay8910.cpp | 36 | ||||
-rw-r--r-- | src/devices/sound/ay8910.h | 17 | ||||
-rw-r--r-- | src/devices/sound/bsmt2000.cpp | 10 | ||||
-rw-r--r-- | src/devices/sound/cdp1863.cpp | 20 | ||||
-rw-r--r-- | src/devices/sound/cdp1863.h | 4 | ||||
-rw-r--r-- | src/devices/sound/cdp1869.cpp | 14 | ||||
-rw-r--r-- | src/devices/sound/dac.h | 12 | ||||
-rw-r--r-- | src/devices/sound/dave.cpp | 4 | ||||
-rw-r--r-- | src/devices/sound/es1373.cpp | 2 | ||||
-rw-r--r-- | src/devices/sound/es8712.cpp | 2 | ||||
-rw-r--r-- | src/devices/sound/k051649.cpp | 10 | ||||
-rw-r--r-- | src/devices/sound/okim9810.cpp | 2 | ||||
-rw-r--r-- | src/devices/sound/okim9810.h | 2 | ||||
-rw-r--r-- | src/devices/sound/pokey.cpp | 13 | ||||
-rw-r--r-- | src/devices/sound/pokey.h | 3 | ||||
-rw-r--r-- | src/devices/sound/qs1000.cpp | 2 | ||||
-rw-r--r-- | src/devices/sound/qsound.cpp | 2 | ||||
-rw-r--r-- | src/devices/sound/sn76496.cpp | 5 | ||||
-rw-r--r-- | src/devices/sound/sn76496.h | 2 | ||||
-rw-r--r-- | src/devices/sound/tms5220.cpp | 14 | ||||
-rw-r--r-- | src/devices/sound/tms5220.h | 8 |
21 files changed, 49 insertions, 135 deletions
diff --git a/src/devices/sound/ay8910.cpp b/src/devices/sound/ay8910.cpp index 4c84f8ad574..71dd5854725 100644 --- a/src/devices/sound/ay8910.cpp +++ b/src/devices/sound/ay8910.cpp @@ -1394,37 +1394,11 @@ void ay8910_device::device_reset() * *************************************/ -u8 ay8910_device::data_r() -{ - return ay8910_read_ym(); -} - -void ay8910_device::address_w(u8 data) -{ - ay8910_write_ym(0, data); -} - -void ay8910_device::data_w(u8 data) -{ - ay8910_write_ym(1, data); -} - READ8_MEMBER( ay8910_device::data_r ) { return ay8910_read_ym(); } -WRITE8_MEMBER( ay8910_device::data_address_w ) -{ - /* note that directly connecting BC1 to A0 puts data on 0 and address on 1 */ - ay8910_write_ym(~offset & 1, data); -} - -WRITE8_MEMBER( ay8910_device::address_data_w ) -{ - ay8910_write_ym(offset & 1, data); -} - WRITE8_MEMBER( ay8910_device::address_w ) { #if ENABLE_REGISTER_TEST @@ -1462,16 +1436,6 @@ WRITE8_MEMBER( ay8910_device::write_bc1_bc2 ) } } -WRITE8_MEMBER( ay8910_device::reset_w ) -{ - reset_w(); -} - -void ay8910_device::reset_w() -{ - ay8910_reset_ym(); -} - static const int mapping8914to8910[16] = { 0, 2, 4, 11, 1, 3, 5, 12, 7, 6, 13, 8, 9, 10, 14, 15 }; READ8_MEMBER( ay8914_device::read ) diff --git a/src/devices/sound/ay8910.h b/src/devices/sound/ay8910.h index 4961c297566..44f69041fe8 100644 --- a/src/devices/sound/ay8910.h +++ b/src/devices/sound/ay8910.h @@ -96,19 +96,18 @@ public: DECLARE_READ8_MEMBER( data_r ); DECLARE_WRITE8_MEMBER( address_w ); DECLARE_WRITE8_MEMBER( data_w ); - u8 data_r(); - void address_w(u8 data); - void data_w(u8 data); + u8 read_data() { return ay8910_read_ym(); } + void write_address(u8 data) { ay8910_write_ym(0, data); } + void write_data(u8 data) { ay8910_write_ym(1, data); } /* /RES */ - void reset_w(); - DECLARE_WRITE8_MEMBER( reset_w ); + DECLARE_WRITE8_MEMBER( reset_w ) { ay8910_reset_ym(); } - /* use this when BC1 == A0; here, BC1=0 selects 'data' and BC1=1 selects 'latch address' */ - DECLARE_WRITE8_MEMBER( data_address_w ); + // use this when BC1 == A0; here, BC1=0 selects 'data' and BC1=1 selects 'latch address' + DECLARE_WRITE8_MEMBER( data_address_w ) { ay8910_write_ym(~offset & 1, data); } // note that directly connecting BC1 to A0 puts data on 0 and address on 1 - /* use this when BC1 == !A0; here, BC1=0 selects 'latch address' and BC1=1 selects 'data' */ - DECLARE_WRITE8_MEMBER( address_data_w ); + // use this when BC1 == !A0; here, BC1=0 selects 'latch address' and BC1=1 selects 'data' + DECLARE_WRITE8_MEMBER( address_data_w ) { ay8910_write_ym(offset & 1, data); } // bc1=a0, bc2=a1 DECLARE_WRITE8_MEMBER(write_bc1_bc2); diff --git a/src/devices/sound/bsmt2000.cpp b/src/devices/sound/bsmt2000.cpp index d90a583259d..722b8ecd6a1 100644 --- a/src/devices/sound/bsmt2000.cpp +++ b/src/devices/sound/bsmt2000.cpp @@ -36,11 +36,11 @@ void bsmt2000_device::tms_program_map(address_map &map) // I/O map for the DSP void bsmt2000_device::tms_io_map(address_map &map) { - map(0, 0).rw(this, FUNC(bsmt2000_device::tms_register_r), FUNC(bsmt2000_device::tms_rom_addr_w)); - map(1, 1).rw(this, FUNC(bsmt2000_device::tms_data_r), FUNC(bsmt2000_device::tms_rom_bank_w)); - map(2, 2).r(this, FUNC(bsmt2000_device::tms_rom_r)); - map(3, 3).w(this, FUNC(bsmt2000_device::tms_left_w)); - map(7, 7).w(this, FUNC(bsmt2000_device::tms_right_w)); + map(0, 0).rw(FUNC(bsmt2000_device::tms_register_r), FUNC(bsmt2000_device::tms_rom_addr_w)); + map(1, 1).rw(FUNC(bsmt2000_device::tms_data_r), FUNC(bsmt2000_device::tms_rom_bank_w)); + map(2, 2).r(FUNC(bsmt2000_device::tms_rom_r)); + map(3, 3).w(FUNC(bsmt2000_device::tms_left_w)); + map(7, 7).w(FUNC(bsmt2000_device::tms_right_w)); } diff --git a/src/devices/sound/cdp1863.cpp b/src/devices/sound/cdp1863.cpp index d2ea2e83c09..6551e8bd983 100644 --- a/src/devices/sound/cdp1863.cpp +++ b/src/devices/sound/cdp1863.cpp @@ -138,26 +138,6 @@ void cdp1863_device::sound_stream_update(sound_stream &stream, stream_sample_t * //------------------------------------------------- -// str_w - latch write -//------------------------------------------------- - -WRITE8_MEMBER( cdp1863_device::str_w ) -{ - m_latch = data; -} - - -//------------------------------------------------- -// str_w - latch write -//------------------------------------------------- - -void cdp1863_device::str_w(uint8_t data) -{ - m_latch = data; -} - - -//------------------------------------------------- // oe_w - output enable write //------------------------------------------------- diff --git a/src/devices/sound/cdp1863.h b/src/devices/sound/cdp1863.h index 8234f43f142..93366575e8a 100644 --- a/src/devices/sound/cdp1863.h +++ b/src/devices/sound/cdp1863.h @@ -52,8 +52,8 @@ public: void set_clock2(int clock2) { m_clock2 = clock2; } void set_clock2(const XTAL &xtal) { xtal.validate("selecting cdp1863 clock"); set_clock2(xtal.value()); } - DECLARE_WRITE8_MEMBER( str_w ); - void str_w(uint8_t data); + DECLARE_WRITE8_MEMBER( str_w ) { write_str(data); } + void write_str(uint8_t data) { m_latch = data; } DECLARE_WRITE_LINE_MEMBER( oe_w ); diff --git a/src/devices/sound/cdp1869.cpp b/src/devices/sound/cdp1869.cpp index a6603ebb988..eb3c3b2adb8 100644 --- a/src/devices/sound/cdp1869.cpp +++ b/src/devices/sound/cdp1869.cpp @@ -66,23 +66,23 @@ DEFINE_DEVICE_TYPE(CDP1869, cdp1869_device, "cdp1869", "RCA CDP1869 VIS") // I/O map void cdp1869_device::io_map(address_map &map) { - map(0x03, 0x03).w(this, FUNC(cdp1869_device::out3_w)); - map(0x04, 0x04).w(this, FUNC(cdp1869_device::out4_w)); - map(0x05, 0x05).w(this, FUNC(cdp1869_device::out5_w)); - map(0x06, 0x06).w(this, FUNC(cdp1869_device::out6_w)); - map(0x07, 0x07).w(this, FUNC(cdp1869_device::out7_w)); + map(0x03, 0x03).w(FUNC(cdp1869_device::out3_w)); + map(0x04, 0x04).w(FUNC(cdp1869_device::out4_w)); + map(0x05, 0x05).w(FUNC(cdp1869_device::out5_w)); + map(0x06, 0x06).w(FUNC(cdp1869_device::out6_w)); + map(0x07, 0x07).w(FUNC(cdp1869_device::out7_w)); } // character RAM map void cdp1869_device::char_map(address_map &map) { - map(0x000, 0x3ff).rw(this, FUNC(cdp1869_device::char_ram_r), FUNC(cdp1869_device::char_ram_w)); + map(0x000, 0x3ff).rw(FUNC(cdp1869_device::char_ram_r), FUNC(cdp1869_device::char_ram_w)); } // page RAM map void cdp1869_device::page_map(address_map &map) { - map(0x000, 0x7ff).rw(this, FUNC(cdp1869_device::page_ram_r), FUNC(cdp1869_device::page_ram_w)); + map(0x000, 0x7ff).rw(FUNC(cdp1869_device::page_ram_r), FUNC(cdp1869_device::page_ram_w)); } // default address map diff --git a/src/devices/sound/dac.h b/src/devices/sound/dac.h index c29fb45eb6f..ef3393d3cea 100644 --- a/src/devices/sound/dac.h +++ b/src/devices/sound/dac.h @@ -27,21 +27,21 @@ class dac_bit_interface { public: virtual DECLARE_WRITE_LINE_MEMBER(write) = 0; - virtual DECLARE_WRITE8_MEMBER(write) = 0; + virtual DECLARE_WRITE8_MEMBER(data_w) = 0; }; class dac_byte_interface { public: virtual void write(unsigned char data) = 0; - virtual DECLARE_WRITE8_MEMBER(write) = 0; + virtual DECLARE_WRITE8_MEMBER(data_w) = 0; }; class dac_word_interface { public: virtual void write(unsigned short data) = 0; - virtual DECLARE_WRITE16_MEMBER(write) = 0; + virtual DECLARE_WRITE16_MEMBER(data_w) = 0; }; template <unsigned bits> @@ -213,7 +213,7 @@ public: } virtual WRITE_LINE_MEMBER(write) override { this->setCode(state); } - virtual WRITE8_MEMBER(write) override { this->setCode(data); } + virtual WRITE8_MEMBER(data_w) override { this->setCode(data); } }; template <typename _dac_code> @@ -228,7 +228,7 @@ public: } virtual void write(unsigned char data) override { this->setCode(data); } - virtual DECLARE_WRITE8_MEMBER(write) override { this->setCode(data); } + virtual DECLARE_WRITE8_MEMBER(data_w) override { this->setCode(data); } }; template <typename _dac_code> @@ -243,7 +243,7 @@ public: } virtual void write(unsigned short data) override { this->setCode(data); } - virtual DECLARE_WRITE16_MEMBER(write) override { this->setCode(data); } + virtual DECLARE_WRITE16_MEMBER(data_w) override { this->setCode(data); } }; constexpr double dac_gain_r2r = 1.0; diff --git a/src/devices/sound/dave.cpp b/src/devices/sound/dave.cpp index 4922417ead2..4ca7248a520 100644 --- a/src/devices/sound/dave.cpp +++ b/src/devices/sound/dave.cpp @@ -30,12 +30,12 @@ DEFINE_DEVICE_TYPE(DAVE, dave_device, "dave", "Inteligent Designs DAVE") void dave_device::z80_program_map(address_map &map) { - map(0x0000, 0xffff).rw(this, FUNC(dave_device::program_r), FUNC(dave_device::program_w)); + map(0x0000, 0xffff).rw(FUNC(dave_device::program_r), FUNC(dave_device::program_w)); } void dave_device::z80_io_map(address_map &map) { - map(0x0000, 0xffff).rw(this, FUNC(dave_device::io_r), FUNC(dave_device::io_w)); + map(0x0000, 0xffff).rw(FUNC(dave_device::io_r), FUNC(dave_device::io_w)); } diff --git a/src/devices/sound/es1373.cpp b/src/devices/sound/es1373.cpp index 6d5ccbaf027..9279e3558cd 100644 --- a/src/devices/sound/es1373.cpp +++ b/src/devices/sound/es1373.cpp @@ -80,7 +80,7 @@ DEFINE_DEVICE_TYPE(ES1373, es1373_device, "es1373", "Creative Labs Ensoniq Audio void es1373_device::map(address_map &map) { - map(0x00, 0x3f).rw(this, FUNC(es1373_device::reg_r), FUNC(es1373_device::reg_w)); + map(0x00, 0x3f).rw(FUNC(es1373_device::reg_r), FUNC(es1373_device::reg_w)); } es1373_device::es1373_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) diff --git a/src/devices/sound/es8712.cpp b/src/devices/sound/es8712.cpp index 6314d26f4a8..9440bd7ce60 100644 --- a/src/devices/sound/es8712.cpp +++ b/src/devices/sound/es8712.cpp @@ -227,7 +227,7 @@ WRITE_LINE_MEMBER(es8712_device::msm_int) } else { - m_adpcm_select->ab_w(read_byte(m_base_offset)); + m_adpcm_select->write_ab(read_byte(m_base_offset)); m_adpcm_select->select_w(m_adpcm_trigger); m_adpcm_trigger ^= 1; if (m_adpcm_trigger == 0) diff --git a/src/devices/sound/k051649.cpp b/src/devices/sound/k051649.cpp index b961ae7067f..815abb26739 100644 --- a/src/devices/sound/k051649.cpp +++ b/src/devices/sound/k051649.cpp @@ -33,11 +33,11 @@ void k051649_device::scc_map(address_map &map) { - map(0x00, 0x7f).rw(this, FUNC(k051649_device::k051649_waveform_r), FUNC(k051649_device::k051649_waveform_w)); - map(0x80, 0x89).w(this, FUNC(k051649_device::k051649_frequency_w)); - map(0x8a, 0x8e).w(this, FUNC(k051649_device::k051649_volume_w)); - map(0x8f, 0x8f).w(this, FUNC(k051649_device::k051649_keyonoff_w)); - map(0xe0, 0xff).rw(this, FUNC(k051649_device::k051649_test_r), FUNC(k051649_device::k051649_test_w)); + map(0x00, 0x7f).rw(FUNC(k051649_device::k051649_waveform_r), FUNC(k051649_device::k051649_waveform_w)); + 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)); } // device type definition diff --git a/src/devices/sound/okim9810.cpp b/src/devices/sound/okim9810.cpp index 165fd066c60..2641e1527e2 100644 --- a/src/devices/sound/okim9810.cpp +++ b/src/devices/sound/okim9810.cpp @@ -493,7 +493,7 @@ void okim9810_device::write_tmp_register(uint8_t data) } } -WRITE8_MEMBER( okim9810_device::write_tmp_register ) +WRITE8_MEMBER( okim9810_device::tmp_register_w ) { assert(!m_serial); write_tmp_register(data); diff --git a/src/devices/sound/okim9810.h b/src/devices/sound/okim9810.h index 4475b90f29d..f790e28c924 100644 --- a/src/devices/sound/okim9810.h +++ b/src/devices/sound/okim9810.h @@ -41,7 +41,7 @@ public: DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); - DECLARE_WRITE8_MEMBER( write_tmp_register ); + DECLARE_WRITE8_MEMBER( tmp_register_w ); // serial read/write handlers DECLARE_WRITE_LINE_MEMBER( serial_w ); diff --git a/src/devices/sound/pokey.cpp b/src/devices/sound/pokey.cpp index 46e686befc7..ebeaf344660 100644 --- a/src/devices/sound/pokey.cpp +++ b/src/devices/sound/pokey.cpp @@ -780,11 +780,6 @@ void pokey_device::sound_stream_update(sound_stream &stream, stream_sample_t **i READ8_MEMBER( pokey_device::read ) { - return read(offset); -} - -uint8_t pokey_device::read(offs_t offset) -{ int data, pot; synchronize(SYNC_NOOP); /* force resync */ @@ -872,7 +867,6 @@ uint8_t pokey_device::read(offs_t offset) break; } return data; - } @@ -880,14 +874,9 @@ uint8_t pokey_device::read(offs_t offset) // write - memory interface for write //------------------------------------------------- -void pokey_device::write(offs_t offset, uint8_t data) -{ - synchronize(SYNC_WRITE, (offset<<8) | data); -} - WRITE8_MEMBER( pokey_device::write ) { - write(offset, data); + synchronize(SYNC_WRITE, (offset<<8) | data); } void pokey_device::write_internal(offs_t offset, uint8_t data) diff --git a/src/devices/sound/pokey.h b/src/devices/sound/pokey.h index ff69c3da035..1dafefeb184 100644 --- a/src/devices/sound/pokey.h +++ b/src/devices/sound/pokey.h @@ -221,9 +221,6 @@ public: DECLARE_READ8_MEMBER( read ); DECLARE_WRITE8_MEMBER( write ); - uint8_t read(offs_t offset); - void write(offs_t offset, uint8_t data); - DECLARE_WRITE_LINE_MEMBER( sid_w ); // pin 24 void serin_ready(int after); diff --git a/src/devices/sound/qs1000.cpp b/src/devices/sound/qs1000.cpp index 0f980e54ce8..e79359d250f 100644 --- a/src/devices/sound/qs1000.cpp +++ b/src/devices/sound/qs1000.cpp @@ -146,7 +146,7 @@ void qs1000_device::qs1000_prg_map(address_map &map) void qs1000_device::qs1000_io_map(address_map &map) { map(0x0000, 0x00ff).ram(); - map(0x0200, 0x0211).w(this, FUNC(qs1000_device::wave_w)); + map(0x0200, 0x0211).w(FUNC(qs1000_device::wave_w)); } diff --git a/src/devices/sound/qsound.cpp b/src/devices/sound/qsound.cpp index a7bc8cdc72e..7d1ac1c7b9b 100644 --- a/src/devices/sound/qsound.cpp +++ b/src/devices/sound/qsound.cpp @@ -266,7 +266,7 @@ void qsound_device::rom_bank_updated() void qsound_device::dsp_io_map(address_map &map) { map.unmap_value_high(); - map(0x0000, 0x7fff).mirror(0x8000).r(this, FUNC(qsound_device::dsp_sample_r)); + map(0x0000, 0x7fff).mirror(0x8000).r(FUNC(qsound_device::dsp_sample_r)); } diff --git a/src/devices/sound/sn76496.cpp b/src/devices/sound/sn76496.cpp index bccb53c27bb..0c08ca0cb2e 100644 --- a/src/devices/sound/sn76496.cpp +++ b/src/devices/sound/sn76496.cpp @@ -332,11 +332,6 @@ void sn76496_base_device::write(uint8_t data) } } -WRITE8_MEMBER( sn76496_base_device::write ) -{ - write(data); -} - inline bool sn76496_base_device::in_noise_mode() { return ((m_register[6] & 4)!=0); diff --git a/src/devices/sound/sn76496.h b/src/devices/sound/sn76496.h index 65e346ef047..b173c059de8 100644 --- a/src/devices/sound/sn76496.h +++ b/src/devices/sound/sn76496.h @@ -29,7 +29,7 @@ public: DECLARE_WRITE8_MEMBER( stereo_w ); void write(uint8_t data); - DECLARE_WRITE8_MEMBER( write ); + DECLARE_WRITE8_MEMBER( command_w ) { write(data); } DECLARE_READ_LINE_MEMBER( ready_r ) { return m_ready_state ? 1 : 0; } protected: diff --git a/src/devices/sound/tms5220.cpp b/src/devices/sound/tms5220.cpp index b9a45cabaa4..b0cf48a271a 100644 --- a/src/devices/sound/tms5220.cpp +++ b/src/devices/sound/tms5220.cpp @@ -2004,12 +2004,7 @@ WRITE8_MEMBER( tms5220_device::combined_rsq_wsq_w ) ***********************************************************************************************/ -WRITE8_MEMBER( tms5220_device::data_w ) -{ - data_w(data); -} - -void tms5220_device::data_w(uint8_t data) +void tms5220_device::write_data(uint8_t data) { // prevent debugger from changing the internal state if (machine().side_effects_disabled()) return; @@ -2042,12 +2037,7 @@ void tms5220_device::data_w(uint8_t data) ***********************************************************************************************/ -READ8_MEMBER( tms5220_device::status_r ) -{ - return status_r(); -} - -uint8_t tms5220_device::status_r() +uint8_t tms5220_device::read_status() { // prevent debugger from changing the internal state if (machine().side_effects_disabled()) return 0; diff --git a/src/devices/sound/tms5220.h b/src/devices/sound/tms5220.h index 4995f7fae3b..4cfab5491ef 100644 --- a/src/devices/sound/tms5220.h +++ b/src/devices/sound/tms5220.h @@ -81,11 +81,11 @@ public: /RS is bit 1, /WS is bit 0 Note this is a hack and probably can be removed later, once the 'real' line handlers above defer by at least 4 clock cycles before taking effect */ - DECLARE_WRITE8_MEMBER( data_w ); - DECLARE_READ8_MEMBER( status_r ); + DECLARE_WRITE8_MEMBER( data_w ) { write_data(data); } + DECLARE_READ8_MEMBER( status_r ) { return read_status(); } - void data_w(uint8_t data); - uint8_t status_r(); + void write_data(uint8_t data); + uint8_t read_status(); READ_LINE_MEMBER( readyq_r ); READ_LINE_MEMBER( intq_r ); |