C219: fix VGM export

a sample word has two 8-bit samples in reverse order
(need hardware confirmation)
This commit is contained in:
tildearrow 2023-08-29 04:09:11 -05:00
parent e7fe99f795
commit eaac5cc224
2 changed files with 7 additions and 6 deletions

View file

@ -171,8 +171,8 @@ void c219_voice_tick(struct c219_t *c219, const unsigned char v, const int cycle
else
{
// fetch 8 bit sample
signed short s1 = c219->sample_mem[((unsigned int)(c219->bank[(v >> 2) & 3]) << 17) | voice->addr];
signed short s2 = c219->sample_mem[((unsigned int)(c219->bank[(v >> 2) & 3]) << 17) | ((voice->addr + 1) & 0x1ffff)];
signed short s1 = c219->sample_mem[((unsigned int)(c219->bank[(v >> 2) & 3]) << 17) | (voice->addr^1)];
signed short s2 = c219->sample_mem[((unsigned int)(c219->bank[(v >> 2) & 3]) << 17) | (((voice->addr + 1) & 0x1ffff)^1)];
if (voice->compressed)
{
s1 = c219->mulaw[s1&0xff];