S3M import: fix 16-bit mono sample loading

This commit is contained in:
tildearrow 2024-06-25 16:55:47 -05:00
parent 0a426efe12
commit 95bf3f2bb1

View file

@ -487,15 +487,17 @@ bool DivEngine::loadS3M(unsigned char* file, size_t len) {
}
}
} else {
reader.read(s->getCurBuf(),s->samples);
if (!signedSamples) {
if (s->depth==DIV_SAMPLE_DEPTH_16BIT) {
for (unsigned int i=0; i<s->samples; i++) {
if (s->depth==DIV_SAMPLE_DEPTH_16BIT) {
for (unsigned int i=0; i<s->samples; i++) {
s->data16[i]=reader.readS();
if (!signedSamples) {
s->data16[i]^=0x8000;
}
} else {
for (unsigned int i=0; i<s->samples; i++) {
}
} else {
for (unsigned int i=0; i<s->samples; i++) {
s->data8[i]=reader.readC();
if (!signedSamples) {
s->data8[i]^=0x80;
}
}