summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2022-12-06 17:03:11 +0100
committer hap <happppp@users.noreply.github.com>2022-12-06 17:03:28 +0100
commit9a61f0be35b78f281d409eb358b274b624ea1753 (patch)
tree9fb4df079a6630a934501d5e33766b0ec54d5319
parentc4a1e2e67f3f14d0d79cf6ae0163551cc4a855bd (diff)
floppy sound: fix spin sample oob access
-rw-r--r--src/devices/imagedev/floppy.cpp9
-rw-r--r--src/mame/handheld/hh_cop400.cpp4
-rw-r--r--src/mame/handheld/hh_pps41.cpp2
3 files changed, 9 insertions, 6 deletions
diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp
index 3c00336dcd8..302d2562a83 100644
--- a/src/devices/imagedev/floppy.cpp
+++ b/src/devices/imagedev/floppy.cpp
@@ -1544,7 +1544,7 @@ void floppy_sound_device::device_start()
{
// What kind of drive do we have?
bool is525 = strstr(tag(), "525") != nullptr;
- set_samples_names(is525? floppy525_sample_names : floppy35_sample_names);
+ set_samples_names(is525 ? floppy525_sample_names : floppy35_sample_names);
m_motor_on = false;
@@ -1582,13 +1582,16 @@ void floppy_sound_device::motor(bool running, bool withdisk)
if ((m_spin_playback_sample==QUIET || m_spin_playback_sample==SPIN_END) && running) // motor was either off or already spinning down
{
m_spin_samplepos = 0;
- m_spin_playback_sample = withdisk? SPIN_START_LOADED : SPIN_START_EMPTY; // (re)start the motor sound
+ m_spin_playback_sample = withdisk ? SPIN_START_LOADED : SPIN_START_EMPTY; // (re)start the motor sound
}
else
{
// Motor has been running and is turned off now
if ((m_spin_playback_sample == SPIN_EMPTY || m_spin_playback_sample == SPIN_LOADED) && !running)
+ {
+ m_spin_samplepos = 0;
m_spin_playback_sample = SPIN_END; // go to spin down sound when loop is finished
+ }
}
}
m_motor_on = running;
@@ -1734,7 +1737,7 @@ void floppy_sound_device::sound_stream_update(sound_stream &stream, std::vector<
// Spindown sample over, be quiet or restart if the
// motor has been restarted
if (m_motor_on)
- m_spin_playback_sample = m_with_disk? SPIN_START_LOADED : SPIN_START_EMPTY;
+ m_spin_playback_sample = m_with_disk ? SPIN_START_LOADED : SPIN_START_EMPTY;
else
m_spin_playback_sample = QUIET;
break;
diff --git a/src/mame/handheld/hh_cop400.cpp b/src/mame/handheld/hh_cop400.cpp
index c9a1c3c2245..90e61bd4a68 100644
--- a/src/mame/handheld/hh_cop400.cpp
+++ b/src/mame/handheld/hh_cop400.cpp
@@ -2149,7 +2149,7 @@ ROM_END
/***************************************************************************
- National Semiconductor Cops Pocket Assistant (CPA)
+ National Semiconductor COPS Pocket Assistant (CPA)
* COP444 MCU label COP444L-JXY/N
* 8-digit 7seg display, 1-bit sound
@@ -2496,7 +2496,7 @@ CONS( 1981, lightfgt, 0, 0, lightfgt, lightfgt, lightfgt_state, e
CONS( 1982, bship82, bship, 0, bship82, bship82, bship82_state, empty_init, "Milton Bradley", "Electronic Battleship (1982 version)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // ***
CONS( 1979, qkracer, 0, 0, qkracer, qkracer, qkracer_state, empty_init, "National Semiconductor", "QuizKid Racer (COP420 version)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW )
-COMP( 1982, copspa, 0, 0, mdallas, copspa, mdallas_state, empty_init, "National Semiconductor", "Cops Pocket Assistant", MACHINE_SUPPORTS_SAVE )
+COMP( 1982, copspa, 0, 0, mdallas, copspa, mdallas_state, empty_init, "National Semiconductor", "COPS Pocket Assistant", MACHINE_SUPPORTS_SAVE )
COMP( 1984, solution, 0, 0, scat, solution, scat_state, empty_init, "SCAT", "The Solution", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW )
diff --git a/src/mame/handheld/hh_pps41.cpp b/src/mame/handheld/hh_pps41.cpp
index f5ceaa297ec..7d4e761bfda 100644
--- a/src/mame/handheld/hh_pps41.cpp
+++ b/src/mame/handheld/hh_pps41.cpp
@@ -928,7 +928,7 @@ ROM_END
* 8-digit 14seg LED display, 2-bit sound
This is not a toy, but a fortune forecast. Date format is mm-dd-yy, it is
- valid only from June 1 1979 until December 31 1987
+ valid only from June 1 1979 until December 31 1987.
***************************************************************************/