C219: fix VGM export
a sample word has two 8-bit samples in reverse order (need hardware confirmation)
This commit is contained in:
parent
e7fe99f795
commit
eaac5cc224
|
@ -573,6 +573,7 @@ void DivPlatformC140::renderSamples(int sysID) {
|
||||||
if ((memPos&0xfe0000)!=((memPos+length)&0xfe0000)) {
|
if ((memPos&0xfe0000)!=((memPos+length)&0xfe0000)) {
|
||||||
memPos=((memPos+0x1ffff)&0xfe0000);
|
memPos=((memPos+0x1ffff)&0xfe0000);
|
||||||
}
|
}
|
||||||
|
logV("%d",length);
|
||||||
if (memPos>=(getSampleMemCapacity())) {
|
if (memPos>=(getSampleMemCapacity())) {
|
||||||
logW("out of C219 memory for sample %d!",i);
|
logW("out of C219 memory for sample %d!",i);
|
||||||
break;
|
break;
|
||||||
|
@ -584,17 +585,17 @@ void DivPlatformC140::renderSamples(int sysID) {
|
||||||
if (s->depth==DIV_SAMPLE_DEPTH_C219) {
|
if (s->depth==DIV_SAMPLE_DEPTH_C219) {
|
||||||
for (unsigned int i=0; i<length; i++) {
|
for (unsigned int i=0; i<length; i++) {
|
||||||
if (i>=s->lengthC219) {
|
if (i>=s->lengthC219) {
|
||||||
sampleMem[i+memPos]=0;
|
sampleMem[(memPos+i)^1]=0;
|
||||||
} else {
|
} else {
|
||||||
sampleMem[i+memPos]=s->dataC219[i];
|
sampleMem[(memPos+i)^1]=s->dataC219[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (unsigned int i=0; i<length; i++) {
|
for (unsigned int i=0; i<length; i++) {
|
||||||
if (i>=s->length8) {
|
if (i>=s->length8) {
|
||||||
sampleMem[memPos+i]=0;
|
sampleMem[(memPos+i)^1]=0;
|
||||||
} else {
|
} else {
|
||||||
sampleMem[memPos+i]=s->data8[i];
|
sampleMem[(memPos+i)^1]=s->data8[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -171,8 +171,8 @@ void c219_voice_tick(struct c219_t *c219, const unsigned char v, const int cycle
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// fetch 8 bit sample
|
// fetch 8 bit sample
|
||||||
signed short s1 = c219->sample_mem[((unsigned int)(c219->bank[(v >> 2) & 3]) << 17) | voice->addr];
|
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)];
|
signed short s2 = c219->sample_mem[((unsigned int)(c219->bank[(v >> 2) & 3]) << 17) | (((voice->addr + 1) & 0x1ffff)^1)];
|
||||||
if (voice->compressed)
|
if (voice->compressed)
|
||||||
{
|
{
|
||||||
s1 = c219->mulaw[s1&0xff];
|
s1 = c219->mulaw[s1&0xff];
|
||||||
|
|
Loading…
Reference in New Issue