summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2016-08-16 11:11:36 +0200
committer Olivier Galibert <galibert@pobox.com>2016-08-16 11:11:36 +0200
commita826c0569f1404a8bce6cfb77df6845d2de03b3a (patch)
tree1e6df74ae92defa2f0504d0c5024e9a66989c9b8
parent2d165744d0d282e6cca19f8e374b5bd564390683 (diff)
okim6295 dirom fix
-rw-r--r--src/devices/sound/okim6295.cpp9
-rw-r--r--src/devices/sound/okim6295.h3
2 files changed, 5 insertions, 7 deletions
diff --git a/src/devices/sound/okim6295.cpp b/src/devices/sound/okim6295.cpp
index 796534cb4fb..f5b2490fb52 100644
--- a/src/devices/sound/okim6295.cpp
+++ b/src/devices/sound/okim6295.cpp
@@ -89,8 +89,7 @@ okim6295_device::okim6295_device(const machine_config &mconfig, const char *tag,
m_bank_installed(false),
m_bank_offs(0),
m_stream(nullptr),
- m_pin7_state(0),
- m_direct(nullptr)
+ m_pin7_state(0)
{
}
@@ -181,7 +180,7 @@ void okim6295_device::sound_stream_update(sound_stream &stream, stream_sample_t
// iterate over voices and accumulate sample data
for (auto & elem : m_voice)
- elem.generate_adpcm(*m_direct, outputs[0], samples);
+ elem.generate_adpcm(*this, outputs[0], samples);
}
@@ -375,7 +374,7 @@ okim6295_device::okim_voice::okim_voice()
// add them to an output stream
//-------------------------------------------------
-void okim6295_device::okim_voice::generate_adpcm(direct_read_data &direct, stream_sample_t *buffer, int samples)
+void okim6295_device::okim_voice::generate_adpcm(device_rom_interface &rom, stream_sample_t *buffer, int samples)
{
// skip if not active
if (!m_playing)
@@ -385,7 +384,7 @@ void okim6295_device::okim_voice::generate_adpcm(direct_read_data &direct, strea
while (samples-- != 0)
{
// fetch the next sample byte
- int nibble = direct.read_byte(m_base_offset + m_sample / 2) >> (((m_sample & 1) << 2) ^ 4);
+ int nibble = rom.read_byte(m_base_offset + m_sample / 2) >> (((m_sample & 1) << 2) ^ 4);
// output to the buffer, scaling by the volume
// signal in range -2048..2047, volume in range 2..32 => signal * volume / 2 in range -32768..32767
diff --git a/src/devices/sound/okim6295.h b/src/devices/sound/okim6295.h
index 84a2d1bb85e..b637ed057a4 100644
--- a/src/devices/sound/okim6295.h
+++ b/src/devices/sound/okim6295.h
@@ -88,7 +88,7 @@ protected:
{
public:
okim_voice();
- void generate_adpcm(direct_read_data &direct, stream_sample_t *buffer, int samples);
+ void generate_adpcm(device_rom_interface &rom, stream_sample_t *buffer, int samples);
oki_adpcm_state m_adpcm; // current ADPCM state
bool m_playing;
@@ -110,7 +110,6 @@ protected:
offs_t m_bank_offs;
sound_stream * m_stream;
UINT8 m_pin7_state;
- direct_read_data * m_direct;
static const UINT8 s_volume_table[16];
};