fix issue with volume macro+slide

This commit is contained in:
tildearrow 2022-01-17 16:23:47 -05:00
parent dde2462025
commit 6884494b5c
9 changed files with 9 additions and 9 deletions

View file

@ -49,7 +49,7 @@ void DivPlatformAmiga::tick() {
for (int i=0; i<4; i++) { for (int i=0; i<4; i++) {
chan[i].std.next(); chan[i].std.next();
if (chan[i].std.hadVol) { if (chan[i].std.hadVol) {
chan[i].outVol=(chan[i].vol*chan[i].std.vol)>>6; chan[i].outVol=((chan[i].vol%65)*chan[i].std.vol)>>6;
} }
if (chan[i].std.hadArp) { if (chan[i].std.hadArp) {
if (!chan[i].inPorta) { if (!chan[i].inPorta) {

View file

@ -34,7 +34,7 @@ void DivPlatformAY8910::tick() {
for (int i=0; i<3; i++) { for (int i=0; i<3; i++) {
chan[i].std.next(); chan[i].std.next();
if (chan[i].std.hadVol) { if (chan[i].std.hadVol) {
chan[i].outVol=chan[i].std.vol-(15-chan[i].vol); chan[i].outVol=chan[i].std.vol-(15-(chan[i].vol&15));
if (chan[i].outVol<0) chan[i].outVol=0; if (chan[i].outVol<0) chan[i].outVol=0;
if (isMuted[i]) { if (isMuted[i]) {
rWrite(0x08+i,0); rWrite(0x08+i,0);

View file

@ -55,7 +55,7 @@ void DivPlatformAY8930::tick() {
for (int i=0; i<3; i++) { for (int i=0; i<3; i++) {
chan[i].std.next(); chan[i].std.next();
if (chan[i].std.hadVol) { if (chan[i].std.hadVol) {
chan[i].outVol=chan[i].std.vol-(31-chan[i].vol); chan[i].outVol=chan[i].std.vol-(31-(chan[i].vol&31));
if (chan[i].outVol<0) chan[i].outVol=0; if (chan[i].outVol<0) chan[i].outVol=0;
if (isMuted[i]) { if (isMuted[i]) {
rWrite(0x08+i,0); rWrite(0x08+i,0);

View file

@ -68,7 +68,7 @@ void DivPlatformNES::tick() {
chan[i].std.next(); chan[i].std.next();
if (chan[i].std.hadVol) { if (chan[i].std.hadVol) {
// ok, why are the volumes like that? // ok, why are the volumes like that?
chan[i].outVol=chan[i].std.vol-(15-chan[i].vol); chan[i].outVol=chan[i].std.vol-(15-(chan[i].vol&15));
if (chan[i].outVol<0) chan[i].outVol=0; if (chan[i].outVol<0) chan[i].outVol=0;
if (i==2) { // triangle if (i==2) { // triangle
rWrite(0x4000+i*4,(chan[i].outVol==0)?0:255); rWrite(0x4000+i*4,(chan[i].outVol==0)?0:255);

View file

@ -88,7 +88,7 @@ void DivPlatformPCE::tick() {
for (int i=0; i<6; i++) { for (int i=0; i<6; i++) {
chan[i].std.next(); chan[i].std.next();
if (chan[i].std.hadVol) { if (chan[i].std.hadVol) {
chan[i].outVol=(chan[i].vol*chan[i].std.vol)>>5; chan[i].outVol=((chan[i].vol&31)*chan[i].std.vol)>>5;
chWrite(i,0x04,0x80|chan[i].outVol); chWrite(i,0x04,0x80|chan[i].outVol);
} }
if (chan[i].std.hadArp) { if (chan[i].std.hadArp) {

View file

@ -37,7 +37,7 @@ void DivPlatformSAA1099::tick() {
for (int i=0; i<6; i++) { for (int i=0; i<6; i++) {
chan[i].std.next(); chan[i].std.next();
if (chan[i].std.hadVol) { if (chan[i].std.hadVol) {
chan[i].outVol=chan[i].std.vol-(15-chan[i].vol); chan[i].outVol=chan[i].std.vol-(15-(chan[i].vol&15));
if (chan[i].outVol<0) chan[i].outVol=0; if (chan[i].outVol<0) chan[i].outVol=0;
if (isMuted[i]) { if (isMuted[i]) {
rWrite(i,0); rWrite(i,0);

View file

@ -20,7 +20,7 @@ void DivPlatformSMS::tick() {
for (int i=0; i<4; i++) { for (int i=0; i<4; i++) {
chan[i].std.next(); chan[i].std.next();
if (chan[i].std.hadVol) { if (chan[i].std.hadVol) {
chan[i].outVol=(chan[i].vol*chan[i].std.vol)>>4; chan[i].outVol=((chan[i].vol&15)*chan[i].std.vol)>>4;
rWrite(0x90|(i<<5)|(isMuted[i]?15:(15-(chan[i].outVol&15)))); rWrite(0x90|(i<<5)|(isMuted[i]?15:(15-(chan[i].outVol&15))));
} }
if (chan[i].std.hadArp) { if (chan[i].std.hadArp) {

View file

@ -45,7 +45,7 @@ void DivPlatformTIA::tick() {
for (int i=0; i<2; i++) { for (int i=0; i<2; i++) {
chan[i].std.next(); chan[i].std.next();
if (chan[i].std.hadVol) { if (chan[i].std.hadVol) {
chan[i].outVol=chan[i].std.vol-(15-chan[i].vol); chan[i].outVol=chan[i].std.vol-(15-(chan[i].vol&15));
if (chan[i].outVol<0) chan[i].outVol=0; if (chan[i].outVol<0) chan[i].outVol=0;
if (isMuted[i]) { if (isMuted[i]) {
rWrite(0x19+i,0); rWrite(0x19+i,0);

View file

@ -44,7 +44,7 @@ void DivPlatformYM2610::tick() {
for (int i=4; i<7; i++) { for (int i=4; i<7; i++) {
chan[i].std.next(); chan[i].std.next();
if (chan[i].std.hadVol) { if (chan[i].std.hadVol) {
chan[i].outVol=chan[i].std.vol-(15-chan[i].vol); chan[i].outVol=chan[i].std.vol-(15-(chan[i].vol&15));
if (chan[i].outVol<0) chan[i].outVol=0; if (chan[i].outVol<0) chan[i].outVol=0;
if (isMuted[i]) { if (isMuted[i]) {
rWrite(0x04+i,0); rWrite(0x04+i,0);