- embedded the default OPN bank directly in the binary so that it works, even if no custom bank is set.

This commit is contained in:
Christoph Oelckers 2020-01-04 17:14:09 +01:00
parent c4fc5789b9
commit fb0d3ac183
3 changed files with 1559 additions and 3 deletions

1556
source/data/xg.h Normal file

File diff suppressed because it is too large Load diff

BIN
source/data/xg.wopn Normal file

Binary file not shown.

View file

@ -80,6 +80,7 @@ enum
// OPNMIDIDevice Constructor
//
//==========================================================================
#include "data/xg.h"
OPNMIDIDevice::OPNMIDIDevice(const char *bank)
:SoftSynthMIDIDevice(44100)
@ -91,10 +92,9 @@ OPNMIDIDevice::OPNMIDIDevice(const char *bank)
{
if(opnConfig.default_bank.size() == 0)
{
opn2_close(Renderer);
throw std::runtime_error("No OPN bank found");
opn2_openBankData(Renderer, xg_default, 62080);
}
opn2_openBankData(Renderer, opnConfig.default_bank.data(), (long)opnConfig.default_bank.size());
else opn2_openBankData(Renderer, opnConfig.default_bank.data(), (long)opnConfig.default_bank.size());
}
opn2_switchEmulator(Renderer, (int)opnConfig.opn_emulator_id);