Previous 199869 Revisions Next

r187436 Wednesday 15th June, 2022 at 10:39:00 UTC by Couriersud
sound.cpp: Fix missed samples due to state save (#9917) (#9918)

* sound.cpp: Fix missed samples due to state save (#9917)

The PR address #9917. A save state may occur between time slices.
Sound devices through sound.cpp are updated during a timer call every
20ms. When the state is saved, these devices are not updated to the
current machine time. Consequently after a state load the devices have
have a "time lag" since in postload buffer end time is forced to
machine time.
This change will save the last buffer end time so that all outstanding
samples are processed.

This is a core change. I tested it on some drivers. This needs a very
thorough review and I post the PR primarily to document a possible
solution.

* sound.cpp: use "stream.sound_stream" as module name for save_item

* sound.cpp: use presave handler to store end_time()
[src/emu]sound.cpp sound.h


Previous 199869 Revisions Next


© 1997-2024 The MAME Team