diff options
author | 2021-03-03 01:39:12 -0800 | |
---|---|---|
committer | 2021-03-03 01:39:12 -0800 | |
commit | 44cec5caaff1dbc24ee9f154c1745888b2319128 (patch) | |
tree | ee8eb96da583d7cf0b9e45375bd54da8def26366 | |
parent | 76f7ddca50ada66a4681cac8f2e68569465dda6a (diff) |
Fix TMNT audio decoding so that it doesn't invoke undefined C++ behavior. Also don't bother registering decoded sample data for saving.
-rw-r--r-- | src/mame/drivers/tmnt.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mame/drivers/tmnt.cpp b/src/mame/drivers/tmnt.cpp index 727e3241419..4b681d94d8d 100644 --- a/src/mame/drivers/tmnt.cpp +++ b/src/mame/drivers/tmnt.cpp @@ -230,8 +230,6 @@ SAMPLES_START_CB_MEMBER(tmnt_state::tmnt_decode_sample) int i; uint8_t *source = memregion("title")->base(); - save_item(NAME(m_sampledata)); - /* Sound sample for TMNT.D05 is stored in the following mode (ym3012 format): * * Bit 15-13: Exponent (2 ^ x) @@ -248,7 +246,7 @@ SAMPLES_START_CB_MEMBER(tmnt_state::tmnt_decode_sample) val = (val >> 3) & (0x3ff); /* 10 bit, Max Amplitude 0x400 */ val -= 0x200; /* Centralize value */ - val <<= (expo - 3); + val = (val << expo) >> 3; m_sampledata[i] = val; } |