From 1d3318c214e74937eaaa836aea71e4d6cff9b866 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 15 Dec 2024 15:56:18 -0500 Subject: [PATCH] VGM export: fix DAC data being offset --- src/engine/vgmOps.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/engine/vgmOps.cpp b/src/engine/vgmOps.cpp index e16af0cec..6e370a519 100644 --- a/src/engine/vgmOps.cpp +++ b/src/engine/vgmOps.cpp @@ -2195,7 +2195,7 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p w->writeC(0); w->writeI(sample->length8); for (unsigned int j=0; jlength8; j++) { - w->writeC((unsigned char)sample->data8[j]+0x80); + w->writeC((unsigned char)sample->data8[j]^0x80); } } @@ -2206,7 +2206,7 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p w->writeC(7); w->writeI(sample->length8); for (unsigned int j=0; jlength8; j++) { - w->writeC(((unsigned char)sample->data8[j]+0x80)>>1); + w->writeC(((unsigned char)sample->data8[j]^0x80)>>1); } bankOffsetNESCurrent+=sample->length8; } @@ -2218,7 +2218,7 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p w->writeC(5); w->writeI(sample->length8); for (unsigned int j=0; jlength8; j++) { - w->writeC(((unsigned char)sample->data8[j]+0x80)>>3); + w->writeC(((unsigned char)sample->data8[j]^0x80)>>3); } }