VGM export: write Hz when appropriate

This commit is contained in:
tildearrow 2023-04-20 04:16:56 -05:00
parent 6ec9696a50
commit c8df7084f4
1 changed files with 4 additions and 0 deletions

View File

@ -1068,6 +1068,7 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p
bool trailing=false;
bool beenOneLoopAlready=false;
bool mayWriteRate=(fmod(curSubSong->hz,1.0)<0.00001 || fmod(curSubSong->hz,1.0)>0.99999);
int countDown=MAX(0,trailingTicks)+1;
for (int i=0; i<DIV_MAX_CHANS; i++) {
@ -2359,6 +2360,9 @@ SafeWriter* DivEngine::saveVGM(bool* sysToExport, bool loop, int version, bool p
w->writeI(0);
w->writeI(0);
}
if (mayWriteRate) {
w->writeI(round(curSubSong->hz));
}
w->seek(0x34,SEEK_SET);
w->writeI(songOff-0x34);
if (version>=0x170) {