Merge branch 'master' of https://github.com/tildearrow/furnace into getSampleMemOffset
This commit is contained in:
commit
e9b6b441e3
466 changed files with 378861 additions and 345914 deletions
|
|
@ -160,7 +160,7 @@ void DivPlatformK053260::tick(bool sysTick) {
|
|||
unsigned int start=0;
|
||||
unsigned int length=0;
|
||||
if (sample>=0 && sample<parent->song.sampleLen) {
|
||||
start=sampleOffK053260[sample];
|
||||
start=sampleOff[sample];
|
||||
length=(s->depth==DIV_SAMPLE_DEPTH_ADPCM_K)?s->lengthK:s->length8;
|
||||
if (chan[i].reverse) {
|
||||
start+=length;
|
||||
|
|
@ -474,7 +474,7 @@ size_t DivPlatformK053260::getSampleMemOffset(int index) {
|
|||
|
||||
bool DivPlatformK053260::isSampleLoaded(int index, int sample) {
|
||||
if (index!=0) return false;
|
||||
if (sample<0 || sample>255) return false;
|
||||
if (sample<0 || sample>32767) return false;
|
||||
return sampleLoaded[sample];
|
||||
}
|
||||
|
||||
|
|
@ -485,8 +485,8 @@ const DivMemoryComposition* DivPlatformK053260::getMemCompo(int index) {
|
|||
|
||||
void DivPlatformK053260::renderSamples(int sysID) {
|
||||
memset(sampleMem,0,getSampleMemCapacity());
|
||||
memset(sampleOffK053260,0,256*sizeof(unsigned int));
|
||||
memset(sampleLoaded,0,256*sizeof(bool));
|
||||
memset(sampleOff,0,32768*sizeof(unsigned int));
|
||||
memset(sampleLoaded,0,32768*sizeof(bool));
|
||||
|
||||
memCompo=DivMemoryComposition();
|
||||
memCompo.name="Sample ROM";
|
||||
|
|
@ -495,7 +495,7 @@ void DivPlatformK053260::renderSamples(int sysID) {
|
|||
for (int i=0; i<parent->song.sampleLen; i++) {
|
||||
DivSample* s=parent->song.sample[i];
|
||||
if (!s->renderOn[0][sysID]) {
|
||||
sampleOffK053260[i]=0;
|
||||
sampleOff[i]=0;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -505,7 +505,7 @@ void DivPlatformK053260::renderSamples(int sysID) {
|
|||
length=MIN(65535,s->getEndPosition(DIV_SAMPLE_DEPTH_ADPCM_K));
|
||||
actualLength=MIN((int)(getSampleMemCapacity()-memPos-getSampleMemOffset()),length);
|
||||
if (actualLength>0) {
|
||||
sampleOffK053260[i]=memPos-getSampleMemOffset();
|
||||
sampleOff[i]=memPos-getSampleMemOffset();
|
||||
memCompo.entries.push_back(DivMemoryEntry(DIV_MEMORY_SAMPLE,"Sample",i,memPos,memPos+actualLength+getSampleMemOffset()));
|
||||
for (int j=0; j<actualLength; j++) {
|
||||
sampleMem[memPos++]=s->dataK[j];
|
||||
|
|
@ -516,7 +516,7 @@ void DivPlatformK053260::renderSamples(int sysID) {
|
|||
length=MIN(65535,s->getEndPosition(DIV_SAMPLE_DEPTH_8BIT));
|
||||
actualLength=MIN((int)(getSampleMemCapacity()-memPos-getSampleMemOffset()),length);
|
||||
if (actualLength>0) {
|
||||
sampleOffK053260[i]=memPos-getSampleMemOffset();
|
||||
sampleOff[i]=memPos-getSampleMemOffset();
|
||||
memCompo.entries.push_back(DivMemoryEntry(DIV_MEMORY_SAMPLE,"Sample",i,memPos,memPos+actualLength+getSampleMemOffset()));
|
||||
for (int j=0; j<actualLength; j++) {
|
||||
sampleMem[memPos++]=s->data8[j];
|
||||
|
|
@ -559,3 +559,17 @@ void DivPlatformK053260::quit() {
|
|||
delete oscBuf[i];
|
||||
}
|
||||
}
|
||||
|
||||
// initialization of important arrays
|
||||
DivPlatformK053260::DivPlatformK053260():
|
||||
DivDispatch(),
|
||||
k053260_intf(),
|
||||
k053260(*this) {
|
||||
sampleOff=new unsigned int[32768];
|
||||
sampleLoaded=new bool[32768];
|
||||
}
|
||||
|
||||
DivPlatformK053260::~DivPlatformK053260() {
|
||||
delete[] sampleOff;
|
||||
delete[] sampleLoaded;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue