2
0
Fork 0

Merge pull request #75 from jpcima/sbi

Make the instrument format more compliant to SBI
This commit is contained in:
Bruce Sutherland 2019-05-29 13:46:33 +09:00 committed by GitHub
commit 7fa99fa8fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -552,13 +552,14 @@ void AdlibBlasterAudioProcessor::saveInstrumentToFile(String filename)
};
FILE* f = fopen(filename.toUTF8(), "wb");
if (f) {
fwrite("SBI\x1d", 1, 4, f);
fwrite("SBI\x1a", 1, 4, f);
fwrite("JuceOPLVSTi instrument \0", 1, 32, f);
for (int i = 0; i < 11; i++) {
Bit8u regVal = Opl->_ReadReg(sbi_registers[i]);
fwrite(&regVal, 1, 1, f);
}
fwrite(" ", 1, 5, f);
char padding[5] = { 0x00, 0x00, 0x00, 0x00, 0x00 };
fwrite(padding, 1, 5, f);
fclose(f);
}
}