From 44cec5caaff1dbc24ee9f154c1745888b2319128 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Wed, 3 Mar 2021 01:39:12 -0800 Subject: Fix TMNT audio decoding so that it doesn't invoke undefined C++ behavior. Also don't bother registering decoded sample data for saving. --- src/mame/drivers/tmnt.cpp | 4 +--- 1 file changed, 1 insertion(+), 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; } -- cgit v1.2.3