From c86232158c7ccdf0152ff1b42dc160841d37ea6c Mon Sep 17 00:00:00 2001 From: mahoneyt944 <49591133+mahoneyt944@users.noreply.github.com> Date: Mon, 11 Nov 2024 06:38:51 -0500 Subject: [PATCH] Fix scross engine sounds missing - dink --- src/sound/multipcm.c | 52 ++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/sound/multipcm.c b/src/sound/multipcm.c index 139932a2..2efa1eae 100644 --- a/src/sound/multipcm.c +++ b/src/sound/multipcm.c @@ -397,31 +397,7 @@ static void MultiPCM_reg_w(int chip, int offset, unsigned char data) break; case 1: /* sample*/ - break; - - case 2: /* pitch LSB*/ - /* MUST fall through to update pitch also!*/ - case 3: /* pitch MSB*/ - /* compute frequency divisor*/ - pitch = (cptr->registers[vnum][3]<<8) + cptr->registers[vnum][2]; - pt_abs = (double)abs(pitch); - pt_oct = pt_abs>>12; - if(pitch < 0) - { - vptr->ptdelta = cptr->dlttbl[0x1000 - (pt_abs&0xfff)]; - vptr->ptdelta >>= (pt_oct+1); - } - else - { - vptr->ptdelta = cptr->dlttbl[pt_abs&0xfff]; - vptr->ptdelta <<= pt_oct; - } - break; - - case 4: /* key on/off*/ - if (data & 0x80) - { - inum = cptr->registers[vnum][1]; + inum = cptr->registers[vnum][1]; /* calc decay amount*/ vptr->relamt = decaytbl[(0x0f - cptr->samples[inum].env[2])]; @@ -461,8 +437,32 @@ static void MultiPCM_reg_w(int chip, int offset, unsigned char data) vptr->ptoffset = 0; vptr->ptsum = 0; - vptr->active = 1; vptr->relstage = 0; + break; + + case 2: /* pitch LSB*/ + /* MUST fall through to update pitch also!*/ + case 3: /* pitch MSB*/ + /* compute frequency divisor*/ + pitch = (cptr->registers[vnum][3]<<8) + cptr->registers[vnum][2]; + pt_abs = (double)abs(pitch); + pt_oct = pt_abs>>12; + if(pitch < 0) + { + vptr->ptdelta = cptr->dlttbl[0x1000 - (pt_abs&0xfff)]; + vptr->ptdelta >>= (pt_oct+1); + } + else + { + vptr->ptdelta = cptr->dlttbl[pt_abs&0xfff]; + vptr->ptdelta <<= pt_oct; + } + break; + + case 4: /* key on/off*/ + if (data & 0x80) + { + vptr->active = 1; } else {