diff --git a/src/engine/platform/msm6295.cpp b/src/engine/platform/msm6295.cpp index a6a252768..414792313 100644 --- a/src/engine/platform/msm6295.cpp +++ b/src/engine/platform/msm6295.cpp @@ -24,7 +24,6 @@ #include #define rWrite(v) if (!skipRegisterWrites) {writes.emplace(0,v); if (dumpWrites) {addWrite(0,v);} } -#define CHIP_DIVIDER 32 const char** DivPlatformMSM6295::getRegisterSheet() { return NULL; @@ -58,15 +57,7 @@ void DivPlatformMSM6295::acquire(short* bufL, short* bufR, size_t start, size_t } void DivPlatformMSM6295::tick(bool sysTick) { - for (int i=0; i<4; i++) { - if (chan[i].furnacePCM) { - chan[i].std.next(); - - if (chan[i].std.vol.had) { - chan[i].outVol=(chan[i].vol*MIN(8,chan[i].std.vol.val))/8; - } - } - } + // nothing } int DivPlatformMSM6295::dispatch(DivCommand c) { @@ -125,6 +116,7 @@ int DivPlatformMSM6295::dispatch(DivCommand c) { chan[c.chan].keyOff=true; chan[c.chan].keyOn=false; chan[c.chan].active=false; + rWrite((8<song.sampleLen; i++) { + int sampleCount=parent->song.sampleLen; + if (sampleCount>128) sampleCount=128; + for (int i=0; isong.sample[i]; - int paddedLen=(s->lengthVOX+255)&(~0xff); - if ((memPos&0xf00000)!=((memPos+paddedLen)&0xf00000)) { - memPos=(memPos+0xfffff)&0xf00000; - } + int paddedLen=s->lengthVOX; if (memPos>=getSampleMemCapacity(0)) { logW("out of ADPCM memory for sample %d!",i); break; } if (memPos+paddedLen>=getSampleMemCapacity(0)) { - memcpy(adpcmBMem+memPos,s->dataVOX,getSampleMemCapacity(0)-memPos); + memcpy(adpcmMem+memPos,s->dataVOX,getSampleMemCapacity(0)-memPos); logW("out of ADPCM memory for sample %d!",i); } else { - memcpy(adpcmBMem+memPos,s->dataVOX,paddedLen); + memcpy(adpcmMem+memPos,s->dataVOX,paddedLen); } s->offVOX=memPos; memPos+=paddedLen; } - adpcmBMemLen=memPos+256; + adpcmMemLen=memPos+256; // phrase book - for (int i=0; isong.sampleLen; i++) { + for (int i=0; isong.sample[i]; int endPos=s->offVOX+s->lengthVOX; - adpcmBMem[i*8]=(s->offVOX>>16)&0xff; - adpcmBMem[1+i*8]=(s->offVOX>>8)&0xff; - adpcmBMem[2+i*8]=(s->offVOX)&0xff; - adpcmBMem[3+i*8]=(endPos>>16)&0xff; - adpcmBMem[4+i*8]=(endPos>>8)&0xff; - adpcmBMem[5+i*8]=(endPos)&0xff; + adpcmMem[i*8]=(s->offVOX>>16)&0xff; + adpcmMem[1+i*8]=(s->offVOX>>8)&0xff; + adpcmMem[2+i*8]=(s->offVOX)&0xff; + adpcmMem[3+i*8]=(endPos>>16)&0xff; + adpcmMem[4+i*8]=(endPos>>8)&0xff; + adpcmMem[5+i*8]=(endPos)&0xff; } } int DivPlatformMSM6295::init(DivEngine* p, int channels, int sugRate, unsigned int flags) { parent=p; - adpcmBMem=new unsigned char[getSampleMemCapacity(0)]; - adpcmBMemLen=0; - iface.adpcmMem=adpcmBMem; + adpcmMem=new unsigned char[getSampleMemCapacity(0)]; + adpcmMemLen=0; + iface.adpcmMem=adpcmMem; iface.sampleBank=0; dumpWrites=false; skipRegisterWrites=false; @@ -327,7 +319,7 @@ void DivPlatformMSM6295::quit() { delete oscBuf[i]; } delete msm; - delete[] adpcmBMem; + delete[] adpcmMem; } DivPlatformMSM6295::~DivPlatformMSM6295() { diff --git a/src/engine/platform/msm6295.h b/src/engine/platform/msm6295.h index 346942c75..4f6cd4ce1 100644 --- a/src/engine/platform/msm6295.h +++ b/src/engine/platform/msm6295.h @@ -93,8 +93,8 @@ class DivPlatformMSM6295: public DivDispatch { unsigned char regPool[512]; unsigned char lastBusy; - unsigned char* adpcmBMem; - size_t adpcmBMemLen; + unsigned char* adpcmMem; + size_t adpcmMemLen; DivMSM6295Interface iface; unsigned char sampleBank;