memory composition, part 5

almost there
This commit is contained in:
tildearrow 2024-03-06 03:42:21 -05:00
parent 6763aa44a9
commit 0be5835645
13 changed files with 108 additions and 1 deletions

View file

@ -476,6 +476,9 @@ void DivPlatformK053260::renderSamples(int sysID) {
memset(sampleOffK053260,0,256*sizeof(unsigned int));
memset(sampleLoaded,0,256*sizeof(bool));
memCompo=DivMemoryComposition();
memCompo.name="Sample ROM";
size_t memPos=1; // for avoid silence
for (int i=0; i<parent->song.sampleLen; i++) {
DivSample* s=parent->song.sample[i];
@ -491,6 +494,7 @@ void DivPlatformK053260::renderSamples(int sysID) {
actualLength=MIN((int)(getSampleMemCapacity()-memPos-1),length);
if (actualLength>0) {
sampleOffK053260[i]=memPos-1;
memCompo.entries.push_back(DivMemoryEntry(DIV_MEMORY_SAMPLE,"Sample",i,memPos,memPos+actualLength+1));
for (int j=0; j<actualLength; j++) {
sampleMem[memPos++]=s->dataK[j];
}
@ -501,6 +505,7 @@ void DivPlatformK053260::renderSamples(int sysID) {
actualLength=MIN((int)(getSampleMemCapacity()-memPos-1),length);
if (actualLength>0) {
sampleOffK053260[i]=memPos-1;
memCompo.entries.push_back(DivMemoryEntry(DIV_MEMORY_SAMPLE,"Sample",i,memPos,memPos+actualLength+1));
for (int j=0; j<actualLength; j++) {
sampleMem[memPos++]=s->data8[j];
}
@ -514,6 +519,9 @@ void DivPlatformK053260::renderSamples(int sysID) {
sampleLoaded[i]=true;
}
sampleMemLen=memPos;
memCompo.capacity=2097152;
memCompo.used=sampleMemLen;
}
int DivPlatformK053260::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {