mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-27 15:03:01 +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;
|
||||
}
|
||||
}
|
||||
if (nextTick()) {
|
||||
if (nextTick() || !playing) {
|
||||
done=true;
|
||||
if (!loop) {
|
||||
for (int i=0; i<song.systemLen; i++) {
|
||||
|
@ -991,6 +991,11 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop) {
|
|||
w->writeC(i);
|
||||
loopSample[i]=-1;
|
||||
}
|
||||
|
||||
if (!playing) {
|
||||
writeLoop=false;
|
||||
loopPos=-1;
|
||||
}
|
||||
}
|
||||
// get register dumps
|
||||
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(tickCount);
|
||||
if (loop) {
|
||||
if (loopPos==-1) {
|
||||
w->writeI(0);
|
||||
w->writeI(0);
|
||||
} else {
|
||||
w->writeI(loopPos-0x1c);
|
||||
w->writeI(tickCount-loopTick-1);
|
||||
}
|
||||
} else {
|
||||
w->writeI(0);
|
||||
w->writeI(0);
|
||||
|
|
Loading…
Reference in a new issue