[Scummvm-git-logs] scummvm master -> 1c73db207e1a533e33c581964e9b33f48b4598ea

bluegr noreply at scummvm.org
Thu Mar 21 06:58:16 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
1c73db207e AUDIO: Fix integer sign extension issue in RJP1 envelope scaling


Commit: 1c73db207e1a533e33c581964e9b33f48b4598ea
    https://github.com/scummvm/scummvm/commit/1c73db207e1a533e33c581964e9b33f48b4598ea
Author: Robert Crossfield (robcrossfield at gmail.com)
Date: 2024-03-21T08:58:13+02:00

Commit Message:
AUDIO: Fix integer sign extension issue in RJP1 envelope scaling

Resolve an issue where the value was incorrectly treated as a signed integer during multiplication/division. This was causing fluctuations in volume, with levels varying up and down.

The original code reads the envelopeEnd(1 and 2) value as a byte, extends it to a word then ANDs it with 0x00FF before multiplying/dividing.

Changed paths:
    audio/mods/rjp1.cpp


diff --git a/audio/mods/rjp1.cpp b/audio/mods/rjp1.cpp
index 36dda11dfa2..a3e7360d4ca 100644
--- a/audio/mods/rjp1.cpp
+++ b/audio/mods/rjp1.cpp
@@ -472,7 +472,7 @@ void Rjp1::modulateVolumeEnvelope(Rjp1Channel *channel) {
 	if (channel->envelopeMode) {
 		int16 es = channel->envelopeScale;
 		if (es) {
-			int8 m = channel->envelopeEnd1;
+			uint8 m = channel->envelopeEnd1;
 			if (m == 0) {
 				es = 0;
 			} else {




More information about the Scummvm-git-logs mailing list