VGM export: fix it under low-latency mode

This commit is contained in:
tildearrow 2022-04-15 22:27:44 -05:00
parent b48a2368be
commit 6b294933bc
3 changed files with 4 additions and 4 deletions

View File

@ -271,7 +271,7 @@ class DivEngine {
void nextRow();
void performVGMWrite(SafeWriter* w, DivSystem sys, DivRegWrite& write, int streamOff, double* loopTimer, double* loopFreq, int* loopSample, bool isSecond);
// returns true if end of song.
bool nextTick(bool noAccum=false);
bool nextTick(bool noAccum=false, bool inhibitLowLat=false);
bool perSystemEffect(int ch, unsigned char effect, unsigned char effectVal);
bool perSystemPostEffect(int ch, unsigned char effect, unsigned char effectVal);
void recalcChans();

View File

@ -1472,11 +1472,11 @@ void DivEngine::nextRow() {
firstTick=true;
}
bool DivEngine::nextTick(bool noAccum) {
bool DivEngine::nextTick(bool noAccum, bool inhibitLowLat) {
bool ret=false;
if (divider<10) divider=10;
if (lowLatency && !skipping) {
if (lowLatency && !skipping && !inhibitLowLat) {
tickMult=1000/divider;
if (tickMult<1) tickMult=1;
} else {

View File

@ -1384,7 +1384,7 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version) {
writeLoop=true;
}
}
if (nextTick() || !playing) {
if (nextTick(false,true) || !playing) {
done=true;
if (!loop) {
for (int i=0; i<song.systemLen; i++) {