Skip to content

Commit

Permalink
this does not work
Browse files Browse the repository at this point in the history
  • Loading branch information
tildearrow committed Oct 17, 2024
1 parent d5154a1 commit 3c892ad
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/engine/platform/lynx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ void DivPlatformLynx::tick(bool sysTick) {
}
}
chan[i].sampleFreq=off*parent->calcFreq(chan[i].sampleBaseFreq,chan[i].pitch,chan[i].fixedArp?chan[i].baseNoteOverride:chan[i].arpOff,chan[i].fixedArp,false,2,chan[i].pitch2,chipClock,CHIP_FREQBASE);
if (dumpWrites) addWrite(0xffff0001+(i<<8),chan[i].sampleFreq);
} else {
if (chan[i].lfsr >= 0) {
WRITE_LFSR(i, (chan[i].lfsr&0xff));
Expand Down Expand Up @@ -307,6 +308,7 @@ int DivPlatformLynx::dispatch(DivCommand c) {
} else {
chan[c.chan].samplePos=0;
}
if (dumpWrites) addWrite(0xffff0000+(c.chan<<8),chan[c.chan].sample);
}
if (c.value!=DIV_NOTE_NULL) {
chan[c.chan].baseFreq=NOTE_PERIODIC(c.value);
Expand All @@ -331,6 +333,7 @@ int DivPlatformLynx::dispatch(DivCommand c) {
chan[c.chan].macroInit(NULL);
if (chan[c.chan].pcm) {
chan[c.chan].pcm=false;
if (dumpWrites) addWrite(0xffff0002+(c.chan<<8),0);
}
break;
case DIV_CMD_LYNX_LFSR_LOAD:
Expand Down
17 changes: 14 additions & 3 deletions src/engine/vgmOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1358,6 +1358,7 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p
bool writeNESSamples=false;
bool writePCESamples=false;
bool writeVOXSamples=false;
bool writeLynxSamples=false;
DivDispatch* writeADPCM_OPNA[2]={NULL,NULL};
DivDispatch* writeADPCM_OPNB[2]={NULL,NULL};
DivDispatch* writeADPCM_Y8950[2]={NULL,NULL};
Expand Down Expand Up @@ -1687,8 +1688,7 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p
if (!hasLynx) {
hasLynx=disCont[i].dispatch->chipClock;
willExport[i]=true;
// once again
writeDACSamples=true;
writeLynxSamples=true;
} else if (!(hasLynx&0x40000000)) {
isSecond[i]=true;
willExport[i]=true;
Expand Down Expand Up @@ -2234,6 +2234,17 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p
}
}

if (writeLynxSamples && !directStream) for (int i=0; i<song.sampleLen; i++) {
DivSample* sample=song.sample[i];
w->writeC(0x67);
w->writeC(0x66);
w->writeC(8);
w->writeI(sample->length8);
for (unsigned int j=0; j<sample->length8; j++) {
w->writeC(sample->data8[j]);
}
}

for (int i=0; i<2; i++) {
// SegaPCM
if (writeSegaPCM[i]!=NULL && writeSegaPCM[i]->getSampleMemUsage(0)>0) {
Expand Down Expand Up @@ -2550,7 +2561,7 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p

w->writeC(0x91);
w->writeC(streamID);
w->writeC(0);
w->writeC(8);
w->writeC(1);
w->writeC(0);

Expand Down

0 comments on commit 3c892ad

Please sign in to comment.