MAME/floppy.patch

42 lines
1.6 KiB
Diff
Raw Normal View History

2023-12-22 09:16:54 +00:00
diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp
2024-02-17 08:53:13 +00:00
index b0a520a0..7f733635 100644
2023-12-22 09:16:54 +00:00
--- a/src/devices/imagedev/floppy.cpp
+++ b/src/devices/imagedev/floppy.cpp
2024-02-17 08:53:13 +00:00
@@ -1709,9 +1709,11 @@ void floppy_sound_device::sound_stream_update(sound_stream &stream, std::vector<
2023-12-22 09:16:54 +00:00
{
2024-02-17 08:53:13 +00:00
m_idx = m_spin_playback_sample;
sampleend = m_sample[m_idx].data.size();
- out = m_sample[m_idx].data[m_spin_samplepos++];
2023-12-22 09:16:54 +00:00
- if (m_spin_samplepos >= sampleend)
+ m_spin_samplepos++;
+ if (m_spin_samplepos < sampleend)
2024-02-17 08:53:13 +00:00
+ out = m_sample[m_idx].data[m_spin_samplepos];
2023-12-22 09:16:54 +00:00
+ else
{
// Motor sample has completed
switch (m_spin_playback_sample)
2024-02-17 08:53:13 +00:00
@@ -1765,7 +1767,8 @@ void floppy_sound_device::sound_stream_update(sound_stream &stream, std::vector<
m_idx = m_step_base + m_seek_playback_sample;
sampleend = m_sample[m_idx].data.size();
2023-12-22 09:16:54 +00:00
// Mix it into the stream value
2024-02-17 08:53:13 +00:00
- out += m_sample[m_idx].data[(int)m_seek_samplepos];
2023-12-22 09:16:54 +00:00
+ if (m_seek_samplepos < sampleend)
2024-02-17 08:53:13 +00:00
+ out += m_sample[m_idx].data[(int)m_seek_samplepos];
2023-12-22 09:16:54 +00:00
// By adding different values than 1, we can change the playback speed
// This will be used to adjust the seek sound
m_seek_samplepos += m_seek_pitch;
2024-02-17 08:53:13 +00:00
@@ -1783,8 +1786,10 @@ void floppy_sound_device::sound_stream_update(sound_stream &stream, std::vector<
sampleend = m_sample[m_idx].data.size();
2023-12-22 09:16:54 +00:00
// Mix it into the stream value
2024-02-17 08:53:13 +00:00
- out += m_sample[m_idx].data[m_step_samplepos++];
2023-12-22 09:16:54 +00:00
- if (m_step_samplepos >= sampleend)
+ m_step_samplepos++;
+ if (m_step_samplepos < sampleend)
2024-02-17 08:53:13 +00:00
+ out += m_sample[m_idx].data[m_step_samplepos];
2023-12-22 09:16:54 +00:00
+ else
{
// Step sample done
2024-03-27 08:06:24 +00:00
m_step_samplepos = 0;