mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-23 04:55:13 +00:00
memory composition, part 4
This commit is contained in:
parent
92ec6f6651
commit
6763aa44a9
2 changed files with 15 additions and 1 deletions
|
@ -1213,6 +1213,9 @@ void DivPlatformES5506::renderSamples(int sysID) {
|
|||
memset(sampleOffES5506,0,256*sizeof(unsigned int));
|
||||
memset(sampleLoaded,0,256*sizeof(bool));
|
||||
|
||||
memCompo=DivMemoryComposition();
|
||||
memCompo.name="Sample Memory";
|
||||
|
||||
size_t memPos=128; // add silent at begin and end of each bank for reverse playback
|
||||
for (int i=0; i<parent->song.sampleLen; i++) {
|
||||
DivSample* s=parent->song.sample[i];
|
||||
|
@ -1241,9 +1244,13 @@ void DivPlatformES5506::renderSamples(int sysID) {
|
|||
}
|
||||
sampleOffES5506[i]=memPos;
|
||||
sampleLoaded[i]=true;
|
||||
memCompo.entries.push_back(DivMemoryEntry(DIV_MEMORY_SAMPLE,"Sample",i,memPos,memPos+length));
|
||||
memPos+=length;
|
||||
}
|
||||
sampleMemLen=memPos+256;
|
||||
|
||||
memCompo.used=sampleMemLen;
|
||||
memCompo.capacity=16777216;
|
||||
}
|
||||
|
||||
int DivPlatformES5506::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||
|
|
|
@ -451,6 +451,9 @@ void DivPlatformGA20::renderSamples(int sysID) {
|
|||
memset(sampleOffGA20,0,256*sizeof(unsigned int));
|
||||
memset(sampleLoaded,0,256*sizeof(bool));
|
||||
|
||||
memCompo=DivMemoryComposition();
|
||||
memCompo.name="Sample ROM";
|
||||
|
||||
size_t memPos=0;
|
||||
for (int i=0; i<parent->song.sampleLen; i++) {
|
||||
DivSample* s=parent->song.sample[i];
|
||||
|
@ -463,6 +466,7 @@ void DivPlatformGA20::renderSamples(int sysID) {
|
|||
int actualLength=MIN((int)(getSampleMemCapacity()-memPos)-1,length);
|
||||
if (actualLength>0) {
|
||||
sampleOffGA20[i]=memPos;
|
||||
memCompo.entries.push_back(DivMemoryEntry(DIV_MEMORY_SAMPLE,"Sample",i,memPos,memPos+actualLength+1));
|
||||
for (int j=0; j<actualLength; j++) {
|
||||
// convert to 8 bit unsigned
|
||||
unsigned char val=((unsigned char)(s->data8[j]))^0x80;
|
||||
|
@ -478,10 +482,13 @@ void DivPlatformGA20::renderSamples(int sysID) {
|
|||
} else {
|
||||
sampleLoaded[i]=true;
|
||||
}
|
||||
// allign to 16 byte
|
||||
// align to 16 byte
|
||||
memPos=(memPos+0xf)&~0xf;
|
||||
}
|
||||
sampleMemLen=memPos;
|
||||
|
||||
memCompo.used=sampleMemLen;
|
||||
memCompo.capacity=1048576;
|
||||
}
|
||||
|
||||
int DivPlatformGA20::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {
|
||||
|
|
Loading…
Reference in a new issue