From dc0d2e48ec16e8c266a3d9ca646ceae117a03121 Mon Sep 17 00:00:00 2001 From: Fredrik Noring Date: Mon, 6 Jan 2025 12:54:24 +0100 Subject: [PATCH] Mix PSG and DMA more pleasingly Final mixing levels to be determined. --- lib/psgplay/psgplay.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/psgplay/psgplay.c b/lib/psgplay/psgplay.c index e1f40bd..285ab98 100644 --- a/lib/psgplay/psgplay.c +++ b/lib/psgplay/psgplay.c @@ -286,14 +286,14 @@ static inline struct psgplay_stereo stereo_mix(struct mixer *m, return (struct psgplay_stereo) { /* Simplistic half volume each to PSG and sound. */ - .left = m->gain.left * (d.sound.left + s) / 2, - .right = m->gain.right * (d.sound.right + s) / 2 + .left = m->gain.left * (2*d.sound.left + 4*s) / (2*4), + .right = m->gain.right * (2*d.sound.right + 4*s) / (2*4) }; } else return (struct psgplay_stereo) { /* Simplistic half volume each to PSG and sound. */ - .left = (d.sound.left + s) / 2, - .right = (d.sound.right + s) / 2 + .left = (2*d.sound.left + 4*s) / (2*4), + .right = (2*d.sound.right + 4*s) / (2*4) }; }