mirror of
https://github.com/holub/mame
synced 2025-05-15 18:32:02 +03:00
MT#04286 - explicitly construct adpcm_state which is embedded in the legacy
device state for Seibu ADPCM. Legacy device tokens are just allocated as a dumb blob of bytes, so constructors for embedded objects are never called.
This commit is contained in:
parent
bcf9e72cc5
commit
e86777d670
@ -176,6 +176,11 @@ static DEVICE_START( seibu_adpcm )
|
|||||||
state->playing = 0;
|
state->playing = 0;
|
||||||
state->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), state, seibu_adpcm_callback);
|
state->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), state, seibu_adpcm_callback);
|
||||||
state->base = machine.region("adpcm")->base();
|
state->base = machine.region("adpcm")->base();
|
||||||
|
|
||||||
|
// because legacy device tokens are just allocated as a blob, the constructor for adpcm_state
|
||||||
|
// is not called, so use placement new to force it to set up; when this is converted to a
|
||||||
|
// modern device, we can remove this grossness
|
||||||
|
new(&state->adpcm) adpcm_state;
|
||||||
state->adpcm.reset();
|
state->adpcm.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user