Fix length

This commit is contained in:
cam900 2023-10-03 12:35:18 +09:00
parent b12af42b06
commit e76d96f4cb
2 changed files with 5 additions and 2 deletions

View file

@ -421,6 +421,7 @@ void DivPlatformMSM6295::renderSamples(int sysID) {
sampleOffVOX[i]=memPos; sampleOffVOX[i]=memPos;
bankedPhrase[i].bank=bankInd; bankedPhrase[i].bank=bankInd;
bankedPhrase[i].phrase=phraseInd; bankedPhrase[i].phrase=phraseInd;
bankedPhrase[i].length=paddedLen;
memPos+=paddedLen; memPos+=paddedLen;
phraseInd++; phraseInd++;
} }
@ -429,7 +430,7 @@ void DivPlatformMSM6295::renderSamples(int sysID) {
// phrase book // phrase book
for (int i=0; i<parent->song.sampleLen; i++) { for (int i=0; i<parent->song.sampleLen; i++) {
DivSample* s=parent->song.sample[i]; DivSample* s=parent->song.sample[i];
int endPos=sampleOffVOX[i]+s->lengthVOX; int endPos=sampleOffVOX[i]+bankedPhrase[i].length;
for (int b=0; b<4; b++) { for (int b=0; b<4; b++) {
unsigned int bankedAddr=((unsigned int)bankedPhrase[i].bank<<16)+(b<<8)+(bankedPhrase[i].phrase*8); unsigned int bankedAddr=((unsigned int)bankedPhrase[i].bank<<16)+(b<<8)+(bankedPhrase[i].phrase*8);
adpcmMem[bankedAddr]=b; adpcmMem[bankedAddr]=b;

View file

@ -63,9 +63,11 @@ class DivPlatformMSM6295: public DivDispatch, public vgsound_emu_mem_intf {
struct BankedPhrase { struct BankedPhrase {
unsigned char bank=0; unsigned char bank=0;
unsigned char phrase=0; unsigned char phrase=0;
unsigned int length=0;
BankedPhrase(): BankedPhrase():
bank(0), bank(0),
phrase(0) {} phrase(0),
length(0) {}
} bankedPhrase[256]; } bankedPhrase[256];
friend void putDispatchChip(void*,int); friend void putDispatchChip(void*,int);