public void LoadSection(byte section)
{
FnStopFx();
_mixer.StopAll();
_soundData = _skyDisk.LoadFile(section * 4 + SoundFileBase);
ushort asmOfs;
if (SystemVars.Instance.GameVersion.Version.Minor == 109)
{
if (section == 0)
asmOfs = 0x78;
else
asmOfs = 0x7C;
}
else
asmOfs = 0x7E;
if ((_soundData[asmOfs] != 0x3C) || (_soundData[asmOfs + 0x27] != 0x8D) ||
(_soundData[asmOfs + 0x28] != 0x1E) || (_soundData[asmOfs + 0x2F] != 0x8D) ||
(_soundData[asmOfs + 0x30] != 0x36))
throw new NotSupportedException("Unknown sounddriver version");
_soundsTotal = _soundData[asmOfs + 1];
var sRateTabOfs = _soundData.ToUInt16(asmOfs + 0x29);
_sfxBaseOfs = _soundData.ToUInt16(asmOfs + 0x31);
_sampleRates = new ByteAccess(_soundData, sRateTabOfs);
_sfxInfo = new UShortAccess(_soundData, _sfxBaseOfs);
// if we just restored a savegame, the sfxqueue holds the sound we need to restart
if (!SystemVars.Instance.SystemFlags.HasFlag(SystemFlags.GameRestored))
for (var cnt = 0; cnt < MaxQueuedFx; cnt++)
SfxQueue[cnt].Count = 0;
}