fix sample issues - part 5 (final?)

This commit is contained in:
tildearrow 2024-02-02 13:55:42 -05:00
parent 94cce86180
commit 35bca6e90c
12 changed files with 82 additions and 7 deletions

View file

@ -299,12 +299,15 @@ int DivPlatformVERA::dispatch(DivCommand c) {
if (c.chan<16) {
rWriteLo(c.chan,2,chan[c.chan].vol);
} else {
DivInstrument* ins=parent->getIns(chan[16].ins,DIV_INS_VERA);
if (c.value!=DIV_NOTE_NULL) {
DivInstrument* ins=parent->getIns(chan[16].ins,DIV_INS_VERA);
chan[16].pcm.sample=ins->amiga.getSample(c.value);
chan[16].sampleNote=c.value;
c.value=ins->amiga.getFreq(c.value);
chan[16].sampleNoteDelta=c.value-chan[c.chan].sampleNote;
} else if (chan[c.chan].sampleNote!=DIV_NOTE_NULL) {
chan[16].pcm.sample=ins->amiga.getSample(chan[c.chan].sampleNote);
c.value=ins->amiga.getFreq(chan[c.chan].sampleNote);
}
if (chan[16].pcm.sample<0 || chan[16].pcm.sample>=parent->song.sampleLen) {
chan[16].pcm.sample=-1;