diff options
author | Jerome Fisher | 2004-11-29 01:05:15 +0000 |
---|---|---|
committer | Jerome Fisher | 2004-11-29 01:05:15 +0000 |
commit | e61e0f27a0161da2068b2ed8f14034158e4bff9c (patch) | |
tree | f2f72da866cc00bd7d189bd41824fa226d2bb754 /backends | |
parent | 8f863b5d8ffeeefd75d9937eeafcc77db5923ba3 (diff) | |
download | scummvm-rg350-e61e0f27a0161da2068b2ed8f14034158e4bff9c.tar.gz scummvm-rg350-e61e0f27a0161da2068b2ed8f14034158e4bff9c.tar.bz2 scummvm-rg350-e61e0f27a0161da2068b2ed8f14034158e4bff9c.zip |
- Now actually read and write the 4 bytes of tuning frequency info in the header.
svn-id: r15961
Diffstat (limited to 'backends')
-rw-r--r-- | backends/midi/mt32/tables.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/backends/midi/mt32/tables.cpp b/backends/midi/mt32/tables.cpp index 3d0ab5ea45..4a17165733 100644 --- a/backends/midi/mt32/tables.cpp +++ b/backends/midi/mt32/tables.cpp @@ -594,7 +594,7 @@ bool TableInitialiser::initNotes(Synth *synth, PCMWaveEntry pcmWaves[128], float }; char filename[64]; int intRate = (int)rate; - char version[4] = {0, 0, 0, 2}; + char version[4] = {0, 0, 0, 3}; sprintf(filename, "waveformcache-%d-%.2f.raw", intRate, masterTune); File *file = NULL; @@ -617,9 +617,9 @@ bool TableInitialiser::initNotes(Synth *synth, PCMWaveEntry pcmWaves[128], float bool reading = false; file = synth->openFile(filename, File::OpenMode_read); if (file != NULL) { - char fileHeader[16]; - if (file->read(fileHeader, 16) == 16) { - if (memcmp(fileHeader, header, 16) == 0) { + char fileHeader[20]; + if (file->read(fileHeader, 20) == 20) { + if (memcmp(fileHeader, header, 20) == 0) { Bit16u endianCheck; if (file->readBit16u(&endianCheck)) { if (endianCheck == 1) { @@ -662,7 +662,7 @@ bool TableInitialiser::initNotes(Synth *synth, PCMWaveEntry pcmWaves[128], float if (file == NULL) { file = synth->openFile(filename, File::OpenMode_write); if (file != NULL) { - if (file->write(header, 16) == 16 && file->writeBit16u(1)) { + if (file->write(header, 20) == 20 && file->writeBit16u(1)) { for (int f = 0; f < NUM_NOTES; f++) { for (int i = 0; i < 3 && file != NULL; i++) { int len = noteLookups[f].waveformSize[i]; |