mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +03:00
TMS5xxx: Fix for occasional audio 'spike' instability/wraparound glitches caused by improper truncation in the lattice filter multiplier. This is not an optimal fix as it isn't correct to hardware, but it works better than the previous approximation. [Lord Nightmare]
This commit is contained in:
parent
2323a3c851
commit
70b81eb7c8
@ -676,7 +676,7 @@ static INT32 matrix_multiply(INT32 a, INT32 b)
|
||||
while (a<-512) { a+=1024; }
|
||||
while (b>16383) { b-=32768; }
|
||||
while (b<-16384) { b+=32768; }
|
||||
result = ((a*b)>>9)|1;//&(~1);
|
||||
result = ((a*b)>>9); /** TODO: this isn't technically right to the chip, which truncates the lowest result bit, but it causes glitches otherwise. **/
|
||||
#ifdef VERBOSE
|
||||
if (result>16383) fprintf(stderr,"matrix multiplier overflowed! a: %x, b: %x, result: %x", a, b, result);
|
||||
if (result<-16384) fprintf(stderr,"matrix multiplier underflowed! a: %x, b: %x, result: %x", a, b, result);
|
||||
|
@ -1079,7 +1079,7 @@ static INT32 matrix_multiply(INT32 a, INT32 b)
|
||||
while (a<-512) { a+=1024; }
|
||||
while (b>16383) { b-=32768; }
|
||||
while (b<-16384) { b+=32768; }
|
||||
result = ((a*b)>>9)|1;//&(~1);
|
||||
result = ((a*b)>>9); /** TODO: this isn't technically right to the chip, which truncates the lowest result bit, but it causes glitches otherwise. **/
|
||||
#ifdef VERBOSE
|
||||
if (result>16383) fprintf(stderr,"matrix multiplier overflowed! a: %x, b: %x, result: %x", a, b, result);
|
||||
if (result<-16384) fprintf(stderr,"matrix multiplier underflowed! a: %x, b: %x, result: %x", a, b, result);
|
||||
|
Loading…
Reference in New Issue
Block a user