Merge pull request #499 from superctr/220527_blocksize

Save the size of each block in a Furnace module
This commit is contained in:
tildearrow 2022-06-29 01:54:05 -05:00 committed by GitHub
commit b99dce5362
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 7 deletions

View file

@ -24,7 +24,10 @@
#include "../fileutils.h"
void DivInstrument::putInsData(SafeWriter* w) {
size_t blockStartSeek, blockEndSeek;
w->write("INST",4);
blockStartSeek=w->tell();
w->writeI(0);
w->writeS(DIV_ENGINE_VERSION);
@ -520,6 +523,11 @@ void DivInstrument::putInsData(SafeWriter* w) {
for (int j=0; j<23; j++) { // reserved
w->writeC(0);
}
blockEndSeek=w->tell();
w->seek(blockStartSeek,SEEK_SET);
w->writeI(blockEndSeek-blockStartSeek-4);
w->seek(0,SEEK_END);
}
DivDataErrors DivInstrument::readInsData(SafeReader& reader, short version) {