VGM export: improvements

- use shorthand command for waiting at 50/60Hz
- don't write stream rate change if DAC is off
This commit is contained in:
tildearrow 2022-02-06 16:47:12 -05:00
parent 28a7348863
commit d0457a2e1b
2 changed files with 9 additions and 3 deletions

View File

@ -3960,8 +3960,14 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop) {
}
// write wait
if (totalWait>0) {
w->writeC(0x61);
w->writeS(totalWait);
if (totalWait==735) {
w->writeC(0x62);
} else if (totalWait==882) {
w->writeC(0x63);
} else {
w->writeC(0x61);
w->writeS(totalWait);
}
tickCount+=totalWait;
}
if (writeLoop) {

View File

@ -292,7 +292,7 @@ void DivPlatformGenesis::tick() {
int freqt=toFreq(chan[i].freq);
immWrite(chanOffs[i]+ADDR_FREQH,freqt>>8);
immWrite(chanOffs[i]+ADDR_FREQ,freqt&0xff);
if (chan[i].furnaceDac) {
if (chan[i].furnaceDac && dacMode) {
double off=1.0;
if (dacSample>=0 && dacSample<parent->song.sampleLen) {
DivSample* s=parent->song.sample[dacSample];