mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-23 21:15:11 +00:00
VGM export: fix song end effect hang
This commit is contained in:
parent
8e17f20de2
commit
1f6d44b29a
1 changed files with 13 additions and 3 deletions
|
@ -977,7 +977,7 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop) {
|
||||||
writeLoop=true;
|
writeLoop=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nextTick()) {
|
if (nextTick() || !playing) {
|
||||||
done=true;
|
done=true;
|
||||||
if (!loop) {
|
if (!loop) {
|
||||||
for (int i=0; i<song.systemLen; i++) {
|
for (int i=0; i<song.systemLen; i++) {
|
||||||
|
@ -991,6 +991,11 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop) {
|
||||||
w->writeC(i);
|
w->writeC(i);
|
||||||
loopSample[i]=-1;
|
loopSample[i]=-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!playing) {
|
||||||
|
writeLoop=false;
|
||||||
|
loopPos=-1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// get register dumps
|
// get register dumps
|
||||||
for (int i=0; i<song.systemLen; i++) {
|
for (int i=0; i<song.systemLen; i++) {
|
||||||
|
@ -1126,8 +1131,13 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop) {
|
||||||
w->writeI(gd3Off-0x14);
|
w->writeI(gd3Off-0x14);
|
||||||
w->writeI(tickCount);
|
w->writeI(tickCount);
|
||||||
if (loop) {
|
if (loop) {
|
||||||
w->writeI(loopPos-0x1c);
|
if (loopPos==-1) {
|
||||||
w->writeI(tickCount-loopTick-1);
|
w->writeI(0);
|
||||||
|
w->writeI(0);
|
||||||
|
} else {
|
||||||
|
w->writeI(loopPos-0x1c);
|
||||||
|
w->writeI(tickCount-loopTick-1);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
w->writeI(0);
|
w->writeI(0);
|
||||||
w->writeI(0);
|
w->writeI(0);
|
||||||
|
|
Loading…
Reference in a new issue