chip sample selection, part 4

partially works
This commit is contained in:
tildearrow 2022-11-26 23:50:20 -05:00
parent 3a9349d49a
commit cf38680072
28 changed files with 94 additions and 31 deletions

View file

@ -391,7 +391,7 @@ bool DivPlatformRF5C68::isSampleLoaded(int index, int sample) {
return sampleLoaded[sample];
}
void DivPlatformRF5C68::renderSamples() {
void DivPlatformRF5C68::renderSamples(int sysID) {
memset(sampleMem,0,getSampleMemCapacity());
memset(sampleOffRFC,0,256*sizeof(unsigned int));
memset(sampleLoaded,0,256*sizeof(bool));
@ -399,6 +399,11 @@ void DivPlatformRF5C68::renderSamples() {
size_t memPos=0;
for (int i=0; i<parent->song.sampleLen; i++) {
DivSample* s=parent->song.sample[i];
if (!s->renderOn[0][sysID]) {
sampleOffRFC[i]=0;
continue;
}
int length=s->getLoopEndPosition(DIV_SAMPLE_DEPTH_8BIT);
int actualLength=MIN((int)(getSampleMemCapacity()-memPos)-31,length);
if (actualLength>0) {