From d356ad91d4e88ad81bf12f027f4b95b6fa02fd34 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 4 Oct 2022 21:56:24 +0200 Subject: dirom: added pre and post rom bank change callbacks and changed almost all users to 'pre' --- src/devices/machine/gt913_snd.cpp | 2 +- src/devices/machine/gt913_snd.h | 2 +- src/devices/machine/ripple_counter.cpp | 6 +++--- src/devices/machine/ripple_counter.h | 2 +- src/devices/sound/bsmt2000.cpp | 5 +++-- src/devices/sound/bsmt2000.h | 2 +- src/devices/sound/c140.cpp | 2 +- src/devices/sound/c140.h | 2 +- src/devices/sound/c352.cpp | 5 +++-- src/devices/sound/c352.h | 2 +- src/devices/sound/es5503.cpp | 5 +++-- src/devices/sound/es5503.h | 2 +- src/devices/sound/es8712.cpp | 11 +---------- src/devices/sound/es8712.h | 2 -- src/devices/sound/gaelco.cpp | 2 +- src/devices/sound/gaelco.h | 2 +- src/devices/sound/iremga20.cpp | 5 +++-- src/devices/sound/iremga20.h | 2 +- src/devices/sound/k053260.cpp | 5 +++-- src/devices/sound/k053260.h | 2 +- src/devices/sound/k054539.cpp | 5 +++-- src/devices/sound/k054539.h | 2 +- src/devices/sound/multipcm.cpp | 5 +++-- src/devices/sound/multipcm.h | 2 +- src/devices/sound/okim6295.cpp | 5 +++-- src/devices/sound/okim6295.h | 2 +- src/devices/sound/okim6376.cpp | 3 ++- src/devices/sound/okim6376.h | 2 +- src/devices/sound/okim9810.cpp | 5 +++-- src/devices/sound/okim9810.h | 2 +- src/devices/sound/qs1000.cpp | 5 +++-- src/devices/sound/qs1000.h | 2 +- src/devices/sound/qsound.cpp | 5 +++-- src/devices/sound/qsound.h | 2 +- src/devices/sound/qsoundhle.cpp | 5 +++-- src/devices/sound/qsoundhle.h | 2 +- src/devices/sound/rf5c400.cpp | 2 +- src/devices/sound/rf5c400.h | 2 +- src/devices/sound/rolandpcm.cpp | 5 +++-- src/devices/sound/rolandpcm.h | 2 +- src/devices/sound/scsp.cpp | 2 +- src/devices/sound/scsp.h | 2 +- src/devices/sound/segapcm.cpp | 5 +++-- src/devices/sound/segapcm.h | 2 +- src/devices/sound/setapcm.cpp | 5 +++-- src/devices/sound/setapcm.h | 2 +- src/devices/sound/swp00.cpp | 2 +- src/devices/sound/swp00.h | 2 +- src/devices/sound/swp20.cpp | 4 ---- src/devices/sound/swp20.h | 1 - src/devices/sound/swp30.cpp | 5 ----- src/devices/sound/swp30.h | 1 - src/devices/sound/tt5665.cpp | 5 +++-- src/devices/sound/tt5665.h | 2 +- src/devices/sound/upd7759.cpp | 2 +- src/devices/sound/upd7759.h | 2 +- src/devices/sound/vlm5030.cpp | 2 +- src/devices/sound/vlm5030.h | 2 +- src/devices/sound/x1_010.cpp | 5 +++-- src/devices/sound/x1_010.h | 2 +- src/devices/sound/ymf271.cpp | 2 +- src/devices/sound/ymf271.h | 2 +- src/devices/sound/ymopl.cpp | 8 ++++---- src/devices/sound/ymopl.h | 4 ++-- src/devices/sound/ymopn.cpp | 4 ++-- src/devices/sound/ymopn.h | 2 +- src/devices/sound/ymz280b.cpp | 2 +- src/devices/sound/ymz280b.h | 2 +- src/emu/dirom.h | 3 ++- src/emu/dirom.ipp | 3 ++- src/mame/ces/galgames.cpp | 1 - src/mame/dynax/dynax_blitter_rev2.h | 3 --- src/mame/irem/m72_a.cpp | 8 -------- src/mame/irem/m72_a.h | 3 --- src/mame/kaneko/kaneko_grap2.cpp | 4 ---- src/mame/kaneko/kaneko_grap2.h | 2 -- src/mame/kaneko/sknsspr.cpp | 5 ----- src/mame/kaneko/sknsspr.h | 1 - src/mame/sega/315-5838_317-0229_comp.cpp | 4 ---- src/mame/sega/315-5838_317-0229_comp.h | 2 -- src/mame/shared/seibusound.h | 1 - src/mame/shared/wswansound.cpp | 2 +- src/mame/shared/wswansound.h | 2 +- 83 files changed, 111 insertions(+), 147 deletions(-) diff --git a/src/devices/machine/gt913_snd.cpp b/src/devices/machine/gt913_snd.cpp index 66768ae95a3..803e6443278 100644 --- a/src/devices/machine/gt913_snd.cpp +++ b/src/devices/machine/gt913_snd.cpp @@ -120,7 +120,7 @@ void gt913_sound_device::sound_stream_update(sound_stream& stream, std::vectorupdate(); } diff --git a/src/devices/machine/gt913_snd.h b/src/devices/machine/gt913_snd.h index 54eecfa72d0..4c5bfd4a153 100644 --- a/src/devices/machine/gt913_snd.h +++ b/src/devices/machine/gt913_snd.h @@ -41,7 +41,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; private: sound_stream *m_stream; diff --git a/src/devices/machine/ripple_counter.cpp b/src/devices/machine/ripple_counter.cpp index e8fc5ad544f..25639eb6bb3 100644 --- a/src/devices/machine/ripple_counter.cpp +++ b/src/devices/machine/ripple_counter.cpp @@ -116,11 +116,11 @@ void ripple_counter_device::device_clock_changed() //------------------------------------------------- -// rom_bank_updated - called when the ROM bank -// is changed +// rom_bank_post_change - called after the ROM +// bank is changed //------------------------------------------------- -void ripple_counter_device::rom_bank_updated() +void ripple_counter_device::rom_bank_post_change() { m_rom_out_cb(read_byte(m_count)); } diff --git a/src/devices/machine/ripple_counter.h b/src/devices/machine/ripple_counter.h index dd0ee3adced..fb7648334e3 100644 --- a/src/devices/machine/ripple_counter.h +++ b/src/devices/machine/ripple_counter.h @@ -46,7 +46,7 @@ protected: // device_rom_interface overrides virtual space_config_vector memory_space_config() const override; - virtual void rom_bank_updated() override; + virtual void rom_bank_post_change() override; TIMER_CALLBACK_MEMBER(advance_counter); diff --git a/src/devices/sound/bsmt2000.cpp b/src/devices/sound/bsmt2000.cpp index 54fe92588d5..30b078b6da6 100644 --- a/src/devices/sound/bsmt2000.cpp +++ b/src/devices/sound/bsmt2000.cpp @@ -196,10 +196,11 @@ void bsmt2000_device::sound_stream_update(sound_stream &stream, std::vectorupdate(); } diff --git a/src/devices/sound/bsmt2000.h b/src/devices/sound/bsmt2000.h index 459a83bb86c..771ad8f3c64 100644 --- a/src/devices/sound/bsmt2000.h +++ b/src/devices/sound/bsmt2000.h @@ -55,7 +55,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; TIMER_CALLBACK_MEMBER(deferred_reset); TIMER_CALLBACK_MEMBER(deferred_reg_write); diff --git a/src/devices/sound/c140.cpp b/src/devices/sound/c140.cpp index 28eea0d508b..1010e36aa8b 100644 --- a/src/devices/sound/c140.cpp +++ b/src/devices/sound/c140.cpp @@ -204,7 +204,7 @@ void c140_device::device_clock_changed() } -void c140_device::rom_bank_updated() +void c140_device::rom_bank_pre_change() { m_stream->update(); } diff --git a/src/devices/sound/c140.h b/src/devices/sound/c140.h index abbe72b1053..918f5dae31a 100644 --- a/src/devices/sound/c140.h +++ b/src/devices/sound/c140.h @@ -41,7 +41,7 @@ protected: virtual void device_start() override; virtual void device_clock_changed() override; - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; diff --git a/src/devices/sound/c352.cpp b/src/devices/sound/c352.cpp index bea5a561b59..dcbd58f3eb3 100644 --- a/src/devices/sound/c352.cpp +++ b/src/devices/sound/c352.cpp @@ -50,10 +50,11 @@ c352_device::c352_device(const machine_config &mconfig, const char *tag, device_ } //------------------------------------------------- -// rom_bank_updated - the rom bank has changed +// rom_bank_pre_change - refresh the stream if the +// ROM banking changes //------------------------------------------------- -void c352_device::rom_bank_updated() +void c352_device::rom_bank_pre_change() { m_stream->update(); } diff --git a/src/devices/sound/c352.h b/src/devices/sound/c352.h index d21ac96cd86..cf333ba356e 100644 --- a/src/devices/sound/c352.h +++ b/src/devices/sound/c352.h @@ -42,7 +42,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; private: enum diff --git a/src/devices/sound/es5503.cpp b/src/devices/sound/es5503.cpp index 9e4b9a91e0b..f460050df66 100644 --- a/src/devices/sound/es5503.cpp +++ b/src/devices/sound/es5503.cpp @@ -77,10 +77,11 @@ TIMER_CALLBACK_MEMBER(es5503_device::delayed_stream_update) } //------------------------------------------------- -// rom_bank_updated - the rom bank has changed +// rom_bank_pre_change - refresh the stream if the +// ROM banking changes //------------------------------------------------- -void es5503_device::rom_bank_updated() +void es5503_device::rom_bank_pre_change() { m_stream->update(); } diff --git a/src/devices/sound/es5503.h b/src/devices/sound/es5503.h index 153e0a79fe1..4499d58d1f3 100644 --- a/src/devices/sound/es5503.h +++ b/src/devices/sound/es5503.h @@ -38,7 +38,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; TIMER_CALLBACK_MEMBER(delayed_stream_update); diff --git a/src/devices/sound/es8712.cpp b/src/devices/sound/es8712.cpp index 7efb7647be4..5cddf18cc7e 100644 --- a/src/devices/sound/es8712.cpp +++ b/src/devices/sound/es8712.cpp @@ -95,16 +95,7 @@ void es8712_device::device_reset() //------------------------------------------------- -// rom_bank_updated - nothing for now -//------------------------------------------------- - -void es8712_device::rom_bank_updated() -{ -} - - -//------------------------------------------------- -// state save support for MAME +// state save support for MAME //------------------------------------------------- void es8712_device::es8712_state_save_register() diff --git a/src/devices/sound/es8712.h b/src/devices/sound/es8712.h index 02a51a23c16..27fc5bab853 100644 --- a/src/devices/sound/es8712.h +++ b/src/devices/sound/es8712.h @@ -41,8 +41,6 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual void rom_bank_updated() override; - private: void es8712_state_save_register(); diff --git a/src/devices/sound/gaelco.cpp b/src/devices/sound/gaelco.cpp index 62553b44413..39a14d6487f 100644 --- a/src/devices/sound/gaelco.cpp +++ b/src/devices/sound/gaelco.cpp @@ -327,7 +327,7 @@ void gaelco_gae1_device::device_clock_changed() } -void gaelco_gae1_device::rom_bank_updated() +void gaelco_gae1_device::rom_bank_pre_change() { m_stream->update(); } diff --git a/src/devices/sound/gaelco.h b/src/devices/sound/gaelco.h index 349a2a1071b..3bfac39f988 100644 --- a/src/devices/sound/gaelco.h +++ b/src/devices/sound/gaelco.h @@ -46,7 +46,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; private: static constexpr int NUM_CHANNELS = 0x07; diff --git a/src/devices/sound/iremga20.cpp b/src/devices/sound/iremga20.cpp index 3ec07d3de35..b87c9f26da0 100644 --- a/src/devices/sound/iremga20.cpp +++ b/src/devices/sound/iremga20.cpp @@ -117,10 +117,11 @@ void iremga20_device::device_clock_changed() } //------------------------------------------------- -// rom_bank_updated - the rom bank has changed +// rom_bank_pre_change - refresh the stream if the +// ROM banking changes //------------------------------------------------- -void iremga20_device::rom_bank_updated() +void iremga20_device::rom_bank_pre_change() { m_stream->update(); } diff --git a/src/devices/sound/iremga20.h b/src/devices/sound/iremga20.h index ae60c563d78..99440bc5782 100644 --- a/src/devices/sound/iremga20.h +++ b/src/devices/sound/iremga20.h @@ -39,7 +39,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; private: struct channel_def diff --git a/src/devices/sound/k053260.cpp b/src/devices/sound/k053260.cpp index ccb7142d945..7cd0e6b3baa 100644 --- a/src/devices/sound/k053260.cpp +++ b/src/devices/sound/k053260.cpp @@ -158,10 +158,11 @@ void k053260_device::device_reset() //------------------------------------------------- -// rom_bank_updated - the rom bank has changed +// rom_bank_pre_change - refresh the stream if the +// ROM banking changes //------------------------------------------------- -void k053260_device::rom_bank_updated() +void k053260_device::rom_bank_pre_change() { m_stream->update(); } diff --git a/src/devices/sound/k053260.h b/src/devices/sound/k053260.h index 401d3d2e34f..9b652bba4fe 100644 --- a/src/devices/sound/k053260.h +++ b/src/devices/sound/k053260.h @@ -44,7 +44,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; TIMER_CALLBACK_MEMBER(update_state_outputs); diff --git a/src/devices/sound/k054539.cpp b/src/devices/sound/k054539.cpp index 448defed448..762bdce92c8 100644 --- a/src/devices/sound/k054539.cpp +++ b/src/devices/sound/k054539.cpp @@ -557,10 +557,11 @@ void k054539_device::device_reset() //------------------------------------------------- -// rom_bank_updated - the rom bank has changed +// rom_bank_pre_change - refresh the stream if the +// ROM banking changes //------------------------------------------------- -void k054539_device::rom_bank_updated() +void k054539_device::rom_bank_pre_change() { stream->update(); } diff --git a/src/devices/sound/k054539.h b/src/devices/sound/k054539.h index 406836af65a..15ec7ecfe16 100644 --- a/src/devices/sound/k054539.h +++ b/src/devices/sound/k054539.h @@ -69,7 +69,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; TIMER_CALLBACK_MEMBER(call_timer_handler); diff --git a/src/devices/sound/multipcm.cpp b/src/devices/sound/multipcm.cpp index b3dd084580f..ce1dafe95c3 100644 --- a/src/devices/sound/multipcm.cpp +++ b/src/devices/sound/multipcm.cpp @@ -778,10 +778,11 @@ void multipcm_device::sound_stream_update(sound_stream &stream, std::vectorupdate(); } diff --git a/src/devices/sound/multipcm.h b/src/devices/sound/multipcm.h index 27f5f6d5de0..a47c23aedc9 100644 --- a/src/devices/sound/multipcm.h +++ b/src/devices/sound/multipcm.h @@ -32,7 +32,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; private: struct sample_t diff --git a/src/devices/sound/okim6295.cpp b/src/devices/sound/okim6295.cpp index 4d304ef1721..fbded659cf1 100644 --- a/src/devices/sound/okim6295.cpp +++ b/src/devices/sound/okim6295.cpp @@ -190,10 +190,11 @@ void okim6295_device::sound_stream_update(sound_stream &stream, std::vectorupdate(); } diff --git a/src/devices/sound/okim6295.h b/src/devices/sound/okim6295.h index 29f0a17f1a1..4d372a8a47c 100644 --- a/src/devices/sound/okim6295.h +++ b/src/devices/sound/okim6295.h @@ -63,7 +63,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; // a single voice class okim_voice diff --git a/src/devices/sound/okim6376.cpp b/src/devices/sound/okim6376.cpp index 997b3e8b13f..58a52858ecf 100644 --- a/src/devices/sound/okim6376.cpp +++ b/src/devices/sound/okim6376.cpp @@ -196,8 +196,9 @@ void okim6376_device::device_reset() } -void okim6376_device::rom_bank_updated() +void okim6376_device::rom_bank_pre_change() { + m_stream->update(); } diff --git a/src/devices/sound/okim6376.h b/src/devices/sound/okim6376.h index 34a23764e3a..aca7eb4de31 100644 --- a/src/devices/sound/okim6376.h +++ b/src/devices/sound/okim6376.h @@ -35,7 +35,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; virtual offs_t get_start_position(int channel); virtual u32 get_sample_rate(); diff --git a/src/devices/sound/okim9810.cpp b/src/devices/sound/okim9810.cpp index f7a9f6d6f09..db658eacf00 100644 --- a/src/devices/sound/okim9810.cpp +++ b/src/devices/sound/okim9810.cpp @@ -200,10 +200,11 @@ void okim9810_device::device_clock_changed() //------------------------------------------------- -// rom_bank_updated - the rom bank has changed +// rom_bank_pre_change - refresh the stream if the +// ROM banking changes //------------------------------------------------- -void okim9810_device::rom_bank_updated() +void okim9810_device::rom_bank_pre_change() { m_stream->update(); } diff --git a/src/devices/sound/okim9810.h b/src/devices/sound/okim9810.h index 01977b23e2b..18db148aa40 100644 --- a/src/devices/sound/okim9810.h +++ b/src/devices/sound/okim9810.h @@ -90,7 +90,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; // a single voice class okim_voice diff --git a/src/devices/sound/qs1000.cpp b/src/devices/sound/qs1000.cpp index ff45ec51093..fb42e4936db 100644 --- a/src/devices/sound/qs1000.cpp +++ b/src/devices/sound/qs1000.cpp @@ -212,10 +212,11 @@ void qs1000_device::device_add_mconfig(machine_config &config) //------------------------------------------------- -// rom_bank_updated - the rom bank has changed +// rom_bank_pre_change - refresh the stream if the +// ROM banking changes //------------------------------------------------- -void qs1000_device::rom_bank_updated() +void qs1000_device::rom_bank_pre_change() { m_stream->update(); } diff --git a/src/devices/sound/qs1000.h b/src/devices/sound/qs1000.h index 2624d893739..22683ff7d35 100644 --- a/src/devices/sound/qs1000.h +++ b/src/devices/sound/qs1000.h @@ -75,7 +75,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; private: static constexpr unsigned QS1000_CHANNELS = 32; diff --git a/src/devices/sound/qsound.cpp b/src/devices/sound/qsound.cpp index 123b19443b4..bae635a6f7b 100644 --- a/src/devices/sound/qsound.cpp +++ b/src/devices/sound/qsound.cpp @@ -262,10 +262,11 @@ void qsound_device::sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface implementation - virtual void rom_bank_updated() override; + virtual void rom_bank_post_change() override; void dsp_io_map(address_map &map); diff --git a/src/devices/sound/qsoundhle.cpp b/src/devices/sound/qsoundhle.cpp index a9595a4b00d..ed69b569cb5 100644 --- a/src/devices/sound/qsoundhle.cpp +++ b/src/devices/sound/qsoundhle.cpp @@ -50,10 +50,11 @@ qsound_hle_device::qsound_hle_device(const machine_config &mconfig, const char * } //------------------------------------------------- -// rom_bank_updated - the rom bank has changed +// rom_bank_pre_change - refresh the stream if the +// ROM banking changes //------------------------------------------------- -void qsound_hle_device::rom_bank_updated() +void qsound_hle_device::rom_bank_pre_change() { m_stream->update(); } diff --git a/src/devices/sound/qsoundhle.h b/src/devices/sound/qsoundhle.h index 4d6f61e0c7d..d5256854842 100644 --- a/src/devices/sound/qsoundhle.h +++ b/src/devices/sound/qsoundhle.h @@ -33,7 +33,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface implementation - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; private: diff --git a/src/devices/sound/rf5c400.cpp b/src/devices/sound/rf5c400.cpp index f15b7923260..fc466fb0a0f 100644 --- a/src/devices/sound/rf5c400.cpp +++ b/src/devices/sound/rf5c400.cpp @@ -349,7 +349,7 @@ void rf5c400_device::sound_stream_update(sound_stream &stream, std::vectorupdate(); } diff --git a/src/devices/sound/rf5c400.h b/src/devices/sound/rf5c400.h index 8f54d2bc8b3..a91ba9ee097 100644 --- a/src/devices/sound/rf5c400.h +++ b/src/devices/sound/rf5c400.h @@ -37,7 +37,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; private: struct rf5c400_channel diff --git a/src/devices/sound/rolandpcm.cpp b/src/devices/sound/rolandpcm.cpp index 41f8f351e38..e31132b934e 100644 --- a/src/devices/sound/rolandpcm.cpp +++ b/src/devices/sound/rolandpcm.cpp @@ -73,10 +73,11 @@ void mb87419_mb87420_device::device_reset() } //------------------------------------------------- -// rom_bank_updated - the rom bank has changed +// rom_bank_pre_change - refresh the stream if the +// ROM banking changes //------------------------------------------------- -void mb87419_mb87420_device::rom_bank_updated() +void mb87419_mb87420_device::rom_bank_pre_change() { // unused right now m_stream->update(); diff --git a/src/devices/sound/rolandpcm.h b/src/devices/sound/rolandpcm.h index 1c77be39b98..702da28dcf1 100644 --- a/src/devices/sound/rolandpcm.h +++ b/src/devices/sound/rolandpcm.h @@ -27,7 +27,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; static int16_t decode_sample(int8_t data); static int16_t sample_interpolate(int16_t smp1, int16_t smp2, uint16_t frac); diff --git a/src/devices/sound/scsp.cpp b/src/devices/sound/scsp.cpp index f58907b8611..96436fefd90 100644 --- a/src/devices/sound/scsp.cpp +++ b/src/devices/sound/scsp.cpp @@ -303,7 +303,7 @@ void scsp_device::device_clock_changed() m_stream->set_sample_rate(clock() / 512); } -void scsp_device::rom_bank_updated() +void scsp_device::rom_bank_pre_change() { m_stream->update(); } diff --git a/src/devices/sound/scsp.h b/src/devices/sound/scsp.h index f3d08df9793..dfd62c24dd0 100644 --- a/src/devices/sound/scsp.h +++ b/src/devices/sound/scsp.h @@ -44,7 +44,7 @@ protected: virtual void device_post_load() override; virtual void device_clock_changed() override; - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; diff --git a/src/devices/sound/segapcm.cpp b/src/devices/sound/segapcm.cpp index 9b4d7a9c803..9f7a9b6fc63 100644 --- a/src/devices/sound/segapcm.cpp +++ b/src/devices/sound/segapcm.cpp @@ -58,10 +58,11 @@ void segapcm_device::device_clock_changed() //------------------------------------------------- -// rom_bank_updated - the rom bank has changed +// rom_bank_pre_change - refresh the stream if the +// ROM banking changes //------------------------------------------------- -void segapcm_device::rom_bank_updated() +void segapcm_device::rom_bank_pre_change() { m_stream->update(); } diff --git a/src/devices/sound/segapcm.h b/src/devices/sound/segapcm.h index f9869f2211f..ff098088037 100644 --- a/src/devices/sound/segapcm.h +++ b/src/devices/sound/segapcm.h @@ -44,7 +44,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; private: std::unique_ptr m_ram; diff --git a/src/devices/sound/setapcm.cpp b/src/devices/sound/setapcm.cpp index 61346643216..ab002f68f10 100644 --- a/src/devices/sound/setapcm.cpp +++ b/src/devices/sound/setapcm.cpp @@ -162,11 +162,12 @@ void setapcm_device::sound_stream_update(sound_stream &strea } //------------------------------------------------- -// rom_bank_updated - the rom bank has changed +// rom_bank_pre_change - refresh the stream if the +// ROM banking changes //------------------------------------------------- template -void setapcm_device::rom_bank_updated() +void setapcm_device::rom_bank_pre_change() { m_stream->update(); } diff --git a/src/devices/sound/setapcm.h b/src/devices/sound/setapcm.h index 8c406c7076f..2da5c147563 100644 --- a/src/devices/sound/setapcm.h +++ b/src/devices/sound/setapcm.h @@ -41,7 +41,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface implementation - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; static constexpr unsigned MAX_VOICES = MaxVoices; // max voices static constexpr unsigned CLOCK_DIVIDER = Divider; // clock divider for generate output rate diff --git a/src/devices/sound/swp00.cpp b/src/devices/sound/swp00.cpp index f94006a1868..c985da89b8c 100644 --- a/src/devices/sound/swp00.cpp +++ b/src/devices/sound/swp00.cpp @@ -28,7 +28,7 @@ void swp00_device::device_reset() { } -void swp00_device::rom_bank_updated() +void swp00_device::rom_bank_pre_change() { m_stream->update(); } diff --git a/src/devices/sound/swp00.h b/src/devices/sound/swp00.h index ae732979606..166ebe0951e 100644 --- a/src/devices/sound/swp00.h +++ b/src/devices/sound/swp00.h @@ -22,7 +22,7 @@ protected: virtual void device_start() override; virtual void device_reset() override; virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; virtual void device_add_mconfig(machine_config &config) override; private: diff --git a/src/devices/sound/swp20.cpp b/src/devices/sound/swp20.cpp index 221f5955d0b..da4ef34dc4d 100644 --- a/src/devices/sound/swp20.cpp +++ b/src/devices/sound/swp20.cpp @@ -28,10 +28,6 @@ void swp20_device::device_reset() m_keyoff = 0; } -void swp20_device::rom_bank_updated() -{ -} - void swp20_device::map(address_map &map) { map(0x00, 0x3f).rw(FUNC(swp20_device::snd_r), FUNC(swp20_device::snd_w)); diff --git a/src/devices/sound/swp20.h b/src/devices/sound/swp20.h index af6bac38bc5..83f665fdc5b 100644 --- a/src/devices/sound/swp20.h +++ b/src/devices/sound/swp20.h @@ -21,7 +21,6 @@ protected: virtual void device_start() override; virtual void device_reset() override; virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; - virtual void rom_bank_updated() override; private: u8 m_p3c_port; diff --git a/src/devices/sound/swp30.cpp b/src/devices/sound/swp30.cpp index f133f21dc5e..5dd853f8151 100644 --- a/src/devices/sound/swp30.cpp +++ b/src/devices/sound/swp30.cpp @@ -301,11 +301,6 @@ void swp30_device::device_reset() m_waverom_val = 0; } -void swp30_device::rom_bank_updated() -{ - // Nothing to do, stream is synchronous -} - void swp30_device::map(address_map &map) { map(0x0000, 0x1fff).rw(FUNC(swp30_device::snd_r), FUNC(swp30_device::snd_w)); diff --git a/src/devices/sound/swp30.h b/src/devices/sound/swp30.h index b83913b1562..0ef1223eb4f 100644 --- a/src/devices/sound/swp30.h +++ b/src/devices/sound/swp30.h @@ -22,7 +22,6 @@ protected: virtual void device_start() override; virtual void device_reset() override; virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; - virtual void rom_bank_updated() override; virtual void device_add_mconfig(machine_config &config) override; private: diff --git a/src/devices/sound/tt5665.cpp b/src/devices/sound/tt5665.cpp index 2fd7c4f0e85..363481669ff 100644 --- a/src/devices/sound/tt5665.cpp +++ b/src/devices/sound/tt5665.cpp @@ -251,10 +251,11 @@ void tt5665_device::sound_stream_update(sound_stream &stream, std::vectorupdate(); } diff --git a/src/devices/sound/tt5665.h b/src/devices/sound/tt5665.h index b0c6669009a..5d3f0a155bc 100644 --- a/src/devices/sound/tt5665.h +++ b/src/devices/sound/tt5665.h @@ -72,7 +72,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; private: // a single voice diff --git a/src/devices/sound/upd7759.cpp b/src/devices/sound/upd7759.cpp index d54957b4800..ea1790a40b5 100644 --- a/src/devices/sound/upd7759.cpp +++ b/src/devices/sound/upd7759.cpp @@ -257,7 +257,7 @@ void upd775x_device::device_clock_changed() m_channel->set_sample_rate(clock() / 4); } -void upd775x_device::rom_bank_updated() +void upd775x_device::rom_bank_pre_change() { m_channel->update(); } diff --git a/src/devices/sound/upd7759.h b/src/devices/sound/upd7759.h index 1f1d0e38dfd..f23bdb51ac3 100644 --- a/src/devices/sound/upd7759.h +++ b/src/devices/sound/upd7759.h @@ -70,7 +70,7 @@ protected: virtual void device_clock_changed() override; virtual void device_reset() override; - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; diff --git a/src/devices/sound/vlm5030.cpp b/src/devices/sound/vlm5030.cpp index 71dd026000c..15f302f307e 100644 --- a/src/devices/sound/vlm5030.cpp +++ b/src/devices/sound/vlm5030.cpp @@ -267,7 +267,7 @@ void vlm5030_device::device_post_load() restore_state(); } -void vlm5030_device::rom_bank_updated() +void vlm5030_device::rom_bank_pre_change() { m_channel->update(); } diff --git a/src/devices/sound/vlm5030.h b/src/devices/sound/vlm5030.h index 4675d99fce4..1eddcdc45bf 100644 --- a/src/devices/sound/vlm5030.h +++ b/src/devices/sound/vlm5030.h @@ -37,7 +37,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; private: // configuration state diff --git a/src/devices/sound/x1_010.cpp b/src/devices/sound/x1_010.cpp index 4ad9993c120..d18f40c5f84 100644 --- a/src/devices/sound/x1_010.cpp +++ b/src/devices/sound/x1_010.cpp @@ -147,10 +147,11 @@ void x1_010_device::device_clock_changed() } //------------------------------------------------- -// rom_bank_updated - the rom bank has changed +// rom_bank_pre_change - refresh the stream if the +// ROM banking changes //------------------------------------------------- -void x1_010_device::rom_bank_updated() +void x1_010_device::rom_bank_pre_change() { m_stream->update(); } diff --git a/src/devices/sound/x1_010.h b/src/devices/sound/x1_010.h index b6b266b0ba0..a107534d4ae 100644 --- a/src/devices/sound/x1_010.h +++ b/src/devices/sound/x1_010.h @@ -29,7 +29,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; private: static constexpr unsigned NUM_CHANNELS = 16; diff --git a/src/devices/sound/ymf271.cpp b/src/devices/sound/ymf271.cpp index b8240df9c72..886d6d516d5 100644 --- a/src/devices/sound/ymf271.cpp +++ b/src/devices/sound/ymf271.cpp @@ -1781,7 +1781,7 @@ void ymf271_device::device_clock_changed() calculate_clock_correction(); } -void ymf271_device::rom_bank_updated() +void ymf271_device::rom_bank_pre_change() { m_stream->update(); } diff --git a/src/devices/sound/ymf271.h b/src/devices/sound/ymf271.h index 5c6e432649b..04d49c57f09 100644 --- a/src/devices/sound/ymf271.h +++ b/src/devices/sound/ymf271.h @@ -30,7 +30,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; TIMER_CALLBACK_MEMBER(timer_a_expired); TIMER_CALLBACK_MEMBER(timer_b_expired); diff --git a/src/devices/sound/ymopl.cpp b/src/devices/sound/ymopl.cpp index 352906f40b8..92e9eb99928 100644 --- a/src/devices/sound/ymopl.cpp +++ b/src/devices/sound/ymopl.cpp @@ -40,11 +40,11 @@ y8950_device::y8950_device(const machine_config &mconfig, const char *tag, devic //------------------------------------------------- -// rom_bank_updated - refresh the stream if the +// rom_bank_pre_change - refresh the stream if the // ROM banking changes //------------------------------------------------- -void y8950_device::rom_bank_updated() +void y8950_device::rom_bank_pre_change() { m_stream->update(); } @@ -131,11 +131,11 @@ ymf278b_device::ymf278b_device(const machine_config &mconfig, const char *tag, d //------------------------------------------------- -// rom_bank_updated - refresh the stream if the +// rom_bank_pre_change - refresh the stream if the // ROM banking changes //------------------------------------------------- -void ymf278b_device::rom_bank_updated() +void ymf278b_device::rom_bank_pre_change() { m_stream->update(); } diff --git a/src/devices/sound/ymopl.h b/src/devices/sound/ymopl.h index 07ae7ead5cb..6d5f279be03 100644 --- a/src/devices/sound/ymopl.h +++ b/src/devices/sound/ymopl.h @@ -46,7 +46,7 @@ public: protected: // ROM device overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; private: // ADPCM read/write callbacks @@ -106,7 +106,7 @@ public: protected: // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; // sound overrides virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; diff --git a/src/devices/sound/ymopn.cpp b/src/devices/sound/ymopn.cpp index 4f71646ad1d..de18330fa89 100644 --- a/src/devices/sound/ymopn.cpp +++ b/src/devices/sound/ymopn.cpp @@ -98,11 +98,11 @@ const tiny_rom_entry *ym2608_device::device_rom_region() const //------------------------------------------------- -// rom_bank_updated - refresh the stream if the +// rom_bank_pre_change - refresh the stream if the // ROM banking changes //------------------------------------------------- -void ym2608_device::rom_bank_updated() +void ym2608_device::rom_bank_pre_change() { m_stream->update(); } diff --git a/src/devices/sound/ymopn.h b/src/devices/sound/ymopn.h index c65738dee07..93b0999be8c 100644 --- a/src/devices/sound/ymopn.h +++ b/src/devices/sound/ymopn.h @@ -71,7 +71,7 @@ protected: virtual const tiny_rom_entry *device_rom_region() const override; // ROM device overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; private: // ADPCM read/write callbacks diff --git a/src/devices/sound/ymz280b.cpp b/src/devices/sound/ymz280b.cpp index 319b03a381b..ef4e9bf1190 100644 --- a/src/devices/sound/ymz280b.cpp +++ b/src/devices/sound/ymz280b.cpp @@ -646,7 +646,7 @@ void ymz280b_device::device_clock_changed() } -void ymz280b_device::rom_bank_updated() +void ymz280b_device::rom_bank_pre_change() { m_stream->update(); } diff --git a/src/devices/sound/ymz280b.h b/src/devices/sound/ymz280b.h index 04b229de4d3..319f85b83f4 100644 --- a/src/devices/sound/ymz280b.h +++ b/src/devices/sound/ymz280b.h @@ -38,7 +38,7 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; // device_rom_interface overrides - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; private: /* struct describing a single playing ADPCM voice */ diff --git a/src/emu/dirom.h b/src/emu/dirom.h index 8243400c547..1173a1b5d35 100644 --- a/src/emu/dirom.h +++ b/src/emu/dirom.h @@ -32,7 +32,8 @@ public: void set_rom_bank(int bank); protected: - virtual void rom_bank_updated() = 0; + virtual void rom_bank_pre_change() { } + virtual void rom_bank_post_change() { } virtual space_config_vector memory_space_config() const override; void override_address_width(u8 width); diff --git a/src/emu/dirom.ipp b/src/emu/dirom.ipp index 24697a0fbba..28951ae50aa 100644 --- a/src/emu/dirom.ipp +++ b/src/emu/dirom.ipp @@ -45,9 +45,10 @@ void device_rom_interface::set_rom_bank } if (m_cur_bank != bank) { + rom_bank_pre_change(); m_cur_bank = bank; m_bank->set_entry(bank); - rom_bank_updated(); + rom_bank_post_change(); } } diff --git a/src/mame/ces/galgames.cpp b/src/mame/ces/galgames.cpp index da88c089123..7c4087a3b0d 100644 --- a/src/mame/ces/galgames.cpp +++ b/src/mame/ces/galgames.cpp @@ -115,7 +115,6 @@ protected: // device-level overrides virtual void device_start() override; virtual void device_reset() override; - virtual void rom_bank_updated() override { } bool is_selected(); diff --git a/src/mame/dynax/dynax_blitter_rev2.h b/src/mame/dynax/dynax_blitter_rev2.h index 2c3f78206a3..2e26a5f0faa 100644 --- a/src/mame/dynax/dynax_blitter_rev2.h +++ b/src/mame/dynax/dynax_blitter_rev2.h @@ -45,9 +45,6 @@ protected: virtual void device_resolve_objects() override; virtual void device_start() override; - // device_rom_interface overrides - virtual void rom_bank_updated() override { } - // internal helpers void plot_pixel(int x, int y, int pen); u32 blitter_draw(u32 src, int pen, int x, int y); diff --git a/src/mame/irem/m72_a.cpp b/src/mame/irem/m72_a.cpp index e2ad871fb21..da8f3bea1df 100644 --- a/src/mame/irem/m72_a.cpp +++ b/src/mame/irem/m72_a.cpp @@ -66,14 +66,6 @@ void m72_audio_device::device_start() save_item(NAME(m_sample_addr)); } -//------------------------------------------------- -// rom_bank_updated - the rom bank has changed -//------------------------------------------------- - -void m72_audio_device::rom_bank_updated() -{ -} - void m72_audio_device::set_sample_start(int start) { m_sample_addr = start; diff --git a/src/mame/irem/m72_a.h b/src/mame/irem/m72_a.h index bf6995c10a6..688b8a40285 100644 --- a/src/mame/irem/m72_a.h +++ b/src/mame/irem/m72_a.h @@ -36,9 +36,6 @@ protected: // device-level overrides virtual void device_start() override; - // device_rom_interface overrides - virtual void rom_bank_updated() override; - private: // internal state uint32_t m_sample_addr; diff --git a/src/mame/kaneko/kaneko_grap2.cpp b/src/mame/kaneko/kaneko_grap2.cpp index 8769e454b18..67e219c8fb8 100644 --- a/src/mame/kaneko/kaneko_grap2.cpp +++ b/src/mame/kaneko/kaneko_grap2.cpp @@ -74,10 +74,6 @@ void kaneko_grap2_device::device_reset() m_framebuffer_bright2 = 0; } -void kaneko_grap2_device::rom_bank_updated() -{ -} - uint16_t kaneko_grap2_device::regs1_r(offs_t offset, uint16_t mem_mask) { switch (offset) diff --git a/src/mame/kaneko/kaneko_grap2.h b/src/mame/kaneko/kaneko_grap2.h index 967732d954e..1fc78a06001 100644 --- a/src/mame/kaneko/kaneko_grap2.h +++ b/src/mame/kaneko/kaneko_grap2.h @@ -71,8 +71,6 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual void rom_bank_updated() override; - // device_palette_interface overrides virtual uint32_t palette_entries() const noexcept override { return PALETTE_SIZE; } }; diff --git a/src/mame/kaneko/sknsspr.cpp b/src/mame/kaneko/sknsspr.cpp index d27b38ad044..e8106968175 100644 --- a/src/mame/kaneko/sknsspr.cpp +++ b/src/mame/kaneko/sknsspr.cpp @@ -45,11 +45,6 @@ void sknsspr_device::device_reset() //printf("sknsspr_device::device_reset()\n"); } -void sknsspr_device::rom_bank_updated() -{ - //printf("sknsspr_device::rom_bank_updated()\n"); -} - int sknsspr_device::skns_rle_decode ( int romoffset, int size ) { int decodeoffset = 0; diff --git a/src/mame/kaneko/sknsspr.h b/src/mame/kaneko/sknsspr.h index a449bc67fe0..20dc8301b2b 100644 --- a/src/mame/kaneko/sknsspr.h +++ b/src/mame/kaneko/sknsspr.h @@ -20,7 +20,6 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual void rom_bank_updated() override; private: static constexpr unsigned SUPRNOVA_DECODE_BUFFER_SIZE = 0x2000; int m_sprite_kludge_x = 0, m_sprite_kludge_y = 0; diff --git a/src/mame/sega/315-5838_317-0229_comp.cpp b/src/mame/sega/315-5838_317-0229_comp.cpp index 2c2d24ced62..c3bafb36005 100644 --- a/src/mame/sega/315-5838_317-0229_comp.cpp +++ b/src/mame/sega/315-5838_317-0229_comp.cpp @@ -54,10 +54,6 @@ void sega_315_5838_comp_device::device_reset() m_abort = false; } -void sega_315_5838_comp_device::rom_bank_updated() -{ -} - /************************** * * Decathlete diff --git a/src/mame/sega/315-5838_317-0229_comp.h b/src/mame/sega/315-5838_317-0229_comp.h index 72500307da7..9910ff63bf4 100644 --- a/src/mame/sega/315-5838_317-0229_comp.h +++ b/src/mame/sega/315-5838_317-0229_comp.h @@ -39,8 +39,6 @@ protected: virtual void device_start() override; virtual void device_reset() override; - virtual void rom_bank_updated() override; - private: uint16_t source_word_r(); diff --git a/src/mame/shared/seibusound.h b/src/mame/shared/seibusound.h index a95e780fa70..664615e000c 100644 --- a/src/mame/shared/seibusound.h +++ b/src/mame/shared/seibusound.h @@ -127,7 +127,6 @@ public: protected: // device-level overrides virtual void device_start() override { } - virtual void rom_bank_updated() override { } }; DECLARE_DEVICE_TYPE(SEI80BU, sei80bu_device) diff --git a/src/mame/shared/wswansound.cpp b/src/mame/shared/wswansound.cpp index 773bfda4948..68f8bfeb990 100644 --- a/src/mame/shared/wswansound.cpp +++ b/src/mame/shared/wswansound.cpp @@ -96,7 +96,7 @@ void wswan_sound_device::device_clock_changed() m_channel->set_sample_rate(clock() / clk_div); } -void wswan_sound_device::rom_bank_updated() +void wswan_sound_device::rom_bank_pre_change() { m_channel->update(); } diff --git a/src/mame/shared/wswansound.h b/src/mame/shared/wswansound.h index 43906b5d090..5cdd7952e66 100644 --- a/src/mame/shared/wswansound.h +++ b/src/mame/shared/wswansound.h @@ -51,7 +51,7 @@ protected: virtual void device_clock_changed() override; virtual void device_reset() override; - virtual void rom_bank_updated() override; + virtual void rom_bank_pre_change() override; // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) override; -- cgit v1.2.3