mirror of
https://github.com/holub/mame
synced 2025-07-04 09:28:51 +03:00
floppy sound: fix spin sample oob access
This commit is contained in:
parent
c4a1e2e67f
commit
9a61f0be35
@ -1544,7 +1544,7 @@ void floppy_sound_device::device_start()
|
|||||||
{
|
{
|
||||||
// What kind of drive do we have?
|
// What kind of drive do we have?
|
||||||
bool is525 = strstr(tag(), "525") != nullptr;
|
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;
|
m_motor_on = false;
|
||||||
|
|
||||||
@ -1582,15 +1582,18 @@ 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
|
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_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
|
else
|
||||||
{
|
{
|
||||||
// Motor has been running and is turned off now
|
// Motor has been running and is turned off now
|
||||||
if ((m_spin_playback_sample == SPIN_EMPTY || m_spin_playback_sample == SPIN_LOADED) && !running)
|
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_spin_playback_sample = SPIN_END; // go to spin down sound when loop is finished
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
m_motor_on = running;
|
m_motor_on = running;
|
||||||
m_with_disk = withdisk;
|
m_with_disk = withdisk;
|
||||||
}
|
}
|
||||||
@ -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
|
// Spindown sample over, be quiet or restart if the
|
||||||
// motor has been restarted
|
// motor has been restarted
|
||||||
if (m_motor_on)
|
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
|
else
|
||||||
m_spin_playback_sample = QUIET;
|
m_spin_playback_sample = QUIET;
|
||||||
break;
|
break;
|
||||||
|
@ -2149,7 +2149,7 @@ ROM_END
|
|||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
|
|
||||||
National Semiconductor Cops Pocket Assistant (CPA)
|
National Semiconductor COPS Pocket Assistant (CPA)
|
||||||
* COP444 MCU label COP444L-JXY/N
|
* COP444 MCU label COP444L-JXY/N
|
||||||
* 8-digit 7seg display, 1-bit sound
|
* 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( 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 )
|
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 )
|
COMP( 1984, solution, 0, 0, scat, solution, scat_state, empty_init, "SCAT", "The Solution", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW )
|
||||||
|
|
||||||
|
@ -928,7 +928,7 @@ ROM_END
|
|||||||
* 8-digit 14seg LED display, 2-bit sound
|
* 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
|
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.
|
||||||
|
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user