SAA1099: try fixing big endian

This commit is contained in:
tildearrow 2022-11-15 22:25:05 -05:00
parent f6f6101762
commit 22938d240d

View file

@ -71,10 +71,17 @@ void DivPlatformSAA1099::acquire_saaSound(short* bufL, short* bufR, size_t start
writes.pop(); writes.pop();
} }
saa_saaSound->GenerateMany((unsigned char*)saaBuf[0],len,oscBuf); saa_saaSound->GenerateMany((unsigned char*)saaBuf[0],len,oscBuf);
#ifdef TA_BIG_ENDIAN
for (size_t i=0; i<len; i++) {
bufL[i+start]=(short)((((unsigned short)saaBuf[0][1+(i<<1)])<<8)|(((unsigned short)saaBuf[0][1+(i<<1)])>>8));
bufR[i+start]=(short)((((unsigned short)saaBuf[0][i<<1])<<8)|(((unsigned short)saaBuf[0][i<<1])>>8));
}
#else
for (size_t i=0; i<len; i++) { for (size_t i=0; i<len; i++) {
bufL[i+start]=saaBuf[0][i<<1]; bufL[i+start]=saaBuf[0][i<<1];
bufR[i+start]=saaBuf[0][1+(i<<1)]; bufR[i+start]=saaBuf[0][1+(i<<1)];
} }
#endif
} }
void DivPlatformSAA1099::acquire(short* bufL, short* bufR, size_t start, size_t len) { void DivPlatformSAA1099::acquire(short* bufL, short* bufR, size_t start, size_t len) {