From f67ca1ba4704d450a4a2b3139da46da135122c0e Mon Sep 17 00:00:00 2001 From: athrxx Date: Tue, 15 Apr 2014 14:30:32 +0200 Subject: AUDIO: (FM-TOWNS) - remove wave memory limit (This is basically an unnecessary emulation of a hardware limitation. EOB II will try to load approximately 70 KByte of samples for the outro sequence, which would lead to some missing sounds with the 64 Kbyte limit). --- audio/softsynth/fmtowns_pc98/towns_audio.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'audio/softsynth/fmtowns_pc98') diff --git a/audio/softsynth/fmtowns_pc98/towns_audio.cpp b/audio/softsynth/fmtowns_pc98/towns_audio.cpp index 2506e02c2b..7d61631936 100644 --- a/audio/softsynth/fmtowns_pc98/towns_audio.cpp +++ b/audio/softsynth/fmtowns_pc98/towns_audio.cpp @@ -728,7 +728,11 @@ int TownsAudioInterfaceInternal::intf_loadSamples(va_list &args) { if (dest >= 65536 || size == 0 || size > 65536) return 3; if (size + dest > 65536) - return 5; + // EOB II FM-TOWNS tries to load more than 65536 bytes of wave sounds for the outro sequence. + // This means that some sfx would not play. Since we don't really need the memory limit, + // I have commented out the error return and added a warning instead. + warning("FM-TOWNS AUDIO: exceeding wave memory size by %d bytes", size + dest - 65536); + // return 5; int dwIndex = _numWaveTables - 1; for (uint32 t = _waveTablesTotalDataSize; dwIndex && (dest < t); dwIndex--) @@ -796,9 +800,13 @@ int TownsAudioInterfaceInternal::intf_loadWaveTable(va_list &args) { s->readHeader(data); _waveTablesTotalDataSize += s->size; - callback(32, _waveTablesTotalDataSize, s->size, data + 32); + int res = callback(32, _waveTablesTotalDataSize, s->size, data + 32); + if (res) { + _waveTablesTotalDataSize -= s->size; + _numWaveTables--; + } - return 0; + return res; } int TownsAudioInterfaceInternal::intf_unloadWaveTable(va_list &args) { -- cgit v1.2.3