diff dev/a2s-regen.c @ 225:ba737a0203e2

dev/a2s-regen.c: fix generation of negative outputs
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 23 Apr 2023 04:36:21 +0000
parents b502321000aa
children
line wrap: on
line diff
--- a/dev/a2s-regen.c	Sun Apr 23 04:34:09 2023 +0000
+++ b/dev/a2s-regen.c	Sun Apr 23 04:36:21 2023 +0000
@@ -30,7 +30,7 @@
     if (input & 0x80)           /* invert, if negative sample */
 	return mant;
     else
-	return mant + 0x8000;
+	return -mant & 0xFFFF;
 }
 
 main(argc, argv)