Fix K053260 sample offset
This commit is contained in:
parent
20ea5827cf
commit
71b76e3e88
|
@ -226,7 +226,7 @@ void k053260_core::voice_t::write(u8 address, u8 data)
|
||||||
m_start = (m_start & ~0x00ff00) | (u32(data) << 8);
|
m_start = (m_start & ~0x00ff00) | (u32(data) << 8);
|
||||||
break;
|
break;
|
||||||
case 6: // start address bit 16-20
|
case 6: // start address bit 16-20
|
||||||
m_start = (m_start & ~0x1f0000) | (u32(bitfield(data, 16, 5)) << 16);
|
m_start = (m_start & ~0x1f0000) | (u32(bitfield(data, 0, 5)) << 16);
|
||||||
break;
|
break;
|
||||||
case 7: // volume
|
case 7: // volume
|
||||||
m_volume = bitfield(data, 0, 7);
|
m_volume = bitfield(data, 0, 7);
|
||||||
|
|
|
@ -145,15 +145,15 @@ void DivPlatformK053260::tick(bool sysTick) {
|
||||||
off=8363.0/s->centerRate;
|
off=8363.0/s->centerRate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DivSample* s=parent->getSample(chan[i].sample);
|
DivSample* s=parent->getSample(sample);
|
||||||
chan[i].freq=0x1000-(int)(off*parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,true,0,chan[i].pitch2,chipClock,CHIP_DIVIDER));
|
chan[i].freq=0x1000-(int)(off*parent->calcFreq(chan[i].baseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,true,0,chan[i].pitch2,chipClock,CHIP_DIVIDER));
|
||||||
if (chan[i].freq>4095) chan[i].freq=4095;
|
if (chan[i].freq>4095) chan[i].freq=4095;
|
||||||
if (chan[i].freq<0) chan[i].freq=0;
|
if (chan[i].freq<0) chan[i].freq=0;
|
||||||
if (chan[i].keyOn) {
|
if (chan[i].keyOn) {
|
||||||
unsigned int start=0;
|
unsigned int start=0;
|
||||||
unsigned int length=0;
|
unsigned int length=0;
|
||||||
if (chan[i].sample>=0 && chan[i].sample<parent->song.sampleLen) {
|
if (sample>=0 && sample<parent->song.sampleLen) {
|
||||||
start=sampleOffK053260[chan[i].sample];
|
start=sampleOffK053260[sample];
|
||||||
length=s->length8;
|
length=s->length8;
|
||||||
if (chan[i].reverse) {
|
if (chan[i].reverse) {
|
||||||
start+=length;
|
start+=length;
|
||||||
|
@ -163,8 +163,7 @@ void DivPlatformK053260::tick(bool sysTick) {
|
||||||
if (chan[i].audPos>0) {
|
if (chan[i].audPos>0) {
|
||||||
if (chan[i].reverse) {
|
if (chan[i].reverse) {
|
||||||
start=start-MIN(chan[i].audPos,s->length8);
|
start=start-MIN(chan[i].audPos,s->length8);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
start=start+MIN(chan[i].audPos,s->length8);
|
start=start+MIN(chan[i].audPos,s->length8);
|
||||||
}
|
}
|
||||||
length=MAX(1,length-chan[i].audPos);
|
length=MAX(1,length-chan[i].audPos);
|
||||||
|
|
Loading…
Reference in New Issue