diff --git a/Core/BaseMapper.cpp b/Core/BaseMapper.cpp index ed037e3a..125394e9 100644 --- a/Core/BaseMapper.cpp +++ b/Core/BaseMapper.cpp @@ -13,6 +13,7 @@ #include "EmulationSettings.h" void BaseMapper::WriteRegister(uint16_t addr, uint8_t value) { } +void BaseMapper::WriteEPSG(uint16_t addr, uint8_t value) { _epsgaudio->WriteRegister(addr, value); } uint8_t BaseMapper::ReadRegister(uint16_t addr) { return 0; } void BaseMapper::InitMapper(RomData &romData) { } void BaseMapper::Reset(bool softReset) { } @@ -508,8 +509,9 @@ void BaseMapper::StreamState(bool saving) ArrayInfo chrMemoryType = { _chrMemoryType, 0x40 }; ArrayInfo prgMemoryAccess = { _prgMemoryAccess, 0x100 }; ArrayInfo chrMemoryAccess = { _chrMemoryAccess, 0x40 }; + SnapshotInfo epsgaudio{ _epsgaudio.get() }; - Stream(_mirroringType, chrRam, workRam, saveRam, nametableRam, prgMemoryOffset, chrMemoryOffset, prgMemoryType, chrMemoryType, prgMemoryAccess, chrMemoryAccess); + Stream(_mirroringType, chrRam, workRam, saveRam, nametableRam, prgMemoryOffset, chrMemoryOffset, prgMemoryType, chrMemoryType, prgMemoryAccess, chrMemoryAccess, epsgaudio); if(!saving) { RestorePrgChrState(); @@ -636,6 +638,7 @@ void BaseMapper::Initialize(RomData &romData) InitMapper(); InitMapper(romData); + _epsgaudio.reset(new EPSGAudio(_console)); //Load battery data if present LoadBattery(); @@ -778,6 +781,7 @@ uint8_t BaseMapper::DebugReadRAM(uint16_t addr) void BaseMapper::WriteRAM(uint16_t addr, uint8_t value) { + if(addr == 0x4016){ WriteEPSG(addr, value); } if(_isWriteRegisterAddr[addr]) { if(_hasBusConflicts) { uint8_t prgValue = _prgPages[addr >> 8][(uint8_t)addr]; diff --git a/Core/BaseMapper.h b/Core/BaseMapper.h index af69cff9..06aec97d 100644 --- a/Core/BaseMapper.h +++ b/Core/BaseMapper.h @@ -9,6 +9,8 @@ #include "IBattery.h" #include "RomData.h" #include "Console.h" +#include "CPU.h" +#include "EPSGAudio.h" class BaseControlDevice; @@ -104,6 +106,7 @@ protected: uint8_t InternalReadRam(uint16_t addr); virtual void WriteRegister(uint16_t addr, uint8_t value); + virtual void WriteEPSG(uint16_t addr, uint8_t value); virtual uint8_t ReadRegister(uint16_t addr); void SelectPrgPage4x(uint16_t slot, uint16_t page, PrgMemoryType memoryType = PrgMemoryType::PrgRom); @@ -155,7 +158,7 @@ protected: public: static constexpr uint32_t NametableCount = 0x10; static constexpr uint32_t NametableSize = 0x400; - + unique_ptr _epsgaudio; void Initialize(RomData &romData); virtual ~BaseMapper(); @@ -165,6 +168,7 @@ public: virtual void SetNesModel(NesModel model) { } virtual void ProcessCpuClock() { } + virtual void ProcessEPSGClock() { _epsgaudio->Clock(); } virtual void NotifyVRAMAddressChange(uint16_t addr); virtual void GetMemoryRanges(MemoryRanges &ranges) override; diff --git a/Core/Console.cpp b/Core/Console.cpp index dc0c8aef..bcf59440 100644 --- a/Core/Console.cpp +++ b/Core/Console.cpp @@ -465,6 +465,7 @@ bool Console::Initialize(VirtualFile &romFile, VirtualFile &patchFile, bool forP void Console::ProcessCpuClock() { + _mapper->ProcessEPSGClock(); _mapper->ProcessCpuClock(); _apu->ProcessCpuClock(); } diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index f3abf2e2..30bd4148 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -1,4 +1,4 @@ - + @@ -558,6 +558,8 @@ + + @@ -586,12 +588,14 @@ + + @@ -982,6 +986,7 @@ + @@ -996,6 +1001,7 @@ + @@ -1016,6 +1022,7 @@ + @@ -1098,6 +1105,7 @@ + diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters index 135b29fe..dc4fa6b9 100644 --- a/Core/Core.vcxproj.filters +++ b/Core/Core.vcxproj.filters @@ -1,4 +1,4 @@ - + @@ -116,6 +116,9 @@ {13af8497-e820-43f1-9888-85797a29b551} + + {c9c48ea8-7684-4959-9266-c0b4f0f86956} + @@ -1502,6 +1505,21 @@ Nes\Input\Controllers + + Nes\Mappers\EPSG + + + Nes\Mappers\EPSG + + + Nes\Mappers + + + Nes\Mappers\VRC + + + Nes\Mappers\EPSG + @@ -1804,5 +1822,14 @@ Misc + + Nes\Mappers\EPSG + + + Nes\Mappers\VRC + + + Nes\Mappers\EPSG + \ No newline at end of file diff --git a/Core/EPSGAudio.h b/Core/EPSGAudio.h new file mode 100644 index 00000000..bf15af3e --- /dev/null +++ b/Core/EPSGAudio.h @@ -0,0 +1,195 @@ +#pragma once +#include "stdafx.h" +#include "Snapshotable.h" +#include "APU.h" +#include "BaseExpansionAudio.h" +#include "SSGAudio.h" +#include "Console.h" + +#include +#include "ym3438.h" + +using EPSGSSGAudio = SSGAudio; + +class EPSGAudio : public EPSGSSGAudio +{ +private: + ym3438_t _chip; + + int16_t _lastOutputs[2]; + int16_t _currentOutputs[2]; + uint8_t writeValue; + int16_t writeAddr; + + double _clock; + + static constexpr uint8_t cycleCount = 24; + + struct InputEntry + { + uint8_t addr = 0; + uint8_t data = 0; + uint8_t cycle = 0; + uint8_t wrote = 0; + }; + + static constexpr uint8_t INPUT_BUFFER_SIZE = cycleCount; + using InputBuffer = std::array; + InputBuffer _inputBuffer; + + void UpdateOutputLevel() + { + int16_t summedOutput = 0; + for (size_t x = 0; x < 2; x++) + { + _console->GetApu()->AddExpansionAudioDelta(x == 0 ? AudioChannel::EPSG_L : AudioChannel::EPSG_R, _currentOutputs[x] - _lastOutputs[x]); + _lastOutputs[x] = _currentOutputs[x]; + } + } + + uint8_t GetCurrentCycle() const + { + return static_cast(std::floor(_clock)) % cycleCount; + } + + void WriteToChip(uint8_t a, uint8_t d) + { + const auto cycle = GetCurrentCycle(); + + if (_inputBuffer[cycle].wrote) + { + std::cout << "EPSG CHIP DOUBLE WRITE" << std::endl; + } + + _inputBuffer[cycle] = { + a, + d, + cycle, + true + }; + } + + uint32_t getClockFrequency() + { + return _console->GetSettings()->GetEPSGClockFrequency() / 6; + } + +protected: + void StreamState(bool saving) override + { + EPSGSSGAudio::StreamState(saving); + + ArrayInfo lastOutputs{ _lastOutputs, 2 }; + ArrayInfo currentOutputs{ _currentOutputs, 2 }; + ArrayInfo inputBuffer{ &_inputBuffer }; + ValueInfo chip{ &_chip }; + ValueInfo clock { &_clock }; + Stream(lastOutputs, currentOutputs, inputBuffer, chip, clock); + } + + void ClockAudio() override + { + EPSGSSGAudio::ClockAudio(); + + _clock += getClockFrequency() / (double)_console->GetCpu()->GetClockRate(_console->GetModel()); + + while (_clock >= cycleCount) + { + for (uint8_t x = 0; x < 2; x++) + { + _currentOutputs[x] = 0; + } + + for (uint8_t cycle = 0; cycle < cycleCount; cycle++) + { + _clock--; + + int16_t samples[2]; + OPN2_Clock(&_chip, samples); + + for (uint8_t x = 0; x < 2; x++) + { + _currentOutputs[x] += samples[x]; + } + + auto& input = _inputBuffer[cycle]; + if(input.wrote) + { + input.wrote = false; + + OPN2_Write(&_chip, input.addr, input.data); + } + } + + for (uint8_t x = 0; x < 2; x++) + { + _currentOutputs[x] /= 12; + } + + UpdateOutputLevel(); + } + } + + virtual uint32_t GetSSGClockFrequency() + { + return EPSGSSGAudio::GetSSGClockFrequency() * (_console->GetSettings()->GetEPSGClockFrequency() / 3579545.0 ); + } + +public: + EPSGAudio(shared_ptr console) : EPSGSSGAudio(console) + { + memset(_lastOutputs, 0, sizeof(_lastOutputs)); + memset(_currentOutputs, 0, sizeof(_currentOutputs)); + _inputBuffer = {}; + + _clock = 0; + + OPN2_Reset(&_chip); + OPN2_SetChipType(0); + } + + void WriteRegister(uint16_t addr, uint8_t value) + { + EPSGSSGAudio::WriteRegister(addr, value); + + if (addr == 0x4016) { + if ((value & 0x0F) == 0x02) { + writeValue = value; + writeAddr = 0xC000; + } + if ((value & 0x0F) == 0x0A) { + writeValue = value; + writeAddr = 0xE000; + } + if ((value & 0x0F) == 0x06) { + writeValue = value; + writeAddr = 0xC002; + } + if ((value & 0x0F) == 0x0E) { + writeValue = value; + writeAddr = 0xE002; + } + if ((value & 0x0F) == 0x00) { + writeValue = (writeValue & 0xF0) | (value >> 4); + + const uint8_t a04016 = (writeAddr & 0xF000) == 0xE000; + const uint8_t a14016 = !!(writeAddr & 0xF); + WriteToChip(a04016 | (a14016 << 1), writeValue); + } + } + + switch(addr) { + case 0xC000: + case 0xE000: + case 0xC002: + case 0xE002: + + const uint8_t a0 = (addr & 0xF000) == 0xE000; + const uint8_t a1 = !!(addr & 0xF); + + WriteToChip(a0 | (a1 << 1), value); + + break; + } + } +}; \ No newline at end of file diff --git a/Core/EmulationSettings.h b/Core/EmulationSettings.h index 018b0289..25160a9a 100644 --- a/Core/EmulationSettings.h +++ b/Core/EmulationSettings.h @@ -116,7 +116,9 @@ enum class AudioChannel VRC6 = 7, VRC7 = 8, Namco163 = 9, - Sunsoft5B = 10 + Sunsoft5B = 10, + EPSG_L = 11, + EPSG_R = 12, }; enum class EqualizerFilterType @@ -657,8 +659,9 @@ private: bool _audioSettingsChanged = false; uint32_t _audioLatency = 50; - double _channelVolume[11] = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }; - double _channelPanning[11] = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }; + uint32_t _EPSGClockFrequency = 3579545; + double _channelVolume[13] = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }; + double _channelPanning[13] = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 2.0 }; EqualizerFilterType _equalizerFilterType = EqualizerFilterType::None; vector _bandGains = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; vector _bands = { { 40,56,80,113,160,225,320,450,600,750,1000,2000,3000,4000,5000,6000,7000,10000,12500,15000 } }; @@ -987,6 +990,12 @@ public: _audioSettingsChanged = true; } + void SetEPSGClockFrequency(uint32_t clockFrequency) + { + _EPSGClockFrequency = clockFrequency; + _audioSettingsChanged = true; + } + void SetAudioFilterSettings(AudioFilterSettings settings) { _audioFilterSettings = settings; @@ -1158,6 +1167,11 @@ public: return _audioLatency; } + uint32_t GetEPSGClockFrequency() + { + return _EPSGClockFrequency; + } + void SetVideoFilterType(VideoFilterType videoFilterType) { _videoFilterType = videoFilterType; diff --git a/Core/MMC3.h b/Core/MMC3.h index f47926fa..8e2cb724 100644 --- a/Core/MMC3.h +++ b/Core/MMC3.h @@ -6,8 +6,10 @@ #include "EmulationSettings.h" #include "A12Watcher.h" + class MMC3 : public BaseMapper { + private: enum class MMC3Registers { @@ -200,6 +202,7 @@ class MMC3 : public BaseMapper virtual void InitMapper() override { + //Force MMC3A irqs for boards that are known to use the A revision. //Some MMC3B boards also have the A behavior, but currently no way to tell them apart. _forceMmc3RevAIrqs = _romInfo.DatabaseInfo.Chip.substr(0, 5).compare("MMC3A") == 0; diff --git a/Core/MemoryManager.cpp b/Core/MemoryManager.cpp index 809d8b0d..c5907390 100644 --- a/Core/MemoryManager.cpp +++ b/Core/MemoryManager.cpp @@ -133,6 +133,9 @@ void MemoryManager::Write(uint16_t addr, uint8_t value, MemoryOperationType oper { if(_console->DebugProcessRamOperation(operationType, addr, value)) { _ramWriteHandlers[addr]->WriteRAM(addr, value); + if (addr == 0x4016) { + _ramWriteHandlers[0xE000]->WriteRAM(addr, value); + } } } diff --git a/Core/NsfLoader.cpp b/Core/NsfLoader.cpp index 021e36a5..dac9ef80 100644 --- a/Core/NsfLoader.cpp +++ b/Core/NsfLoader.cpp @@ -87,9 +87,12 @@ void NsfLoader::InitializeFromHeader(RomData &romData) if(header.SoundChips & 0x10) { chips.push_back("Namco 163"); } - if(header.SoundChips & 0x20) { + if (header.SoundChips & 0x20) { chips.push_back("Sunsoft 5B"); } + if (header.SoundChips & 0x40) { + chips.push_back("EPSG"); + } if(chips.empty()) { chips.push_back(""); } diff --git a/Core/NsfMapper.cpp b/Core/NsfMapper.cpp index c1928bac..00cb1a76 100644 --- a/Core/NsfMapper.cpp +++ b/Core/NsfMapper.cpp @@ -27,6 +27,7 @@ void NsfMapper::InitMapper() _fdsAudio.reset(new FdsAudio(_console)); _namcoAudio.reset(new Namco163Audio(_console)); _sunsoftAudio.reset(new Sunsoft5bAudio(_console)); + _epsgAudio.reset(new EPSGAudio(_console)); SetCpuMemoryMapping(0x3F00, 0x3FFF, PrgMemoryType::WorkRam, 0x2000, MemoryAccessType::Read); memcpy(GetWorkRam() + 0x2000, _nsfBios, 0x100); @@ -107,6 +108,10 @@ void NsfMapper::InitMapper(RomData& romData) if(_nsfHeader.SoundChips & NsfSoundChips::FDS) { AddRegisterRange(0x4040, 0x4092, MemoryOperation::Any); } + + if(_nsfHeader.SoundChips & NsfSoundChips::EPSG) { + AddRegisterRange(0x4016, 0x4016, MemoryOperation::Write); + } } void NsfMapper::Reset(bool softReset) @@ -272,6 +277,9 @@ void NsfMapper::ProcessCpuClock() if(_nsfHeader.SoundChips & NsfSoundChips::FDS) { _fdsAudio->Clock(); } + if (_nsfHeader.SoundChips & NsfSoundChips::EPSG) { + _epsgAudio->Clock(); + } } uint8_t NsfMapper::ReadRegister(uint16_t addr) @@ -397,7 +405,11 @@ void NsfMapper::WriteRegister(uint16_t addr, uint8_t value) break; case 0x9010: case 0x9030: - _vrc7Audio->WriteReg(addr, value); + _vrc7Audio->WriteRegister(addr, value); + break; + + case 0x4016: + _epsgAudio->WriteRegister(addr, value); break; } @@ -478,10 +490,11 @@ void NsfMapper::StreamState(bool saving) SnapshotInfo fdsAudio { _fdsAudio.get() }; SnapshotInfo namcoAudio { _namcoAudio.get() }; SnapshotInfo sunsoftAudio { _sunsoftAudio.get() }; + SnapshotInfo epsgAudio{ _epsgAudio.get() }; Stream( _model, _needInit, _irqEnabled, _irqReloadValue, _irqCounter, _irqStatus, _debugIrqStatus, _mmc5MultiplierValues[0], _mmc5MultiplierValues[1], _trackEndCounter, _trackFadeCounter, _fadeLength, _silenceDetectDelay, _trackEnded, _allowSilenceDetection, _hasBankSwitching, _ntscSpeed, - _palSpeed, _dendySpeed, _songNumber, mmc5Audio, vrc6Audio, vrc7Audio, fdsAudio, namcoAudio, sunsoftAudio + _palSpeed, _dendySpeed, _songNumber, mmc5Audio, vrc6Audio, vrc7Audio, fdsAudio, namcoAudio, sunsoftAudio, epsgAudio ); } \ No newline at end of file diff --git a/Core/NsfMapper.h b/Core/NsfMapper.h index 4ead0475..ce7198b5 100644 --- a/Core/NsfMapper.h +++ b/Core/NsfMapper.h @@ -6,6 +6,7 @@ #include "FdsAudio.h" #include "Namco163Audio.h" #include "Sunsoft5bAudio.h" +#include "EPSGAudio.h" enum class NsfIrqType { @@ -25,7 +26,8 @@ private: FDS = 0x04, MMC5 = 0x08, Namco = 0x10, - Sunsoft = 0x20 + Sunsoft = 0x20, + EPSG = 0x40 }; NesModel _model; @@ -37,6 +39,7 @@ private: unique_ptr _fdsAudio; unique_ptr _namcoAudio; unique_ptr _sunsoftAudio; + unique_ptr _epsgAudio; bool _needInit = false; bool _irqEnabled = false; diff --git a/Core/SSGAudio.h b/Core/SSGAudio.h new file mode 100644 index 00000000..b7fc3d87 --- /dev/null +++ b/Core/SSGAudio.h @@ -0,0 +1,145 @@ +#pragma once +#include "stdafx.h" +#include "Snapshotable.h" +#include "APU.h" +#include "BaseExpansionAudio.h" +#include "Console.h" + + +template +class SSGAudio : public BaseExpansionAudio +{ +private: + uint8_t _volumeLut[0x10]; + uint8_t _currentRegister; + uint8_t _registers[0x10]; + int16_t _lastOutput; + int16_t _timer[3]; + uint8_t _toneStep[3]; + double _clock; + bool _processTick; + + uint16_t GetPeriod(int channel) + { + return _registers[channel * 2] | (_registers[channel * 2 + 1] << 8); + } + + uint16_t GetEnvelopePeriod() + { + return _registers[0x0B] | (_registers[0x0C] << 8); + } + + uint8_t GetNoisePeriod() + { + return _registers[6]; + } + + uint8_t GetVolume(int channel) + { + return _volumeLut[_registers[8 + channel] & 0x0F]; + } + + bool IsEnvelopeEnabled(int channel) + { + return (_registers[8 + channel] & 0x10) == 0x10; + } + + bool IsToneEnabled(int channel) + { + return ((_registers[7] >> channel) & 0x01) == 0x00; + } + + bool IsNoiseEnabled(int channel) + { + return ((_registers[7] >> (channel + 3)) & 0x01) == 0x00; + } + + void UpdateChannel(int channel) + { + _timer[channel]--; + if(_timer[channel] <= 0) { + _timer[channel] = GetPeriod(channel); + _toneStep[channel] = (_toneStep[channel] + 1) & 0x0F; + } + } + + void UpdateOutputLevel() + { + int16_t summedOutput = 0; + for(int i = 0; i < 3; i++) { + if(IsToneEnabled(i) && _toneStep[i] < 0x08) { + summedOutput += GetVolume(i); + } + } + + const auto delta = (summedOutput - _lastOutput); + (_console->GetApu()->AddExpansionAudioDelta(channels, summedOutput - _lastOutput), ...); + _lastOutput = summedOutput; + } + +protected: + void StreamState(bool saving) override + { + BaseExpansionAudio::StreamState(saving); + + ArrayInfo timer{ _timer, 3 }; + ArrayInfo registers{ _registers, 0x10 }; + ArrayInfo toneStep{ _toneStep, 3 }; + Stream(timer, registers, toneStep, _currentRegister, _lastOutput, _clock); + } + + void ClockAudio() override + { + _clock += GetSSGClockFrequency() / (double)_console->GetCpu()->GetClockRate(_console->GetModel()); + + while (_clock >= 1) + { + for (int i = 0; i < 3; i++) { + UpdateChannel(i); + } + + _clock--; + UpdateOutputLevel(); + } + } + + virtual uint32_t GetSSGClockFrequency() + { + return _console->GetCpu()->GetClockRate(_console->GetModel()) / 2; + } + +public: + SSGAudio(shared_ptr console) : BaseExpansionAudio(console) + { + memset(_timer, 0, sizeof(_timer)); + memset(_registers, 0, sizeof(_registers)); + memset(_toneStep, 0, sizeof(_toneStep)); + _currentRegister = 0; + _lastOutput = 0; + _clock = 0; + + double output = 1.0; + _volumeLut[0] = 0; + for(int i = 1; i < 0x10; i++) { + //+1.5 dB 2x for every 1 step in volume + output *= 1.1885022274370184377301224648922; + output *= 1.1885022274370184377301224648922; + + _volumeLut[i] = (uint8_t)output; + } + } + + void WriteRegister(uint16_t addr, uint8_t value) + { + switch(addr) { + case 0xC000: + _currentRegister = value; + break; + + case 0xE000: + if(_currentRegister <= 0xF) + _registers[_currentRegister] = value; + break; + } + } +}; \ No newline at end of file diff --git a/Core/SoundMixer.cpp b/Core/SoundMixer.cpp index b05899bb..95313274 100644 --- a/Core/SoundMixer.cpp +++ b/Core/SoundMixer.cpp @@ -266,7 +266,18 @@ int16_t SoundMixer::GetOutputVolume(bool forRightChannel) GetChannelOutput(AudioChannel::Namco163, forRightChannel) * 20 + GetChannelOutput(AudioChannel::Sunsoft5B, forRightChannel) * 15 + GetChannelOutput(AudioChannel::VRC6, forRightChannel) * 75 + - GetChannelOutput(AudioChannel::VRC7, forRightChannel)); +#ifndef VRC7_USE_OLD_EMU +#define VRC7_USE_NUKED +#endif + +#ifdef VRC7_USE_NUKED + GetChannelOutput(AudioChannel::VRC7, forRightChannel) * 12 + +#else + GetChannelOutput(AudioChannel::VRC7, forRightChannel) + +#endif + GetChannelOutput(AudioChannel::EPSG_L, forRightChannel) * 15 + + GetChannelOutput(AudioChannel::EPSG_R, forRightChannel) * 15 + ); } void SoundMixer::AddDelta(AudioChannel channel, uint32_t time, int16_t delta) diff --git a/Core/SoundMixer.h b/Core/SoundMixer.h index 2bf2135a..61a06541 100644 --- a/Core/SoundMixer.h +++ b/Core/SoundMixer.h @@ -30,7 +30,7 @@ public: private: static constexpr uint32_t MaxSampleRate = 96000; static constexpr uint32_t MaxSamplesPerFrame = MaxSampleRate / 60 * 4 * 2; //x4 to allow CPU overclocking up to 10x, x2 for panning stereo - static constexpr uint32_t MaxChannelCount = 11; + static constexpr uint32_t MaxChannelCount = 13; IAudioDevice* _audioDevice; EmulationSettings* _settings; diff --git a/Core/Sunsoft5bAudio.h b/Core/Sunsoft5bAudio.h index 93ddbae8..b78c67b7 100644 --- a/Core/Sunsoft5bAudio.h +++ b/Core/Sunsoft5bAudio.h @@ -2,130 +2,7 @@ #include "stdafx.h" #include "Snapshotable.h" #include "APU.h" -#include "BaseExpansionAudio.h" +#include "SSGAudio.h" #include "Console.h" -class Sunsoft5bAudio : public BaseExpansionAudio -{ -private: - uint8_t _volumeLut[0x10]; - uint8_t _currentRegister; - uint8_t _registers[0x10]; - int16_t _lastOutput; - int16_t _timer[3]; - uint8_t _toneStep[3]; - bool _processTick; - - uint16_t GetPeriod(int channel) - { - return _registers[channel * 2] | (_registers[channel * 2 + 1] << 8); - } - - uint16_t GetEnvelopePeriod() - { - return _registers[0x0B] | (_registers[0x0C] << 8); - } - - uint8_t GetNoisePeriod() - { - return _registers[6]; - } - - uint8_t GetVolume(int channel) - { - return _volumeLut[_registers[8 + channel] & 0x0F]; - } - - bool IsEnvelopeEnabled(int channel) - { - return (_registers[8 + channel] & 0x10) == 0x10; - } - - bool IsToneEnabled(int channel) - { - return ((_registers[7] >> channel) & 0x01) == 0x00; - } - - bool IsNoiseEnabled(int channel) - { - return ((_registers[7] >> (channel + 3)) & 0x01) == 0x00; - } - - void UpdateChannel(int channel) - { - _timer[channel]--; - if(_timer[channel] <= 0) { - _timer[channel] = GetPeriod(channel); - _toneStep[channel] = (_toneStep[channel] + 1) & 0x0F; - } - } - - void UpdateOutputLevel() - { - int16_t summedOutput = 0; - for(int i = 0; i < 3; i++) { - if(IsToneEnabled(i) && _toneStep[i] < 0x08) { - summedOutput += GetVolume(i); - } - } - - _console->GetApu()->AddExpansionAudioDelta(AudioChannel::Sunsoft5B, summedOutput - _lastOutput); - _lastOutput = summedOutput; - } - -protected: - void StreamState(bool saving) override - { - BaseExpansionAudio::StreamState(saving); - - ArrayInfo timer{ _timer, 3 }; - ArrayInfo registers{ _registers, 0x10 }; - ArrayInfo toneStep{ _toneStep, 3 }; - Stream(timer, registers, toneStep, _currentRegister, _lastOutput, _processTick); - } - - void ClockAudio() override - { - if(_processTick) { - for(int i = 0; i < 3; i++) { - UpdateChannel(i); - } - UpdateOutputLevel(); - } - _processTick = !_processTick; - } - -public: - Sunsoft5bAudio(shared_ptr console) : BaseExpansionAudio(console) - { - memset(_timer, 0, sizeof(_timer)); - memset(_registers, 0, sizeof(_registers)); - memset(_toneStep, 0, sizeof(_toneStep)); - _currentRegister = 0; - _lastOutput = 0; - _processTick = false; - - double output = 1.0; - _volumeLut[0] = 0; - for(int i = 1; i < 0x10; i++) { - //+1.5 dB 2x for every 1 step in volume - output *= 1.1885022274370184377301224648922; - output *= 1.1885022274370184377301224648922; - - _volumeLut[i] = (uint8_t)output; - } - } - - void WriteRegister(uint16_t addr, uint8_t value) - { - switch(addr & 0xE000) { - case 0xC000: - _currentRegister = value & 0x0F; - break; - - case 0xE000: - _registers[_currentRegister] = value; - break; - } - } -}; \ No newline at end of file +using Sunsoft5bAudio = SSGAudio; \ No newline at end of file diff --git a/Core/VRC7.h b/Core/VRC7.h index 82bdde03..dae15cda 100644 --- a/Core/VRC7.h +++ b/Core/VRC7.h @@ -63,7 +63,7 @@ protected: UpdatePrgRamAccess(); - _audio->SetMuteAudio((_controlFlags & 0x40) != 0); + //_audio->SetMuteAudio((_controlFlags & 0x40) != 0); } void WriteRegister(uint16_t addr, uint8_t value) override @@ -78,7 +78,7 @@ protected: case 0x8008: SelectPRGPage(1, value & 0x3F); break; case 0x9000: SelectPRGPage(2, value & 0x3F); break; - case 0x9010: case 0x9030: _audio->WriteReg(addr, value); break; + case 0x9010: case 0x9030: _audio->WriteRegister(addr, value); break; case 0xA000: SelectCHRPage(0, value); break; case 0xA008: SelectCHRPage(1, value); break; diff --git a/Core/Vrc7Audio.h b/Core/Vrc7Audio.h index 2f70625c..0c5c6b78 100644 --- a/Core/Vrc7Audio.h +++ b/Core/Vrc7Audio.h @@ -1,3 +1,153 @@ +#pragma once +#include "stdafx.h" +#include "Snapshotable.h" +#include "APU.h" +#include "BaseExpansionAudio.h" +#include "SSGAudio.h" +#include "Console.h" + +#include +#include "opll.h" + + +#ifndef VRC7_USE_OLD_EMU +#define VRC7_USE_NUKED +#endif + +#ifdef VRC7_USE_NUKED +class Vrc7Audio : public BaseExpansionAudio +{ +private: + opll_t _chip; + + int16_t _lastOutput; + int16_t _currentOutput; + + double _clock; + + static constexpr uint8_t cycleCount = 12; + + struct InputEntry + { + uint8_t addr = 0; + uint8_t data = 0; + uint8_t cycle = 0; + uint8_t wrote = 0; + }; + + static constexpr uint8_t INPUT_BUFFER_SIZE = cycleCount; + using InputBuffer = std::array; + InputBuffer _inputBuffer; + + void UpdateOutputLevel() + { + int16_t summedOutput = 0; + _console->GetApu()->AddExpansionAudioDelta(AudioChannel::VRC7, _currentOutput - _lastOutput); + _lastOutput = _currentOutput; + } + + uint8_t GetCurrentCycle() const + { + return static_cast(std::floor(_clock)) % cycleCount; + } + + void WriteToChip(uint8_t a, uint8_t d) + { + const auto cycle = GetCurrentCycle(); + + if (_inputBuffer[cycle].wrote) + { + std::cout << "VRC7 CHIP DOUBLE WRITE" << std::endl; + } + + _inputBuffer[cycle] = { + a, + d, + cycle, + true + }; + } + + uint32_t getClockFrequency() + { + uint32_t vrc7clock = 3579545 / 4; + return vrc7clock; + } + +protected: + void StreamState(bool saving) override + { + + ValueInfo lastOutput{ &_lastOutput }; + ValueInfo currentOutput{ &_currentOutput }; + ArrayInfo inputBuffer{ &_inputBuffer }; + ValueInfo chip{ &_chip }; + ValueInfo clock{ &_clock }; + Stream(lastOutput, currentOutput, inputBuffer, chip, clock); + } + + void ClockAudio() override + { + + _clock += getClockFrequency() / (double)_console->GetCpu()->GetClockRate(_console->GetModel()); + + while (_clock >= cycleCount) + { + + _currentOutput = 0; + + + for (uint8_t cycle = 0; cycle < cycleCount; cycle++) + { + _clock--; + + int32_t samples[2]; + OPLL_Clock(&_chip, samples); + + for (uint8_t x = 0; x < 2; x++) + { + _currentOutput += samples[x]; + } + + auto& input = _inputBuffer[cycle]; + if (input.wrote) + { + input.wrote = false; + + OPLL_Write(&_chip, input.addr, input.data); + } + } + + UpdateOutputLevel(); + } + } + +public: + Vrc7Audio(shared_ptr console) : BaseExpansionAudio(console) + { + _lastOutput = 0; + _currentOutput = 0; + _inputBuffer = {}; + + _clock = 0; + + OPLL_Reset(&_chip, opll_type_ds1001); + } + + void WriteRegister(uint16_t addr, uint8_t value) + { + switch (addr) { + case 0x9010: + case 0x9030: + + const uint8_t a0 = (addr & 0xF030) == 0x9030; + WriteToChip(a0, value); + + break; + } + } +}; +#else #pragma once #include "stdafx.h" #include "BaseExpansionAudio.h" @@ -16,12 +166,12 @@ private: protected: void ClockAudio() override { - if(_clockTimer == 0) { + if (_clockTimer == 0) { _clockTimer = ((double)_console->GetCpu()->GetClockRate(_console->GetModel())) / 49716; } _clockTimer--; - if(_clockTimer <= 0) { + if (_clockTimer <= 0) { int16_t output = _opllEmulator->GetOutput(); _console->GetApu()->AddExpansionAudioDelta(AudioChannel::VRC7, _muted ? 0 : (output - _previousOutput)); _previousOutput = output; @@ -52,15 +202,17 @@ public: _muted = muted; } - void WriteReg(uint16_t addr, uint8_t value) + void WriteRegister(uint16_t addr, uint8_t value) { - switch(addr & 0xF030) { - case 0x9010: - _currentReg = value; - break; - case 0x9030: - _opllEmulator->WriteReg(_currentReg, value); - break; + switch (addr & 0xF030) { + case 0x9010: + _currentReg = value; + break; + case 0x9030: + _opllEmulator->WriteReg(_currentReg, value); + break; } } -}; \ No newline at end of file +}; +#endif + diff --git a/Core/emu2149.cpp b/Core/emu2149.cpp new file mode 100644 index 00000000..41641c79 --- /dev/null +++ b/Core/emu2149.cpp @@ -0,0 +1,375 @@ +/**************************************************************************** + + emu2149.c -- YM2149/AY-3-8910 emulator by Mitsutaka Okazaki 2001-2016 + + 2001 04-28 : Version 1.00beta -- 1st Beta Release. + 2001 08-14 : Version 1.10 + 2001 10-03 : Version 1.11 -- Added PSG_set_quality(). + 2002 03-02 : Version 1.12 -- Removed PSG_init & PSG_close. + 2002 10-13 : Version 1.14 -- Fixed the envelope unit. + 2003 09-19 : Version 1.15 -- Added PSG_setMask and PSG_toggleMask + 2004 01-11 : Version 1.16 -- Fixed the envelope problem where the envelope + frequency register is written before key-on. + 2015 12-13 : Version 1.17 -- Changed own integer types to C99 stdint.h types. + 2016 09-06 : Version 1.20 -- Support per-channel output. + + References: + psg.vhd -- 2000 written by Kazuhiro Tsujikawa. + s_fme7.c -- 1999,2000 written by Mamiya (NEZplug). + ay8910.c -- 1998-2001 Author unknown (MAME). + MSX-Datapack -- 1991 ASCII Corp. + AY-3-8910 data sheet + +*****************************************************************************/ +#include "stdafx.h" +#include +#include +#include +#include "emu2149.h" + +static uint32_t voltbl[2][32] = { + {0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x04, 0x05, 0x06, 0x07, 0x09, + 0x0B, 0x0D, 0x0F, 0x12, + 0x16, 0x1A, 0x1F, 0x25, 0x2D, 0x35, 0x3F, 0x4C, 0x5A, 0x6A, 0x7F, 0x97, + 0xB4, 0xD6, 0xFF, 0xFF}, + {0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x03, 0x05, 0x05, 0x07, 0x07, + 0x0B, 0x0B, 0x0F, 0x0F, + 0x16, 0x16, 0x1F, 0x1F, 0x2D, 0x2D, 0x3F, 0x3F, 0x5A, 0x5A, 0x7F, 0x7F, + 0xB4, 0xB4, 0xFF, 0xFF} +}; + +static uint8_t regmsk[16] = { + 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0x1f, 0x3f, + 0x1f, 0x1f, 0x1f, 0xff, 0xff, 0x0f, 0xff, 0xff +}; + +#define GETA_BITS 24 + +static void +internal_refresh (PSG * psg) +{ + if (psg->quality) + { + psg->base_incr = 1 << GETA_BITS; + psg->realstep = (uint32_t) ((1 << 31) / psg->rate); + psg->psgstep = (uint32_t) ((1 << 31) / (psg->clk / 16)); + psg->psgtime = 0; + } + else + { + psg->base_incr = + (uint32_t) ((double) psg->clk * (1 << GETA_BITS) / (16 * psg->rate)); + } +} + +void +PSG_set_rate (PSG * psg, uint32_t r) +{ + psg->rate = r ? r : 44100; + internal_refresh (psg); +} + +void +PSG_set_quality (PSG * psg, uint32_t q) +{ + psg->quality = q; + internal_refresh (psg); +} + +PSG * +PSG_new (uint32_t c, uint32_t r) +{ + PSG *psg; + + psg = (PSG *) malloc (sizeof (PSG)); + if (psg == NULL) + return NULL; + + PSG_setVolumeMode (psg, EMU2149_VOL_DEFAULT); + psg->clk = c; + psg->rate = r ? r : 44100; + PSG_set_quality (psg, 0); + + return psg; +} + +void +PSG_setVolumeMode (PSG * psg, int type) +{ + switch (type) + { + case 1: + psg->voltbl = voltbl[EMU2149_VOL_YM2149]; + break; + case 2: + psg->voltbl = voltbl[EMU2149_VOL_AY_3_8910]; + break; + default: + psg->voltbl = voltbl[EMU2149_VOL_DEFAULT]; + break; + } +} + +uint32_t +PSG_setMask (PSG *psg, uint32_t mask) +{ + uint32_t ret = 0; + if(psg) + { + ret = psg->mask; + psg->mask = mask; + } + return ret; +} + +uint32_t +PSG_toggleMask (PSG *psg, uint32_t mask) +{ + uint32_t ret = 0; + if(psg) + { + ret = psg->mask; + psg->mask ^= mask; + } + return ret; +} + +void +PSG_reset (PSG * psg) +{ + int i; + + psg->base_count = 0; + + for (i = 0; i < 3; i++) + { + psg->count[i] = 0x1000; + psg->freq[i] = 0; + psg->edge[i] = 0; + psg->volume[i] = 0; + psg->ch_out[i] = 0; + } + + psg->mask = 0; + + for (i = 0; i < 16; i++) + psg->reg[i] = 0; + psg->adr = 0; + + psg->noise_seed = 0xffff; + psg->noise_count = 0x40; + psg->noise_freq = 0; + + psg->env_volume = 0; + psg->env_ptr = 0; + psg->env_freq = 0; + psg->env_count = 0; + psg->env_pause = 1; + + psg->out = 0; + +} + +void +PSG_delete (PSG * psg) +{ + free (psg); +} + +uint8_t +PSG_readIO (PSG * psg) +{ + return (uint8_t) (psg->reg[psg->adr]); +} + +uint8_t +PSG_readReg (PSG * psg, uint32_t reg) +{ + return (uint8_t) (psg->reg[reg & 0x1f]); + +} + +void +PSG_writeIO (PSG * psg, uint32_t adr, uint32_t val) +{ + if (adr & 1) + PSG_writeReg (psg, psg->adr, val); + else + psg->adr = val & 0x1f; +} + +static inline void +update_output (PSG * psg) +{ + + int i, noise; + uint32_t incr; + + psg->base_count += psg->base_incr; + incr = (psg->base_count >> GETA_BITS); + psg->base_count &= (1 << GETA_BITS) - 1; + + /* Envelope */ + psg->env_count += incr; + while (psg->env_count>=0x10000 && psg->env_freq!=0) + { + if (!psg->env_pause) + { + if(psg->env_face) + psg->env_ptr = (psg->env_ptr + 1) & 0x3f ; + else + psg->env_ptr = (psg->env_ptr + 0x3f) & 0x3f; + } + + if (psg->env_ptr & 0x20) /* if carry or borrow */ + { + if (psg->env_continue) + { + if (psg->env_alternate^psg->env_hold) psg->env_face ^= 1; + if (psg->env_hold) psg->env_pause = 1; + psg->env_ptr = psg->env_face?0:0x1f; + } + else + { + psg->env_pause = 1; + psg->env_ptr = 0; + } + } + + psg->env_count -= psg->env_freq; + } + + /* Noise */ + psg->noise_count += incr; + if (psg->noise_count & 0x40) + { + if (psg->noise_seed & 1) + psg->noise_seed ^= 0x24000; + psg->noise_seed >>= 1; + psg->noise_count -= psg->noise_freq?psg->noise_freq:(1<<1); + } + noise = psg->noise_seed & 1; + + /* Tone */ + for (i = 0; i < 3; i++) + { + psg->count[i] += incr; + if (psg->count[i] & 0x1000) + { + if (psg->freq[i] > 1) + { + psg->edge[i] = !psg->edge[i]; + psg->count[i] -= psg->freq[i]; + } + else + { + psg->edge[i] = 1; + } + } + + if (psg->mask&PSG_MASK_CH(i)) + continue; + + if ((psg->tmask[i]||psg->edge[i]) && (psg->nmask[i]||noise)) + { + if (!(psg->volume[i] & 32)) + psg->ch_out[i] += (psg->voltbl[psg->volume[i] & 31] << 4); + else + psg->ch_out[i] += (psg->voltbl[psg->env_ptr] << 4); + } + + psg->ch_out[i] >>= 1; + + } + +} + +static inline int16_t +mix_output(PSG *psg) { + return (int16_t)(psg->out = psg->ch_out[0] + psg->ch_out[1] + psg->ch_out[2]); +} + +int16_t +PSG_calc (PSG * psg) +{ + if (!psg->quality) { + update_output(psg); + return mix_output(psg); + } + + /* Simple rate converter */ + while (psg->realstep > psg->psgtime) + { + psg->psgtime += psg->psgstep; + update_output(psg); + } + psg->psgtime = psg->psgtime - psg->realstep; + + return mix_output(psg); +} + +void +PSG_writeReg (PSG * psg, uint32_t reg, uint32_t val) +{ + int c; + + if (reg > 15) return; + + val &= regmsk[reg]; + + psg->reg[reg] = (uint8_t) (val & 0xff); + switch (reg) + { + case 0: + case 2: + case 4: + case 1: + case 3: + case 5: + c = reg >> 1; + psg->freq[c] = ((psg->reg[c * 2 + 1] & 15) << 8) + psg->reg[c * 2]; + break; + + case 6: + psg->noise_freq = (val & 31) << 1; + break; + + case 7: + psg->tmask[0] = (val & 1); + psg->tmask[1] = (val & 2); + psg->tmask[2] = (val & 4); + psg->nmask[0] = (val & 8); + psg->nmask[1] = (val & 16); + psg->nmask[2] = (val & 32); + break; + + case 8: + case 9: + case 10: + psg->volume[reg - 8] = val << 1; + break; + + case 11: + case 12: + psg->env_freq = (psg->reg[12] << 8) + psg->reg[11]; + break; + + case 13: + psg->env_continue = (val >> 3) & 1; + psg->env_attack = (val >> 2) & 1; + psg->env_alternate = (val >> 1) & 1; + psg->env_hold = val & 1; + psg->env_face = psg->env_attack; + psg->env_pause = 0; + psg->env_count = 0x10000 - psg->env_freq; + psg->env_ptr = psg->env_face?0:0x1f; + break; + + case 14: + case 15: + default: + break; + } + + return; +} \ No newline at end of file diff --git a/Core/emu2149.h b/Core/emu2149.h new file mode 100644 index 00000000..538edf75 --- /dev/null +++ b/Core/emu2149.h @@ -0,0 +1,88 @@ +/* emu2149.h */ +#ifndef _EMU2149_H_ +#define _EMU2149_H_ + +#include + +#define EMU2149_VOL_DEFAULT 1 +#define EMU2149_VOL_YM2149 0 +#define EMU2149_VOL_AY_3_8910 1 + +#define PSG_MASK_CH(x) (1<<(x)) + +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef struct __PSG + { + + /* Volume Table */ + uint32_t *voltbl; + + uint8_t reg[0x20]; + int32_t out; + + uint32_t clk, rate, base_incr, quality; + + uint32_t count[3]; + uint32_t volume[3]; + uint32_t freq[3]; + uint32_t edge[3]; + uint32_t tmask[3]; + uint32_t nmask[3]; + uint32_t mask; + + uint32_t base_count; + + uint32_t env_volume; + uint32_t env_ptr; + uint32_t env_face; + + uint32_t env_continue; + uint32_t env_attack; + uint32_t env_alternate; + uint32_t env_hold; + uint32_t env_pause; + uint32_t env_reset; + + uint32_t env_freq; + uint32_t env_count; + + uint32_t noise_seed; + uint32_t noise_count; + uint32_t noise_freq; + + /* rate converter */ + uint32_t realstep; + uint32_t psgtime; + uint32_t psgstep; + + /* I/O Ctrl */ + uint32_t adr; + + /* output of channels */ + int16_t ch_out[3]; + + } PSG; + + void PSG_set_quality (PSG * psg, uint32_t q); + void PSG_set_rate (PSG * psg, uint32_t r); + PSG *PSG_new (uint32_t clk, uint32_t rate); + void PSG_reset (PSG *); + void PSG_delete (PSG *); + void PSG_writeReg (PSG *, uint32_t reg, uint32_t val); + void PSG_writeIO (PSG * psg, uint32_t adr, uint32_t val); + uint8_t PSG_readReg (PSG * psg, uint32_t reg); + uint8_t PSG_readIO (PSG * psg); + int16_t PSG_calc (PSG *); + void PSG_setVolumeMode (PSG * psg, int type); + uint32_t PSG_setMask (PSG *, uint32_t mask); + uint32_t PSG_toggleMask (PSG *, uint32_t mask); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Core/opll.cpp b/Core/opll.cpp new file mode 100644 index 00000000..67bcf0df --- /dev/null +++ b/Core/opll.cpp @@ -0,0 +1,1118 @@ +/* + * Copyright (C) 2019 Nuke.YKT + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * + * Yamaha YM2413 emulator + * Thanks: + * siliconpr0n.org(digshadow, John McMaster): + * VRC VII decap and die shot. + * + * version: 1.0.1 + */ +#include "stdafx.h" +#include +#include "opll.h" + +enum { + eg_num_attack = 0, + eg_num_decay = 1, + eg_num_sustain = 2, + eg_num_release = 3 +}; + +enum { + rm_num_bd0 = 0, + rm_num_hh = 1, + rm_num_tom = 2, + rm_num_bd1 = 3, + rm_num_sd = 4, + rm_num_tc = 5 +}; + +/* logsin table */ +static const uint16_t logsinrom[256] = { + 0x859, 0x6c3, 0x607, 0x58b, 0x52e, 0x4e4, 0x4a6, 0x471, + 0x443, 0x41a, 0x3f5, 0x3d3, 0x3b5, 0x398, 0x37e, 0x365, + 0x34e, 0x339, 0x324, 0x311, 0x2ff, 0x2ed, 0x2dc, 0x2cd, + 0x2bd, 0x2af, 0x2a0, 0x293, 0x286, 0x279, 0x26d, 0x261, + 0x256, 0x24b, 0x240, 0x236, 0x22c, 0x222, 0x218, 0x20f, + 0x206, 0x1fd, 0x1f5, 0x1ec, 0x1e4, 0x1dc, 0x1d4, 0x1cd, + 0x1c5, 0x1be, 0x1b7, 0x1b0, 0x1a9, 0x1a2, 0x19b, 0x195, + 0x18f, 0x188, 0x182, 0x17c, 0x177, 0x171, 0x16b, 0x166, + 0x160, 0x15b, 0x155, 0x150, 0x14b, 0x146, 0x141, 0x13c, + 0x137, 0x133, 0x12e, 0x129, 0x125, 0x121, 0x11c, 0x118, + 0x114, 0x10f, 0x10b, 0x107, 0x103, 0x0ff, 0x0fb, 0x0f8, + 0x0f4, 0x0f0, 0x0ec, 0x0e9, 0x0e5, 0x0e2, 0x0de, 0x0db, + 0x0d7, 0x0d4, 0x0d1, 0x0cd, 0x0ca, 0x0c7, 0x0c4, 0x0c1, + 0x0be, 0x0bb, 0x0b8, 0x0b5, 0x0b2, 0x0af, 0x0ac, 0x0a9, + 0x0a7, 0x0a4, 0x0a1, 0x09f, 0x09c, 0x099, 0x097, 0x094, + 0x092, 0x08f, 0x08d, 0x08a, 0x088, 0x086, 0x083, 0x081, + 0x07f, 0x07d, 0x07a, 0x078, 0x076, 0x074, 0x072, 0x070, + 0x06e, 0x06c, 0x06a, 0x068, 0x066, 0x064, 0x062, 0x060, + 0x05e, 0x05c, 0x05b, 0x059, 0x057, 0x055, 0x053, 0x052, + 0x050, 0x04e, 0x04d, 0x04b, 0x04a, 0x048, 0x046, 0x045, + 0x043, 0x042, 0x040, 0x03f, 0x03e, 0x03c, 0x03b, 0x039, + 0x038, 0x037, 0x035, 0x034, 0x033, 0x031, 0x030, 0x02f, + 0x02e, 0x02d, 0x02b, 0x02a, 0x029, 0x028, 0x027, 0x026, + 0x025, 0x024, 0x023, 0x022, 0x021, 0x020, 0x01f, 0x01e, + 0x01d, 0x01c, 0x01b, 0x01a, 0x019, 0x018, 0x017, 0x017, + 0x016, 0x015, 0x014, 0x014, 0x013, 0x012, 0x011, 0x011, + 0x010, 0x00f, 0x00f, 0x00e, 0x00d, 0x00d, 0x00c, 0x00c, + 0x00b, 0x00a, 0x00a, 0x009, 0x009, 0x008, 0x008, 0x007, + 0x007, 0x007, 0x006, 0x006, 0x005, 0x005, 0x005, 0x004, + 0x004, 0x004, 0x003, 0x003, 0x003, 0x002, 0x002, 0x002, + 0x002, 0x001, 0x001, 0x001, 0x001, 0x001, 0x001, 0x001, + 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000 +}; + +/* exp table */ +static const uint16_t exprom[256] = { + 0x7fa, 0x7f5, 0x7ef, 0x7ea, 0x7e4, 0x7df, 0x7da, 0x7d4, + 0x7cf, 0x7c9, 0x7c4, 0x7bf, 0x7b9, 0x7b4, 0x7ae, 0x7a9, + 0x7a4, 0x79f, 0x799, 0x794, 0x78f, 0x78a, 0x784, 0x77f, + 0x77a, 0x775, 0x770, 0x76a, 0x765, 0x760, 0x75b, 0x756, + 0x751, 0x74c, 0x747, 0x742, 0x73d, 0x738, 0x733, 0x72e, + 0x729, 0x724, 0x71f, 0x71a, 0x715, 0x710, 0x70b, 0x706, + 0x702, 0x6fd, 0x6f8, 0x6f3, 0x6ee, 0x6e9, 0x6e5, 0x6e0, + 0x6db, 0x6d6, 0x6d2, 0x6cd, 0x6c8, 0x6c4, 0x6bf, 0x6ba, + 0x6b5, 0x6b1, 0x6ac, 0x6a8, 0x6a3, 0x69e, 0x69a, 0x695, + 0x691, 0x68c, 0x688, 0x683, 0x67f, 0x67a, 0x676, 0x671, + 0x66d, 0x668, 0x664, 0x65f, 0x65b, 0x657, 0x652, 0x64e, + 0x649, 0x645, 0x641, 0x63c, 0x638, 0x634, 0x630, 0x62b, + 0x627, 0x623, 0x61e, 0x61a, 0x616, 0x612, 0x60e, 0x609, + 0x605, 0x601, 0x5fd, 0x5f9, 0x5f5, 0x5f0, 0x5ec, 0x5e8, + 0x5e4, 0x5e0, 0x5dc, 0x5d8, 0x5d4, 0x5d0, 0x5cc, 0x5c8, + 0x5c4, 0x5c0, 0x5bc, 0x5b8, 0x5b4, 0x5b0, 0x5ac, 0x5a8, + 0x5a4, 0x5a0, 0x59c, 0x599, 0x595, 0x591, 0x58d, 0x589, + 0x585, 0x581, 0x57e, 0x57a, 0x576, 0x572, 0x56f, 0x56b, + 0x567, 0x563, 0x560, 0x55c, 0x558, 0x554, 0x551, 0x54d, + 0x549, 0x546, 0x542, 0x53e, 0x53b, 0x537, 0x534, 0x530, + 0x52c, 0x529, 0x525, 0x522, 0x51e, 0x51b, 0x517, 0x514, + 0x510, 0x50c, 0x509, 0x506, 0x502, 0x4ff, 0x4fb, 0x4f8, + 0x4f4, 0x4f1, 0x4ed, 0x4ea, 0x4e7, 0x4e3, 0x4e0, 0x4dc, + 0x4d9, 0x4d6, 0x4d2, 0x4cf, 0x4cc, 0x4c8, 0x4c5, 0x4c2, + 0x4be, 0x4bb, 0x4b8, 0x4b5, 0x4b1, 0x4ae, 0x4ab, 0x4a8, + 0x4a4, 0x4a1, 0x49e, 0x49b, 0x498, 0x494, 0x491, 0x48e, + 0x48b, 0x488, 0x485, 0x482, 0x47e, 0x47b, 0x478, 0x475, + 0x472, 0x46f, 0x46c, 0x469, 0x466, 0x463, 0x460, 0x45d, + 0x45a, 0x457, 0x454, 0x451, 0x44e, 0x44b, 0x448, 0x445, + 0x442, 0x43f, 0x43c, 0x439, 0x436, 0x433, 0x430, 0x42d, + 0x42a, 0x428, 0x425, 0x422, 0x41f, 0x41c, 0x419, 0x416, + 0x414, 0x411, 0x40e, 0x40b, 0x408, 0x406, 0x403, 0x400 +}; + +static const opll_patch_t patch_ds1001[opll_patch_max] = { + { 0x05, 0x00, 0x00, 0x06,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x03, 0x01 },{ 0x00, 0x00 },{ 0x0e, 0x08 },{ 0x08, 0x01 },{ 0x04, 0x02 },{ 0x02, 0x07 } }, + { 0x14, 0x00, 0x01, 0x05,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x03, 0x01 },{ 0x00, 0x00 },{ 0x0d, 0x0f },{ 0x08, 0x06 },{ 0x02, 0x01 },{ 0x03, 0x02 } }, + { 0x08, 0x00, 0x01, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x0f, 0x0b },{ 0x0a, 0x02 },{ 0x02, 0x01 },{ 0x00, 0x02 } }, + { 0x0c, 0x00, 0x00, 0x07,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x0a, 0x06 },{ 0x08, 0x04 },{ 0x06, 0x02 },{ 0x01, 0x07 } }, + { 0x1e, 0x00, 0x00, 0x06,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x02, 0x01 },{ 0x00, 0x00 },{ 0x0e, 0x07 },{ 0x01, 0x06 },{ 0x00, 0x02 },{ 0x01, 0x08 } }, + { 0x06, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x02, 0x01 },{ 0x00, 0x00 },{ 0x0a, 0x0e },{ 0x03, 0x02 },{ 0x0f, 0x0f },{ 0x04, 0x04 } }, + { 0x1d, 0x00, 0x00, 0x07,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x08, 0x08 },{ 0x02, 0x01 },{ 0x01, 0x00 },{ 0x01, 0x07 } }, + { 0x22, 0x01, 0x00, 0x07,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x03, 0x01 },{ 0x00, 0x00 },{ 0x0a, 0x07 },{ 0x02, 0x02 },{ 0x00, 0x01 },{ 0x01, 0x07 } }, + { 0x25, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x05, 0x01 },{ 0x00, 0x00 },{ 0x04, 0x07 },{ 0x00, 0x03 },{ 0x07, 0x00 },{ 0x02, 0x01 } }, + { 0x0f, 0x00, 0x01, 0x07,{ 0x01, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x01, 0x00 },{ 0x05, 0x01 },{ 0x00, 0x00 },{ 0x0a, 0x0a },{ 0x08, 0x05 },{ 0x05, 0x00 },{ 0x01, 0x02 } }, + { 0x24, 0x00, 0x00, 0x07,{ 0x00, 0x01 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x07, 0x01 },{ 0x00, 0x00 },{ 0x0f, 0x0f },{ 0x08, 0x08 },{ 0x02, 0x01 },{ 0x02, 0x02 } }, + { 0x11, 0x00, 0x00, 0x06,{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x01, 0x03 },{ 0x00, 0x00 },{ 0x06, 0x07 },{ 0x05, 0x04 },{ 0x01, 0x01 },{ 0x08, 0x06 } }, + { 0x13, 0x00, 0x00, 0x05,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x02 },{ 0x03, 0x00 },{ 0x0c, 0x09 },{ 0x09, 0x05 },{ 0x00, 0x00 },{ 0x03, 0x02 } }, + { 0x0c, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x03 },{ 0x00, 0x00 },{ 0x09, 0x0c },{ 0x04, 0x00 },{ 0x03, 0x0f },{ 0x03, 0x06 } }, + { 0x0d, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x01 },{ 0x01, 0x02 },{ 0x00, 0x00 },{ 0x0c, 0x0d },{ 0x01, 0x05 },{ 0x05, 0x00 },{ 0x06, 0x06 } }, + + { 0x18, 0x00, 0x01, 0x07,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x00, 0x00 },{ 0x0d, 0x00 },{ 0x0f, 0x00 },{ 0x06, 0x00 },{ 0x0a, 0x00 } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x00, 0x00 },{ 0x0c, 0x00 },{ 0x08, 0x00 },{ 0x0a, 0x00 },{ 0x07, 0x00 } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x05, 0x00 },{ 0x00, 0x00 },{ 0x0f, 0x00 },{ 0x08, 0x00 },{ 0x05, 0x00 },{ 0x09, 0x00 } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x0f },{ 0x00, 0x08 },{ 0x00, 0x06 },{ 0x00, 0x0d } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x0d },{ 0x00, 0x08 },{ 0x00, 0x06 },{ 0x00, 0x08 } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x0a },{ 0x00, 0x0a },{ 0x00, 0x05 },{ 0x00, 0x05 } } +}; + +static const opll_patch_t patch_ym2413[opll_patch_max] = { + { 0x1e, 0x01, 0x00, 0x07,{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x0d, 0x07 },{ 0x00, 0x08 },{ 0x00, 0x01 },{ 0x00, 0x07 } }, + { 0x1a, 0x00, 0x01, 0x05,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x03, 0x01 },{ 0x00, 0x00 },{ 0x0d, 0x0f },{ 0x08, 0x07 },{ 0x02, 0x01 },{ 0x03, 0x03 } }, + { 0x19, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x03, 0x01 },{ 0x02, 0x00 },{ 0x0f, 0x0c },{ 0x02, 0x04 },{ 0x01, 0x02 },{ 0x01, 0x03 } }, + { 0x0e, 0x00, 0x00, 0x07,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x0a, 0x06 },{ 0x08, 0x04 },{ 0x07, 0x02 },{ 0x00, 0x07 } }, + { 0x1e, 0x00, 0x00, 0x06,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x02, 0x01 },{ 0x00, 0x00 },{ 0x0e, 0x07 },{ 0x00, 0x06 },{ 0x00, 0x02 },{ 0x00, 0x08 } }, + { 0x16, 0x00, 0x00, 0x05,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x01, 0x02 },{ 0x00, 0x00 },{ 0x0e, 0x07 },{ 0x00, 0x01 },{ 0x00, 0x01 },{ 0x00, 0x08 } }, + { 0x1d, 0x00, 0x00, 0x07,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x08, 0x08 },{ 0x02, 0x01 },{ 0x01, 0x00 },{ 0x00, 0x07 } }, + { 0x2d, 0x01, 0x00, 0x04,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x03, 0x01 },{ 0x00, 0x00 },{ 0x0a, 0x07 },{ 0x02, 0x02 },{ 0x00, 0x00 },{ 0x00, 0x07 } }, + { 0x1b, 0x00, 0x00, 0x06,{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x06, 0x06 },{ 0x04, 0x05 },{ 0x01, 0x01 },{ 0x00, 0x07 } }, + { 0x0b, 0x01, 0x01, 0x00,{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x08, 0x0f },{ 0x05, 0x07 },{ 0x07, 0x00 },{ 0x01, 0x07 } }, + { 0x03, 0x01, 0x00, 0x01,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x03, 0x01 },{ 0x02, 0x00 },{ 0x0f, 0x0e },{ 0x0a, 0x04 },{ 0x01, 0x00 },{ 0x00, 0x04 } }, + { 0x24, 0x00, 0x00, 0x07,{ 0x00, 0x01 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x07, 0x01 },{ 0x00, 0x00 },{ 0x0f, 0x0f },{ 0x08, 0x08 },{ 0x02, 0x01 },{ 0x02, 0x02 } }, + { 0x0c, 0x00, 0x00, 0x05,{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x00, 0x01 },{ 0x01, 0x00 },{ 0x00, 0x00 },{ 0x0c, 0x0f },{ 0x02, 0x05 },{ 0x02, 0x04 },{ 0x00, 0x02 } }, + { 0x15, 0x00, 0x00, 0x03,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x0c, 0x09 },{ 0x09, 0x05 },{ 0x00, 0x00 },{ 0x03, 0x02 } }, + { 0x09, 0x00, 0x00, 0x03,{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x02, 0x00 },{ 0x0f, 0x0e },{ 0x01, 0x04 },{ 0x04, 0x01 },{ 0x00, 0x03 } }, + + { 0x18, 0x00, 0x01, 0x07,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x00, 0x00 },{ 0x0d, 0x00 },{ 0x0f, 0x00 },{ 0x06, 0x00 },{ 0x0a, 0x00 } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x00, 0x00 },{ 0x0c, 0x00 },{ 0x08, 0x00 },{ 0x0a, 0x00 },{ 0x07, 0x00 } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x05, 0x00 },{ 0x00, 0x00 },{ 0x0f, 0x00 },{ 0x08, 0x00 },{ 0x05, 0x00 },{ 0x09, 0x00 } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x0f },{ 0x00, 0x08 },{ 0x00, 0x06 },{ 0x00, 0x0d } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x0d },{ 0x00, 0x08 },{ 0x00, 0x04 },{ 0x00, 0x08 } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x0a },{ 0x00, 0x0a },{ 0x00, 0x05 },{ 0x00, 0x05 } } +}; + +static const opll_patch_t patch_ymf281[opll_patch_max] = { + { 0x1a, 0x00, 0x00, 0x07,{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x02, 0x01 },{ 0x00, 0x00 },{ 0x0f, 0x06 },{ 0x0f, 0x07 },{ 0x00, 0x01 },{ 0x00, 0x06 } }, + { 0x05, 0x00, 0x00, 0x01,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x0f, 0x08 },{ 0x06, 0x03 },{ 0x08, 0x00 },{ 0x00, 0x03 } }, + { 0x16, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x03, 0x01 },{ 0x02, 0x00 },{ 0x0f, 0x0d },{ 0x02, 0x03 },{ 0x01, 0x00 },{ 0x01, 0x03 } }, + { 0x0b, 0x00, 0x01, 0x07,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x0a, 0x06 },{ 0x08, 0x04 },{ 0x07, 0x01 },{ 0x00, 0x07 } }, + { 0x1e, 0x00, 0x00, 0x06,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x02, 0x01 },{ 0x00, 0x00 },{ 0x0e, 0x07 },{ 0x01, 0x06 },{ 0x00, 0x02 },{ 0x00, 0x08 } }, + { 0x02, 0x00, 0x01, 0x06,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x02, 0x00 },{ 0x09, 0x06 },{ 0x0a, 0x01 },{ 0x02, 0x02 },{ 0x00, 0x07 } }, + { 0x1b, 0x00, 0x00, 0x07,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x08, 0x08 },{ 0x04, 0x03 },{ 0x01, 0x00 },{ 0x00, 0x07 } }, + { 0x0a, 0x00, 0x00, 0x02,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x07, 0x02 },{ 0x03, 0x00 },{ 0x06, 0x06 },{ 0x06, 0x04 },{ 0x04, 0x02 },{ 0x00, 0x07 } }, + { 0x07, 0x00, 0x00, 0x03,{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x0c, 0x07 },{ 0x05, 0x07 },{ 0x05, 0x00 },{ 0x01, 0x07 } }, + { 0x1e, 0x00, 0x00, 0x07,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x01, 0x00 },{ 0x06, 0x01 },{ 0x01, 0x00 },{ 0x0f, 0x0f },{ 0x02, 0x03 },{ 0x0f, 0x0f },{ 0x00, 0x03 } }, + { 0x18, 0x00, 0x00, 0x06,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x0f, 0x0e },{ 0x05, 0x03 },{ 0x02, 0x01 },{ 0x00, 0x03 } }, + { 0x24, 0x00, 0x00, 0x07,{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x07, 0x01 },{ 0x00, 0x00 },{ 0x0f, 0x0f },{ 0x08, 0x08 },{ 0x02, 0x00 },{ 0x02, 0x03 } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x01, 0x01 },{ 0x01, 0x00 },{ 0x05, 0x04 },{ 0x00, 0x00 },{ 0x0f, 0x0f },{ 0x0f, 0x03 },{ 0x07, 0x0f },{ 0x00, 0x05 } }, + { 0x03, 0x00, 0x00, 0x07,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x01 },{ 0x0f, 0x01 },{ 0x00, 0x00 },{ 0x0f, 0x0e },{ 0x0c, 0x03 },{ 0x03, 0x0f },{ 0x0f, 0x0c } }, + { 0x00, 0x00, 0x00, 0x07,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x0a, 0x01 },{ 0x00, 0x00 },{ 0x0b, 0x08 },{ 0x0f, 0x04 },{ 0x00, 0x0f },{ 0x00, 0x05 } }, + + { 0x18, 0x00, 0x01, 0x07,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x00, 0x00 },{ 0x0d, 0x00 },{ 0x0f, 0x00 },{ 0x06, 0x00 },{ 0x0a, 0x00 } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x00, 0x00 },{ 0x0c, 0x00 },{ 0x08, 0x00 },{ 0x0a, 0x00 },{ 0x07, 0x00 } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x05, 0x00 },{ 0x00, 0x00 },{ 0x0f, 0x00 },{ 0x08, 0x00 },{ 0x05, 0x00 },{ 0x09, 0x00 } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x0f },{ 0x00, 0x08 },{ 0x00, 0x06 },{ 0x00, 0x0d } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x0d },{ 0x00, 0x08 },{ 0x00, 0x04 },{ 0x00, 0x08 } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x0a },{ 0x00, 0x0a },{ 0x00, 0x05 },{ 0x00, 0x05 } } +}; + +static const opll_patch_t patch_ym2423[opll_patch_max] = { + { 0x1b, 0x00, 0x00, 0x07,{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x09, 0x05 },{ 0x04, 0x04 },{ 0x01, 0x00 },{ 0x00, 0x05 } }, + { 0x12, 0x00, 0x00, 0x04,{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x03, 0x01 },{ 0x01, 0x00 },{ 0x0f, 0x0f },{ 0x03, 0x02 },{ 0x0a, 0x0e },{ 0x00, 0x09 } }, + { 0x11, 0x00, 0x00, 0x05,{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x02 },{ 0x0f, 0x0f },{ 0x02, 0x02 },{ 0x05, 0x07 },{ 0x00, 0x05 } }, + { 0x28, 0x00, 0x00, 0x07,{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x03, 0x02 },{ 0x00, 0x00 },{ 0x0f, 0x0f },{ 0x03, 0x02 },{ 0x09, 0x0b },{ 0x00, 0x04 } }, + { 0x17, 0x00, 0x00, 0x05,{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x02, 0x01 },{ 0x02, 0x00 },{ 0x05, 0x06 },{ 0x01, 0x0f },{ 0x07, 0x00 },{ 0x00, 0x09 } }, + { 0x18, 0x00, 0x00, 0x06,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x03, 0x00 },{ 0x00, 0x00 },{ 0x0f, 0x0f },{ 0x07, 0x04 },{ 0x05, 0x08 },{ 0x00, 0x05 } }, + { 0x1c, 0x00, 0x00, 0x07,{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x05, 0x07 },{ 0x01, 0x01 },{ 0x02, 0x02 },{ 0x00, 0x06 } }, + { 0x1b, 0x00, 0x00, 0x07,{ 0x00, 0x01 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x01, 0x04 },{ 0x00, 0x00 },{ 0x07, 0x03 },{ 0x03, 0x0f },{ 0x00, 0x00 },{ 0x00, 0x06 } }, + { 0x0d, 0x00, 0x00, 0x03,{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x04, 0x06 },{ 0x02, 0x0f },{ 0x02, 0x00 },{ 0x00, 0x06 } }, + { 0x10, 0x00, 0x00, 0x05,{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x02 },{ 0x0f, 0x0f },{ 0x03, 0x03 },{ 0x02, 0x00 },{ 0x00, 0x04 } }, + { 0x1b, 0x00, 0x00, 0x07,{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x0c, 0x09 },{ 0x05, 0x06 },{ 0x0f, 0x0f },{ 0x00, 0x06 } }, + { 0x1b, 0x00, 0x00, 0x00,{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x09, 0x01 },{ 0x03, 0x00 },{ 0x0f, 0x0f },{ 0x05, 0x03 },{ 0x07, 0x0f },{ 0x00, 0x02 } }, + { 0x11, 0x00, 0x00, 0x03,{ 0x00, 0x01 },{ 0x01, 0x00 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x02 },{ 0x02, 0x00 },{ 0x09, 0x0b },{ 0x04, 0x01 },{ 0x0e, 0x0f },{ 0x00, 0x07 } }, + { 0x17, 0x00, 0x00, 0x06,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x0d, 0x0e },{ 0x03, 0x01 },{ 0x0b, 0x0e },{ 0x00, 0x0b } }, + { 0x0d, 0x00, 0x00, 0x05,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x01 },{ 0x01, 0x01 },{ 0x01, 0x06 },{ 0x00, 0x00 },{ 0x0f, 0x0f },{ 0x02, 0x04 },{ 0x02, 0x09 },{ 0x00, 0x09 } }, + + { 0x18, 0x00, 0x01, 0x07,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x00, 0x00 },{ 0x0d, 0x00 },{ 0x0f, 0x00 },{ 0x06, 0x00 },{ 0x0a, 0x00 } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x01, 0x00 },{ 0x00, 0x00 },{ 0x0c, 0x00 },{ 0x08, 0x00 },{ 0x0a, 0x00 },{ 0x07, 0x00 } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x05, 0x00 },{ 0x00, 0x00 },{ 0x0f, 0x00 },{ 0x08, 0x00 },{ 0x05, 0x00 },{ 0x09, 0x00 } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x0f },{ 0x00, 0x08 },{ 0x00, 0x06 },{ 0x00, 0x0d } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x0d },{ 0x00, 0x08 },{ 0x00, 0x04 },{ 0x00, 0x08 } }, + { 0x00, 0x00, 0x00, 0x00,{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x00 },{ 0x00, 0x01 },{ 0x00, 0x00 },{ 0x00, 0x0a },{ 0x00, 0x0a },{ 0x00, 0x05 },{ 0x00, 0x05 } } +}; + +static const uint32_t ch_offset[18] = { + 1, 2, 0, 1, 2, 3, 4, 5, 3, 4, 5, 6, 7, 8, 6, 7, 8, 0 +}; + +static const uint32_t pg_multi[16] = { + 1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 20, 24, 24, 30, 30 +}; + +static const uint32_t eg_stephi[4][4] = { + { 0, 0, 0, 0 }, + { 1, 0, 0, 0 }, + { 1, 0, 1, 0 }, + { 1, 1, 1, 0 } +}; + +static const uint32_t eg_ksltable[16] = { + 0, 32, 40, 45, 48, 51, 53, 55, 56, 58, 59, 60, 61, 62, 63, 64 +}; + +void OPLL_DoIO(opll_t *chip) { + /* Write signal check */ + chip->write_a_en = (chip->write_a & 0x03) == 0x01; + chip->write_d_en = (chip->write_d & 0x03) == 0x01; + chip->write_a <<= 1; + chip->write_d <<= 1; +} + +void OPLL_DoModeWrite(opll_t *chip) { + uint8_t slot; + if ((chip->write_mode_address & 0x10) && chip->write_d_en) { + slot = chip->write_mode_address & 0x01; + switch (chip->write_mode_address & 0x0f) { + case 0x00: + case 0x01: + chip->patch.multi[slot] = chip->write_data & 0x0f; + chip->patch.ksr[slot] = (chip->write_data >> 4) & 0x01; + chip->patch.et[slot] = (chip->write_data >> 5) & 0x01; + chip->patch.vib[slot] = (chip->write_data >> 6) & 0x01; + chip->patch.am[slot] = (chip->write_data >> 7) & 0x01; + break; + + case 0x02: + chip->patch.ksl[0] = (chip->write_data >> 6) & 0x03; + chip->patch.tl = chip->write_data & 0x3f; + break; + + case 0x03: + chip->patch.ksl[1] = (chip->write_data >> 6) & 0x03; + chip->patch.dc = (chip->write_data >> 4) & 0x01; + chip->patch.dm = (chip->write_data >> 3) & 0x01; + chip->patch.fb = chip->write_data & 0x07; + break; + + case 0x04: + case 0x05: + chip->patch.dr[slot] = chip->write_data & 0x0f; + chip->patch.ar[slot] = (chip->write_data >> 4) & 0x0f; + break; + + case 0x06: + case 0x07: + chip->patch.rr[slot] = chip->write_data & 0x0f; + chip->patch.sl[slot] = (chip->write_data >> 4) & 0x0f; + break; + + case 0x0e: + chip->rhythm = chip->write_data & 0x3f; + if (chip->chip_type == opll_type_ds1001) { + chip->rhythm |= 0x20; + } + chip->rm_enable = (chip->rm_enable & 0x7f) | ((chip->rhythm << 2) & 0x80); + break; + + case 0x0f: + chip->testmode = chip->write_data & 0x0f; + break; + } + } +} + +void OPLL_Reset(opll_t *chip, uint32_t chip_type) { + uint32_t i; + memset(chip, 0, sizeof(opll_t)); + chip->chip_type = chip_type; + if (chip_type == opll_type_ds1001) { + /* Rhythm mode is always on */ + chip->rhythm = 0x20; + chip->rm_enable = (int8_t)0x80; + } + switch (chip_type) { + case opll_type_ds1001: + chip->patchrom = patch_ds1001; + break; + case opll_type_ymf281: + case opll_type_ymf281b: + chip->patchrom = patch_ymf281; + break; + case opll_type_ym2423: + chip->patchrom = patch_ym2423; + break; + case opll_type_ym2413: + case opll_type_ym2413b: + case opll_type_ym2420: + default: + chip->patchrom = patch_ym2413; + break; + } + for (i = 0; i < 18; i++) { + chip->eg_state[i] = eg_num_release; + chip->eg_level[i] = 0x7f; + chip->eg_out = 0x7f; + } + chip->rm_select = rm_num_tc + 1; +} + +void OPLL_DoRegWrite(opll_t *chip) { + uint32_t channel; + + /* Address */ + if (chip->write_a_en) { + if ((chip->write_data & 0xc0) == 0x00) { + /* FM Write */ + chip->write_fm_address = 1; + chip->address = chip->write_data; + } else { + chip->write_fm_address = 0; + } + } + /* Data */ + if (chip->write_fm_address && chip->write_d_en) { + chip->data = chip->write_data; + } + + /* Update registers */ + if (chip->write_fm_data && !chip->write_a_en) { + if ((chip->address & 0x0f) == chip->cycles && chip->cycles < 16) { + channel = chip->cycles % 9; + switch (chip->address & 0xf0) { + case 0x10: + if (chip->chip_type == opll_type_ym2420) + { + chip->fnum[channel] = (chip->fnum[channel] & 0x0f) | ((chip->data & 0x1f) << 4); + chip->block[channel] = (chip->data >> 5) & 0x07; + } + else + chip->fnum[channel] = (chip->fnum[channel] & 0x100) | chip->data; + break; + case 0x20: + if (chip->chip_type == opll_type_ym2420) + chip->fnum[channel] = (chip->fnum[channel] & 0x1f0) | (chip->data & 0x0f); + else + { + chip->fnum[channel] = (chip->fnum[channel] & 0xff) | ((chip->data & 0x01) << 8); + chip->block[channel] = (chip->data >> 1) & 0x07; + } + chip->kon[channel] = (chip->data >> 4) & 0x01; + chip->son[channel] = (chip->data >> 5) & 0x01; + break; + case 0x30: + chip->vol[channel] = chip->data & 0x0f; + chip->inst[channel] = (chip->data >> 4) & 0x0f; + break; + } + } + } + + + if (chip->write_a_en) { + chip->write_fm_data = 0; + } + if (chip->write_fm_address && chip->write_d_en) { + chip->write_fm_data = 1; + } + if (chip->write_a_en) { + if (((chip->write_data & 0xf0) == 0x00)) { + chip->write_mode_address = 0x10 | (chip->write_data & 0x0f); + } else { + chip->write_mode_address = 0x00; + } + } + +} +void OPLL_PreparePatch1(opll_t *chip) { + uint8_t instr; + uint32_t mcsel = ((chip->cycles + 1) / 3) & 0x01; + uint32_t instr_index; + uint32_t ch = ch_offset[chip->cycles]; + const opll_patch_t *patch; + instr = chip->inst[ch]; + if (instr > 0) { + instr_index = opll_patch_1 + instr - 1; + } + if (chip->rm_select <= rm_num_tc) { + instr_index = opll_patch_drum_0 + chip->rm_select; + } + if (chip->rm_select <= rm_num_tc || instr > 0) { + patch = &chip->patchrom[instr_index]; + } else { + patch = &chip->patch; + } + if (chip->rm_select == rm_num_hh || chip->rm_select == rm_num_tom) { + chip->c_tl = chip->inst[ch] << 2; + } else if (mcsel == 1) { + chip->c_tl = chip->vol[ch] << 2; + } else { + chip->c_tl = patch->tl; + } + + chip->c_adrr[0] = patch->ar[mcsel]; + chip->c_adrr[1] = patch->dr[mcsel]; + chip->c_adrr[2] = patch->rr[mcsel]; + chip->c_et = patch->et[mcsel]; + chip->c_ksr = patch->ksr[mcsel]; + chip->c_ksl = patch->ksl[mcsel]; + chip->c_ksr_freq = (chip->block[ch] << 1) | (chip->fnum[ch] >> 8); + chip->c_ksl_freq = (chip->fnum[ch]>>5); + chip->c_ksl_block = (chip->block[ch]); +} + +void OPLL_PreparePatch2(opll_t *chip) { + uint8_t instr; + uint32_t mcsel = ((chip->cycles + 1) / 3) & 0x01; + uint32_t instr_index; + const opll_patch_t *patch; + instr = chip->inst[ch_offset[chip->cycles]]; + if (instr > 0) { + instr_index = opll_patch_1 + instr - 1; + } + if (chip->rm_select <= rm_num_tc) { + instr_index = opll_patch_drum_0 + chip->rm_select; + } + if (chip->rm_select <= rm_num_tc || instr > 0) { + patch = &chip->patchrom[instr_index]; + } else { + patch = &chip->patch; + } + + chip->c_fnum = chip->fnum[ch_offset[chip->cycles]]; + chip->c_block = chip->block[ch_offset[chip->cycles]]; + + chip->c_multi = patch->multi[mcsel]; + chip->c_sl = patch->sl[mcsel]; + chip->c_fb = patch->fb; + chip->c_vib = patch->vib[mcsel]; + chip->c_am = patch->am[mcsel]; + chip->c_dc <<= 1; + chip->c_dm <<= 1; + chip->c_dc |= patch->dc; + chip->c_dm |= patch->dm; +} + +void OPLL_PhaseGenerate(opll_t *chip) { + uint32_t ismod; + uint32_t phase; + uint8_t rm_bit; + uint16_t pg_out; + + chip->pg_phase[(chip->cycles + 17) % 18] = chip->pg_phase_next + chip->pg_inc; + + if ((chip->rm_enable & 0x40) && (chip->cycles == 13 || chip->cycles == 14)) { + ismod = 0; + } else { + ismod = ((chip->cycles + 3) / 3) & 1; + } + phase = chip->pg_phase[chip->cycles]; + /* KeyOn event check */ + if ((chip->testmode & 0x04) + || (ismod && (chip->eg_dokon & 0x8000)) || (!ismod && (chip->eg_dokon & 0x01))) { + chip->pg_phase_next = 0; + } else { + chip->pg_phase_next = phase; + } + /* Rhythm mode */ + if (chip->cycles == 13) { + chip->rm_hh_bit2 = (phase >> (2 + 9)) & 1; + chip->rm_hh_bit3 = (phase >> (3 + 9)) & 1; + chip->rm_hh_bit7 = (phase >> (7 + 9)) & 1; + chip->rm_hh_bit8 = (phase >> (8 + 9)) & 1; + } else if (chip->cycles == 17 && (chip->rm_enable & 0x80)) { + chip->rm_tc_bit3 = (phase >> (3 + 9)) & 1; + chip->rm_tc_bit5 = (phase >> (5 + 9)) & 1; + } + if ((chip->rm_enable & 0x80)) { + switch (chip->cycles) { + case 13: + /* HH */ + rm_bit = (chip->rm_hh_bit2 ^ chip->rm_hh_bit7) + | (chip->rm_hh_bit3 ^ chip->rm_tc_bit5) + | (chip->rm_tc_bit3 ^ chip->rm_tc_bit5); + pg_out = rm_bit << 9; + if (rm_bit ^ (chip->rm_noise & 1)) { + pg_out |= 0xd0; + } else { + pg_out |= 0x34; + } + break; + case 16: + /* SD */ + pg_out = (chip->rm_hh_bit8 << 9) + | ((chip->rm_hh_bit8 ^ (chip->rm_noise & 1)) << 8); + break; + case 17: + /* TC */ + rm_bit = (chip->rm_hh_bit2 ^ chip->rm_hh_bit7) + | (chip->rm_hh_bit3 ^ chip->rm_tc_bit5) + | (chip->rm_tc_bit3 ^ chip->rm_tc_bit5); + pg_out = (rm_bit << 9) | 0x100; + break; + default: + pg_out = phase >> 9; + } + } else { + pg_out = phase >> 9; + } + chip->pg_out = pg_out; +} + +void OPLL_PhaseCalcIncrement(opll_t *chip) { + uint32_t freq; + uint16_t block; + freq = chip->c_fnum << 1; + block = chip->c_block; + /* Apply vibrato */ + if (chip->c_vib) { + switch (chip->lfo_vib_counter) { + case 0: + case 4: + break; + case 1: + case 3: + freq += freq >> 8; + break; + case 2: + freq += freq >> 7; + break; + case 5: + case 7: + freq -= freq >> 8; + break; + case 6: + freq -= freq >> 7; + break; + } + } + /* Apply block */ + freq = (freq << block) >> 1; + + chip->pg_inc = (freq * pg_multi[chip->c_multi]) >> 1; +} + +void OPLL_EnvelopeKSLTL(opll_t *chip) +{ + int32_t ksl; + + ksl = eg_ksltable[chip->c_ksl_freq]-((8-chip->c_ksl_block)<<3); + if (ksl < 0) { + ksl = 0; + } + + ksl <<= 1; + + if (chip->c_ksl) { + ksl = ksl >> (3-chip->c_ksl); + } else { + ksl = 0; + } + + chip->eg_ksltl = ksl + (chip->c_tl<<1); +} + +void OPLL_EnvelopeOutput(opll_t *chip) +{ + int32_t level = chip->eg_level[(chip->cycles+17)%18]; + + level += chip->eg_ksltl; + + if (chip->c_am) { + level += chip->lfo_am_out; + } + + if (level >= 128) { + level = 127; + } + + if (chip->testmode & 0x01) { + level = 0; + } + + chip->eg_out = level; +} + +void OPLL_EnvelopeGenerate(opll_t *chip) { + uint8_t timer_inc; + uint8_t timer_bit; + uint8_t timer_low; + uint8_t rate; + uint8_t state_rate; + uint8_t ksr; + uint8_t sum; + uint8_t rate_hi; + uint8_t rate_lo; + int32_t level; + int32_t next_level; + uint8_t zero; + uint8_t state; + uint8_t next_state; + int32_t step; + int32_t sl; + uint32_t mcsel = ((chip->cycles + 1) / 3) & 0x01; + + + /* EG timer */ + if ((chip->eg_counter_state & 3) != 3) { + timer_inc = 0; + } else if (chip->cycles == 0) { + timer_inc = 1; + } else { + timer_inc = chip->eg_timer_carry; + } + timer_low = chip->eg_timer & 3; + timer_bit = chip->eg_timer & 1; + timer_bit += timer_inc; + chip->eg_timer_carry = timer_bit >> 1; + chip->eg_timer = ((timer_bit & 1) << 17) | (chip->eg_timer >> 1); + if (chip->testmode & 0x08) { + chip->eg_timer &= 0x2ffff; + chip->eg_timer |= (chip->write_data << (16 - 2)) & 0x10000; + } + if (!chip->eg_timer_shift_stop && ((chip->eg_timer >> 16) & 1)) { + chip->eg_timer_shift = chip->cycles; + } + if (chip->cycles == 0 && (chip->eg_counter_state_prev & 1) == 1) { + chip->eg_timer_low_lock = timer_low; + chip->eg_timer_shift_lock = chip->eg_timer_shift; + if (chip->eg_timer_shift_lock > 13) + chip->eg_timer_shift_lock = 0; + + chip->eg_timer_shift = 0; + } + chip->eg_timer_shift_stop |= (chip->eg_timer >> 16) & 1; + if (chip->cycles == 0) { + chip->eg_timer_shift_stop = 0; + } + chip->eg_counter_state_prev = chip->eg_counter_state; + if (chip->cycles == 17) { + chip->eg_counter_state++; + } + + level = chip->eg_level[(chip->cycles+16)%18]; + next_level = level; + zero = level == 0; + chip->eg_silent = level == 0x7f; + + if (chip->eg_state[(chip->cycles+16)%18] != eg_num_attack && (chip->eg_off&2) && !(chip->eg_dokon&2)) { + next_level = 0x7f; + } + + if (chip->eg_maxrate && (chip->eg_dokon&2)) { + next_level = 0x00; + } + + + state = chip->eg_state[(chip->cycles+16)%18]; + next_state = eg_num_attack; + + step = 0; + sl = chip->eg_sl; + + switch (state) { + case eg_num_attack: + if (!chip->eg_maxrate && (chip->eg_kon & 2) && !zero) { + int32_t shift = chip->eg_rate_hi - 11 + chip->eg_inc_hi; + if (chip->eg_inc_lo) { + shift = 1; + } + if (shift > 0) { + if (shift > 4) + shift = 4; + step = ~level >> (5 - shift); + } + } + if (zero) { + next_state = eg_num_decay; + } else { + next_state = eg_num_attack; + } + break; + case eg_num_decay: + if (!(chip->eg_off & 2) && !(chip->eg_dokon & 2) && (level >> 3) != sl) + { + uint8_t i0 = chip->eg_rate_hi == 15 || (chip->eg_rate_hi == 14 && chip->eg_inc_hi); + uint8_t i1 = (chip->eg_rate_hi == 14 && !chip->eg_inc_hi) || (chip->eg_rate_hi == 13 && chip->eg_inc_hi) || + (chip->eg_rate_hi == 13 && !chip->eg_inc_hi && (chip->eg_counter_state_prev & 1)) + || (chip->eg_rate_hi == 12 && chip->eg_inc_hi && (chip->eg_counter_state_prev & 1)) + || (chip->eg_rate_hi == 12 && !chip->eg_inc_hi && ((chip->eg_counter_state_prev & 3) == 3)) + || (chip->eg_inc_lo && ((chip->eg_counter_state_prev & 3) == 3)); + step = (i0<<1) | i1; + } + if ((level >> 3) == sl) { + next_state = eg_num_sustain; + } else { + next_state = eg_num_decay; + } + break; + case eg_num_sustain: + case eg_num_release: + if (!(chip->eg_off & 2) && !(chip->eg_dokon & 2)) + { + uint8_t i0 = chip->eg_rate_hi == 15 || (chip->eg_rate_hi == 14 && chip->eg_inc_hi); + uint8_t i1 = (chip->eg_rate_hi == 14 && !chip->eg_inc_hi) || (chip->eg_rate_hi == 13 && chip->eg_inc_hi) || + (chip->eg_rate_hi == 13 && !chip->eg_inc_hi && (chip->eg_counter_state_prev & 1)) + || (chip->eg_rate_hi == 12 && chip->eg_inc_hi && (chip->eg_counter_state_prev & 1)) + || (chip->eg_rate_hi == 12 && !chip->eg_inc_hi && ((chip->eg_counter_state_prev & 3) == 3)) + || (chip->eg_inc_lo && ((chip->eg_counter_state_prev & 3) == 3)); + step = (i0<<1) | i1; + } + next_state = state; + break; + } + + if (!(chip->eg_kon & 2)) { + next_state = eg_num_release; + } + if (chip->eg_dokon & 2) { + next_state = eg_num_attack; + } + + chip->eg_level[(chip->cycles+16)%18] = next_level+step; + chip->eg_state[(chip->cycles+16)%18] = next_state; + + rate_hi = chip->eg_rate >> 2; + rate_lo = chip->eg_rate & 3; + chip->eg_inc_hi = eg_stephi[rate_lo][chip->eg_timer_low_lock]; + sum = (chip->eg_timer_shift_lock + rate_hi) & 0x0f; + chip->eg_inc_lo = 0; + if (rate_hi < 12 && !chip->eg_zerorate) { + switch (sum) { + case 12: + chip->eg_inc_lo = 1; + break; + case 13: + chip->eg_inc_lo = (rate_lo >> 1) & 1; + break; + case 14: + chip->eg_inc_lo = rate_lo & 1; + break; + } + } + chip->eg_maxrate = rate_hi == 0x0f; + + chip->eg_rate_hi = rate_hi; + + chip->eg_kon <<= 1; + chip->eg_kon |= chip->kon[ch_offset[chip->cycles]]; + chip->eg_off <<= 1; + chip->eg_off |= (chip->eg_level[chip->cycles] >> 2) == 0x1f; + switch (chip->rm_select) { + case rm_num_bd0: + case rm_num_bd1: + chip->eg_kon |= (chip->rhythm >> 4) & 1; + break; + case rm_num_sd: + chip->eg_kon |= (chip->rhythm >> 3) & 1; + break; + case rm_num_tom: + chip->eg_kon |= (chip->rhythm >> 2) & 1; + break; + case rm_num_tc: + chip->eg_kon |= (chip->rhythm >> 1) & 1; + break; + case rm_num_hh: + chip->eg_kon |= chip->rhythm & 1; + break; + } + + /* Calculate rate */ + rate = 0; + chip->eg_dokon <<= 1; + state_rate = chip->eg_state[chip->cycles]; + if (state_rate == eg_num_release && (chip->eg_kon&1) && (chip->eg_off&1)) { + state_rate = eg_num_attack; + chip->eg_dokon |= 1; + } + switch (state_rate) { + case eg_num_attack: + rate = chip->c_adrr[0]; + break; + case eg_num_decay: + rate = chip->c_adrr[1]; + break; + case eg_num_sustain: + if (!chip->c_et) { + rate = chip->c_adrr[2]; + } + break; + case eg_num_release: + if (chip->son[ch_offset[chip->cycles]]) { + rate = 5; + } else { + rate = chip->c_adrr[2]; + } + break; + } + if (!(chip->eg_kon&1) && !mcsel && chip->rm_select != rm_num_tom && chip->rm_select != rm_num_hh) { + rate = 0; + } + if ((chip->eg_kon&1) && chip->eg_state[chip->cycles] == eg_num_release && !(chip->eg_off&1)) { + rate = 12; + } + if (!(chip->eg_kon&1) && !chip->son[ch_offset[chip->cycles]] && mcsel == 1 && !chip->c_et) { + rate = 7; + } + chip->eg_zerorate = rate == 0; + ksr = chip->c_ksr_freq; + if (!chip->c_ksr) + ksr >>= 2; + chip->eg_rate = (rate << 2) + ksr; + if (chip->eg_rate & 0x40) { + chip->eg_rate = 0x3c | (ksr & 3); + } + chip->eg_sl = chip->c_sl; +} + +void OPLL_Channel(opll_t *chip) { + int16_t sign; + int16_t ch_out = chip->ch_out; + uint8_t ismod = (chip->cycles / 3) & 1; + uint8_t mute_m = ismod || ((chip->rm_enable&0x40) && (chip->cycles+15)%18 >= 12); + uint8_t mute_r = 1; + if (chip->chip_type == opll_type_ds1001) { + chip->output_m = ch_out; + if (chip->output_m >= 0) { + chip->output_m++; + } + if (mute_m) { + chip->output_m = 0; + } + chip->output_r = 0; + return; + } else { + /* TODO: This might be incorrect */ + if ((chip->rm_enable & 0x40)) { + switch (chip->cycles) { + case 16: /* HH */ + case 17: /* TOM */ + case 0: /* BD */ + case 1: /* SD */ + case 2: /* TC */ + case 3: /* HH */ + case 4: /* TOM */ + case 5: /* BD */ + case 9: /* TOM */ + case 10: /* TOM */ + mute_r = 0; + break; + } + } + if (chip->chip_type == opll_type_ym2413b || chip->chip_type == opll_type_ymf281b) { + if (mute_m) + chip->output_m = 0; + else + chip->output_m = ch_out; + if (mute_r) + chip->output_r = 0; + else + chip->output_r = ch_out; + } else { + sign = ch_out >> 8; + if (ch_out >= 0) { + ch_out++; + sign++; + } + if (mute_m) + chip->output_m = sign; + else + chip->output_m = ch_out; + if (mute_r) + chip->output_r = sign; + else + chip->output_r = ch_out; + } + } +} + +void OPLL_Operator(opll_t *chip) { + uint8_t ismod1, ismod2, ismod3; + uint32_t op_mod; + uint16_t exp_shift; + int16_t output; + uint32_t level; + uint32_t phase; + int16_t routput; + if ((chip->rm_enable & 0x80) && (chip->cycles == 15 || chip->cycles == 16)) { + ismod1 = 0; + } else { + ismod1 = ((chip->cycles + 1) / 3) & 1; + } + if ((chip->rm_enable & 0x40) && (chip->cycles == 13 || chip->cycles == 14)) { + ismod2 = 0; + } else { + ismod2 = ((chip->cycles + 3) / 3) & 1; + } + if ((chip->rm_enable & 0x40) && (chip->cycles == 16 || chip->cycles == 17)) { + ismod3 = 0; + } else { + ismod3 = (chip->cycles / 3) & 1; + } + + op_mod = 0; + + if (ismod3) { + op_mod |= chip->op_mod << 1; + } + + if (ismod2 && chip->c_fb) { + op_mod |= chip->op_fbsum >> (7 - chip->c_fb); + } + + exp_shift = chip->op_exp_s; + if (chip->eg_silent || ((chip->op_neg&2) && (ismod1 ? (chip->c_dm&4) : (chip->c_dc&4)))) { + exp_shift |= 12; + } + + output = chip->op_exp_m>>exp_shift; + if (!chip->eg_silent && (chip->op_neg&2)) { + output = ~output; + } + + level = chip->op_logsin+(chip->eg_out<<4); + if (level >= 4096) { + level = 4095; + } + + chip->op_exp_m = exprom[level & 0xff]; + chip->op_exp_s = level >> 8; + + phase = (op_mod + chip->pg_out) & 0x3ff; + if (phase & 0x100) { + phase ^= 0xff; + } + chip->op_logsin = logsinrom[phase & 0xff]; + chip->op_neg <<= 1; + chip->op_neg |= phase >> 9; + chip->op_fbsum = (chip->op_fb1[(chip->cycles + 3) % 9] + chip->op_fb2[(chip->cycles + 3) % 9]) >> 1; + + if (ismod1) { + chip->op_fb2[chip->cycles%9] = chip->op_fb1[chip->cycles%9]; + chip->op_fb1[chip->cycles%9] = output; + } + chip->op_mod = output&0x1ff; + + if (chip->chip_type == opll_type_ds1001) { + routput = 0; + } else { + switch (chip->cycles) { + case 2: + routput = chip->ch_out_hh; + break; + case 3: + routput = chip->ch_out_tm; + break; + case 4: + routput = chip->ch_out_bd; + break; + case 8: + routput = chip->ch_out_sd; + break; + case 9: + routput = chip->ch_out_tc; + break; + default: + routput = 0; /* TODO: Not quite true */ + break; + } + switch (chip->cycles) { + case 15: + chip->ch_out_hh = output>>3; + break; + case 16: + chip->ch_out_tm = output>>3; + break; + case 17: + chip->ch_out_bd = output>>3; + break; + case 0: + chip->ch_out_sd = output>>3; + break; + case 1: + chip->ch_out_tc = output>>3; + break; + default: + break; + } + } + + chip->ch_out = ismod1 ? routput : (output>>3); +} + +void OPLL_DoRhythm(opll_t *chip) { + uint8_t nbit; + + /* Noise */ + nbit = (chip->rm_noise ^ (chip->rm_noise >> 14)) & 0x01; + nbit |= (chip->rm_noise == 0x00) | ((chip->testmode >> 1) & 0x01); + chip->rm_noise = (nbit << 22) | (chip->rm_noise >> 1); +} + +void OPLL_DoLFO(opll_t *chip) { + uint8_t vib_step; + uint8_t am_inc = 0; + uint8_t am_bit; + + /* Update counter */ + if (chip->cycles == 17) { + vib_step = ((chip->lfo_counter & 0x3ff) + 1) >> 10; + chip->lfo_am_step = ((chip->lfo_counter & 0x3f) + 1) >> 6; + vib_step |= (chip->testmode >> 3) & 0x01; + chip->lfo_vib_counter += vib_step; + chip->lfo_vib_counter &= 0x07; + chip->lfo_counter++; + } + + /* LFO AM */ + if ((chip->lfo_am_step || (chip->testmode & 0x08)) && chip->cycles < 9) { + am_inc = chip->lfo_am_dir | (chip->cycles == 0); + } + + if (chip->cycles >= 9) { + chip->lfo_am_car = 0; + } + + if (chip->cycles == 0) { + if (chip->lfo_am_dir && (chip->lfo_am_counter & 0x7f) == 0) { + chip->lfo_am_dir = 0; + } else if (!chip->lfo_am_dir && (chip->lfo_am_counter & 0x69) == 0x69) { + chip->lfo_am_dir = 1; + } + } + + am_bit = chip->lfo_am_counter & 0x01; + am_bit += am_inc + chip->lfo_am_car; + chip->lfo_am_car = am_bit >> 1; + am_bit &= 0x01; + chip->lfo_am_counter = (am_bit << 8) | (chip->lfo_am_counter >> 1); + + + /* Reset LFO */ + if (chip->testmode & 0x02) { + chip->lfo_vib_counter = 0; + chip->lfo_counter = 0; + chip->lfo_am_dir = 0; + chip->lfo_am_counter &= 0xff; + } +} + + +void OPLL_Clock(opll_t *chip, int32_t *buffer) { + buffer[0] = chip->output_m; + buffer[1] = chip->output_r; + if (chip->cycles == 0) { + chip->lfo_am_out = (chip->lfo_am_counter >> 3) & 0x0f; + } + chip->rm_enable >>= 1; + OPLL_DoModeWrite(chip); + chip->rm_select++; + if (chip->rm_select > rm_num_tc) { + chip->rm_select = rm_num_tc + 1; + } + if (chip->cycles == 11 && (chip->rm_enable & 0x80) == 0x80) { + chip->rm_select = rm_num_bd0; + } + OPLL_PreparePatch1(chip); + + OPLL_Channel(chip); + + OPLL_PhaseGenerate(chip); + + OPLL_Operator(chip); + + OPLL_PhaseCalcIncrement(chip); + + OPLL_EnvelopeOutput(chip); + OPLL_EnvelopeKSLTL(chip); + OPLL_EnvelopeGenerate(chip); + + OPLL_DoLFO(chip); + OPLL_DoRhythm(chip); + OPLL_PreparePatch2(chip); + OPLL_DoRegWrite(chip); + OPLL_DoIO(chip); + chip->cycles = (chip->cycles + 1) % 18; + +} + + +void OPLL_Write(opll_t *chip, uint32_t port, uint8_t data) { + chip->write_data = data; + if (port & 1) { + /* Data */ + chip->write_d |= 1; + } else { + /* Address */ + chip->write_a |= 1; + } +} diff --git a/Core/opll.h b/Core/opll.h new file mode 100644 index 00000000..c3e02e8c --- /dev/null +++ b/Core/opll.h @@ -0,0 +1,199 @@ +/* + * Copyright (C) 2019 Nuke.YKT + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * + * Yamaha YM2413 emulator + * Thanks: + * siliconpr0n.org(digshadow, John McMaster): + * VRC VII decap and die shot. + * + * version: 1.0.1 + */ + +#ifndef OPLL_H +#define OPLL_H + +#include + +enum { + opll_type_ym2413 = 0x00, /* Yamaha YM2413 */ + opll_type_ds1001, /* Konami VRC VII */ + opll_type_ym2413b, /* Yamaha YM2413B */ + opll_type_ymf281, /* Yamaha YMF281 */ + opll_type_ymf281b, /* Yamaha YMF281B */ + opll_type_ym2420, /* Yamaha YM2420 */ + opll_type_ym2423, /* Yamaha YM2423 */ +}; + +enum { + opll_patch_1 = 0x00, + opll_patch_2, + opll_patch_3, + opll_patch_4, + opll_patch_5, + opll_patch_6, + opll_patch_7, + opll_patch_8, + opll_patch_9, + opll_patch_10, + opll_patch_11, + opll_patch_12, + opll_patch_13, + opll_patch_14, + opll_patch_15, + opll_patch_drum_0, + opll_patch_drum_1, + opll_patch_drum_2, + opll_patch_drum_3, + opll_patch_drum_4, + opll_patch_drum_5, + opll_patch_max +}; + +typedef struct { + uint8_t tl; + uint8_t dc; + uint8_t dm; + uint8_t fb; + uint8_t am[2]; + uint8_t vib[2]; + uint8_t et[2]; + uint8_t ksr[2]; + uint8_t multi[2]; + uint8_t ksl[2]; + uint8_t ar[2]; + uint8_t dr[2]; + uint8_t sl[2]; + uint8_t rr[2]; +} opll_patch_t; + +typedef struct { + uint32_t chip_type; + uint32_t cycles; + uint32_t slot; + const opll_patch_t *patchrom; + /* IO */ + uint8_t write_data; + uint8_t write_a; + uint8_t write_d; + uint8_t write_a_en; + uint8_t write_d_en; + uint8_t write_fm_address; + uint8_t write_fm_data; + uint8_t write_mode_address; + uint8_t address; + uint8_t data; + /* Envelope generator */ + uint8_t eg_counter_state; + uint8_t eg_counter_state_prev; + uint32_t eg_timer; + uint8_t eg_timer_low_lock; + uint8_t eg_timer_carry; + uint8_t eg_timer_shift; + uint8_t eg_timer_shift_lock; + uint8_t eg_timer_shift_stop; + uint8_t eg_state[18]; + uint8_t eg_level[18]; + uint8_t eg_kon; + uint32_t eg_dokon; + uint8_t eg_off; + uint8_t eg_rate; + uint8_t eg_maxrate; + uint8_t eg_zerorate; + uint8_t eg_inc_lo; + uint8_t eg_inc_hi; + uint8_t eg_rate_hi; + uint16_t eg_sl; + uint16_t eg_ksltl; + uint8_t eg_out; + uint8_t eg_silent; + /* Phase generator */ + uint16_t pg_fnum; + uint8_t pg_block; + uint16_t pg_out; + uint32_t pg_inc; + uint32_t pg_phase[18]; + uint32_t pg_phase_next; + /* Operator */ + int16_t op_fb1[9]; + int16_t op_fb2[9]; + int16_t op_fbsum; + int16_t op_mod; + uint8_t op_neg; + uint16_t op_logsin; + uint16_t op_exp_m; + uint16_t op_exp_s; + /* Channel */ + int16_t ch_out; + int16_t ch_out_hh; + int16_t ch_out_tm; + int16_t ch_out_bd; + int16_t ch_out_sd; + int16_t ch_out_tc; + /* LFO */ + uint16_t lfo_counter; + uint8_t lfo_vib_counter; + uint16_t lfo_am_counter; + uint8_t lfo_am_step; + uint8_t lfo_am_dir; + uint8_t lfo_am_car; + uint8_t lfo_am_out; + /* Register set */ + uint16_t fnum[9]; + uint8_t block[9]; + uint8_t kon[9]; + uint8_t son[9]; + uint8_t vol[9]; + uint8_t inst[9]; + uint8_t rhythm; + uint8_t testmode; + opll_patch_t patch; + uint8_t c_instr; + uint8_t c_op; + uint8_t c_tl; + uint8_t c_dc; + uint8_t c_dm; + uint8_t c_fb; + uint8_t c_am; + uint8_t c_vib; + uint8_t c_et; + uint8_t c_ksr; + uint8_t c_ksr_freq; + uint8_t c_ksl_freq; + uint8_t c_ksl_block; + uint8_t c_multi; + uint8_t c_ksl; + uint8_t c_adrr[3]; + uint8_t c_sl; + uint16_t c_fnum; + uint16_t c_block; + /* Rhythm mode */ + int8_t rm_enable; + uint32_t rm_noise; + uint32_t rm_select; + uint8_t rm_hh_bit2; + uint8_t rm_hh_bit3; + uint8_t rm_hh_bit7; + uint8_t rm_hh_bit8; + uint8_t rm_tc_bit3; + uint8_t rm_tc_bit5; + + int16_t output_m; + int16_t output_r; + +} opll_t; + +void OPLL_Reset(opll_t *chip, uint32_t chip_type); +void OPLL_Clock(opll_t *chip, int32_t *buffer); +void OPLL_Write(opll_t *chip, uint32_t port, uint8_t data); +#endif diff --git a/Core/ym3438.cpp b/Core/ym3438.cpp new file mode 100644 index 00000000..1b6d7599 --- /dev/null +++ b/Core/ym3438.cpp @@ -0,0 +1,1429 @@ +/* + * Copyright (C) 2017-2018 Alexey Khokholov (Nuke.YKT) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * + * Nuked OPN2(Yamaha YM3438) emulator. + * Thanks: + * Silicon Pr0n: + * Yamaha YM3438 decap and die shot(digshadow). + * OPLx decapsulated(Matthew Gambrell, Olli Niemitalo): + * OPL2 ROMs. + * + * version: 1.0.10 + */ + +#include "stdafx.h" + +#include +#include "ym3438.h" + +enum { + eg_num_attack = 0, + eg_num_decay = 1, + eg_num_sustain = 2, + eg_num_release = 3 +}; + +/* logsin table */ +static const Bit16u logsinrom[256] = { + 0x859, 0x6c3, 0x607, 0x58b, 0x52e, 0x4e4, 0x4a6, 0x471, + 0x443, 0x41a, 0x3f5, 0x3d3, 0x3b5, 0x398, 0x37e, 0x365, + 0x34e, 0x339, 0x324, 0x311, 0x2ff, 0x2ed, 0x2dc, 0x2cd, + 0x2bd, 0x2af, 0x2a0, 0x293, 0x286, 0x279, 0x26d, 0x261, + 0x256, 0x24b, 0x240, 0x236, 0x22c, 0x222, 0x218, 0x20f, + 0x206, 0x1fd, 0x1f5, 0x1ec, 0x1e4, 0x1dc, 0x1d4, 0x1cd, + 0x1c5, 0x1be, 0x1b7, 0x1b0, 0x1a9, 0x1a2, 0x19b, 0x195, + 0x18f, 0x188, 0x182, 0x17c, 0x177, 0x171, 0x16b, 0x166, + 0x160, 0x15b, 0x155, 0x150, 0x14b, 0x146, 0x141, 0x13c, + 0x137, 0x133, 0x12e, 0x129, 0x125, 0x121, 0x11c, 0x118, + 0x114, 0x10f, 0x10b, 0x107, 0x103, 0x0ff, 0x0fb, 0x0f8, + 0x0f4, 0x0f0, 0x0ec, 0x0e9, 0x0e5, 0x0e2, 0x0de, 0x0db, + 0x0d7, 0x0d4, 0x0d1, 0x0cd, 0x0ca, 0x0c7, 0x0c4, 0x0c1, + 0x0be, 0x0bb, 0x0b8, 0x0b5, 0x0b2, 0x0af, 0x0ac, 0x0a9, + 0x0a7, 0x0a4, 0x0a1, 0x09f, 0x09c, 0x099, 0x097, 0x094, + 0x092, 0x08f, 0x08d, 0x08a, 0x088, 0x086, 0x083, 0x081, + 0x07f, 0x07d, 0x07a, 0x078, 0x076, 0x074, 0x072, 0x070, + 0x06e, 0x06c, 0x06a, 0x068, 0x066, 0x064, 0x062, 0x060, + 0x05e, 0x05c, 0x05b, 0x059, 0x057, 0x055, 0x053, 0x052, + 0x050, 0x04e, 0x04d, 0x04b, 0x04a, 0x048, 0x046, 0x045, + 0x043, 0x042, 0x040, 0x03f, 0x03e, 0x03c, 0x03b, 0x039, + 0x038, 0x037, 0x035, 0x034, 0x033, 0x031, 0x030, 0x02f, + 0x02e, 0x02d, 0x02b, 0x02a, 0x029, 0x028, 0x027, 0x026, + 0x025, 0x024, 0x023, 0x022, 0x021, 0x020, 0x01f, 0x01e, + 0x01d, 0x01c, 0x01b, 0x01a, 0x019, 0x018, 0x017, 0x017, + 0x016, 0x015, 0x014, 0x014, 0x013, 0x012, 0x011, 0x011, + 0x010, 0x00f, 0x00f, 0x00e, 0x00d, 0x00d, 0x00c, 0x00c, + 0x00b, 0x00a, 0x00a, 0x009, 0x009, 0x008, 0x008, 0x007, + 0x007, 0x007, 0x006, 0x006, 0x005, 0x005, 0x005, 0x004, + 0x004, 0x004, 0x003, 0x003, 0x003, 0x002, 0x002, 0x002, + 0x002, 0x001, 0x001, 0x001, 0x001, 0x001, 0x001, 0x001, + 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000 +}; + +/* exp table */ +static const Bit16u exprom[256] = { + 0x000, 0x003, 0x006, 0x008, 0x00b, 0x00e, 0x011, 0x014, + 0x016, 0x019, 0x01c, 0x01f, 0x022, 0x025, 0x028, 0x02a, + 0x02d, 0x030, 0x033, 0x036, 0x039, 0x03c, 0x03f, 0x042, + 0x045, 0x048, 0x04b, 0x04e, 0x051, 0x054, 0x057, 0x05a, + 0x05d, 0x060, 0x063, 0x066, 0x069, 0x06c, 0x06f, 0x072, + 0x075, 0x078, 0x07b, 0x07e, 0x082, 0x085, 0x088, 0x08b, + 0x08e, 0x091, 0x094, 0x098, 0x09b, 0x09e, 0x0a1, 0x0a4, + 0x0a8, 0x0ab, 0x0ae, 0x0b1, 0x0b5, 0x0b8, 0x0bb, 0x0be, + 0x0c2, 0x0c5, 0x0c8, 0x0cc, 0x0cf, 0x0d2, 0x0d6, 0x0d9, + 0x0dc, 0x0e0, 0x0e3, 0x0e7, 0x0ea, 0x0ed, 0x0f1, 0x0f4, + 0x0f8, 0x0fb, 0x0ff, 0x102, 0x106, 0x109, 0x10c, 0x110, + 0x114, 0x117, 0x11b, 0x11e, 0x122, 0x125, 0x129, 0x12c, + 0x130, 0x134, 0x137, 0x13b, 0x13e, 0x142, 0x146, 0x149, + 0x14d, 0x151, 0x154, 0x158, 0x15c, 0x160, 0x163, 0x167, + 0x16b, 0x16f, 0x172, 0x176, 0x17a, 0x17e, 0x181, 0x185, + 0x189, 0x18d, 0x191, 0x195, 0x199, 0x19c, 0x1a0, 0x1a4, + 0x1a8, 0x1ac, 0x1b0, 0x1b4, 0x1b8, 0x1bc, 0x1c0, 0x1c4, + 0x1c8, 0x1cc, 0x1d0, 0x1d4, 0x1d8, 0x1dc, 0x1e0, 0x1e4, + 0x1e8, 0x1ec, 0x1f0, 0x1f5, 0x1f9, 0x1fd, 0x201, 0x205, + 0x209, 0x20e, 0x212, 0x216, 0x21a, 0x21e, 0x223, 0x227, + 0x22b, 0x230, 0x234, 0x238, 0x23c, 0x241, 0x245, 0x249, + 0x24e, 0x252, 0x257, 0x25b, 0x25f, 0x264, 0x268, 0x26d, + 0x271, 0x276, 0x27a, 0x27f, 0x283, 0x288, 0x28c, 0x291, + 0x295, 0x29a, 0x29e, 0x2a3, 0x2a8, 0x2ac, 0x2b1, 0x2b5, + 0x2ba, 0x2bf, 0x2c4, 0x2c8, 0x2cd, 0x2d2, 0x2d6, 0x2db, + 0x2e0, 0x2e5, 0x2e9, 0x2ee, 0x2f3, 0x2f8, 0x2fd, 0x302, + 0x306, 0x30b, 0x310, 0x315, 0x31a, 0x31f, 0x324, 0x329, + 0x32e, 0x333, 0x338, 0x33d, 0x342, 0x347, 0x34c, 0x351, + 0x356, 0x35b, 0x360, 0x365, 0x36a, 0x370, 0x375, 0x37a, + 0x37f, 0x384, 0x38a, 0x38f, 0x394, 0x399, 0x39f, 0x3a4, + 0x3a9, 0x3ae, 0x3b4, 0x3b9, 0x3bf, 0x3c4, 0x3c9, 0x3cf, + 0x3d4, 0x3da, 0x3df, 0x3e4, 0x3ea, 0x3ef, 0x3f5, 0x3fa +}; + +/* Note table */ +static const Bit32u fn_note[16] = { + 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 3, 3, 3, 3, 3, 3 +}; + +/* Envelope generator */ +static const Bit32u eg_stephi[4][4] = { + { 0, 0, 0, 0 }, + { 1, 0, 0, 0 }, + { 1, 0, 1, 0 }, + { 1, 1, 1, 0 } +}; + +static const Bit8u eg_am_shift[4] = { + 7, 3, 1, 0 +}; + +/* Phase generator */ +static const Bit32u pg_detune[8] = { 16, 17, 19, 20, 22, 24, 27, 29 }; + +static const Bit32u pg_lfo_sh1[8][8] = { + { 7, 7, 7, 7, 7, 7, 7, 7 }, + { 7, 7, 7, 7, 7, 7, 7, 7 }, + { 7, 7, 7, 7, 7, 7, 1, 1 }, + { 7, 7, 7, 7, 1, 1, 1, 1 }, + { 7, 7, 7, 1, 1, 1, 1, 0 }, + { 7, 7, 1, 1, 0, 0, 0, 0 }, + { 7, 7, 1, 1, 0, 0, 0, 0 }, + { 7, 7, 1, 1, 0, 0, 0, 0 } +}; + +static const Bit32u pg_lfo_sh2[8][8] = { + { 7, 7, 7, 7, 7, 7, 7, 7 }, + { 7, 7, 7, 7, 2, 2, 2, 2 }, + { 7, 7, 7, 2, 2, 2, 7, 7 }, + { 7, 7, 2, 2, 7, 7, 2, 2 }, + { 7, 7, 2, 7, 7, 7, 2, 7 }, + { 7, 7, 7, 2, 7, 7, 2, 1 }, + { 7, 7, 7, 2, 7, 7, 2, 1 }, + { 7, 7, 7, 2, 7, 7, 2, 1 } +}; + +/* Address decoder */ +static const Bit32u op_offset[12] = { + 0x000, /* Ch1 OP1/OP2 */ + 0x001, /* Ch2 OP1/OP2 */ + 0x002, /* Ch3 OP1/OP2 */ + 0x100, /* Ch4 OP1/OP2 */ + 0x101, /* Ch5 OP1/OP2 */ + 0x102, /* Ch6 OP1/OP2 */ + 0x004, /* Ch1 OP3/OP4 */ + 0x005, /* Ch2 OP3/OP4 */ + 0x006, /* Ch3 OP3/OP4 */ + 0x104, /* Ch4 OP3/OP4 */ + 0x105, /* Ch5 OP3/OP4 */ + 0x106 /* Ch6 OP3/OP4 */ +}; + +static const Bit32u ch_offset[6] = { + 0x000, /* Ch1 */ + 0x001, /* Ch2 */ + 0x002, /* Ch3 */ + 0x100, /* Ch4 */ + 0x101, /* Ch5 */ + 0x102 /* Ch6 */ +}; + +/* LFO */ +static const Bit32u lfo_cycles[8] = { + 108, 77, 71, 67, 62, 44, 8, 5 +}; + +/* FM algorithm */ +static const Bit32u fm_algorithm[4][6][8] = { + { + { 1, 1, 1, 1, 1, 1, 1, 1 }, /* OP1_0 */ + { 1, 1, 1, 1, 1, 1, 1, 1 }, /* OP1_1 */ + { 0, 0, 0, 0, 0, 0, 0, 0 }, /* OP2 */ + { 0, 0, 0, 0, 0, 0, 0, 0 }, /* Last operator */ + { 0, 0, 0, 0, 0, 0, 0, 0 }, /* Last operator */ + { 0, 0, 0, 0, 0, 0, 0, 1 } /* Out */ + }, + { + { 0, 1, 0, 0, 0, 1, 0, 0 }, /* OP1_0 */ + { 0, 0, 0, 0, 0, 0, 0, 0 }, /* OP1_1 */ + { 1, 1, 1, 0, 0, 0, 0, 0 }, /* OP2 */ + { 0, 0, 0, 0, 0, 0, 0, 0 }, /* Last operator */ + { 0, 0, 0, 0, 0, 0, 0, 0 }, /* Last operator */ + { 0, 0, 0, 0, 0, 1, 1, 1 } /* Out */ + }, + { + { 0, 0, 0, 0, 0, 0, 0, 0 }, /* OP1_0 */ + { 0, 0, 0, 0, 0, 0, 0, 0 }, /* OP1_1 */ + { 0, 0, 0, 0, 0, 0, 0, 0 }, /* OP2 */ + { 1, 0, 0, 1, 1, 1, 1, 0 }, /* Last operator */ + { 0, 0, 0, 0, 0, 0, 0, 0 }, /* Last operator */ + { 0, 0, 0, 0, 1, 1, 1, 1 } /* Out */ + }, + { + { 0, 0, 1, 0, 0, 1, 0, 0 }, /* OP1_0 */ + { 0, 0, 0, 0, 0, 0, 0, 0 }, /* OP1_1 */ + { 0, 0, 0, 1, 0, 0, 0, 0 }, /* OP2 */ + { 1, 1, 0, 1, 1, 0, 0, 0 }, /* Last operator */ + { 0, 0, 1, 0, 0, 0, 0, 0 }, /* Last operator */ + { 1, 1, 1, 1, 1, 1, 1, 1 } /* Out */ + } +}; + +static Bit32u chip_type = ym3438_mode_readmode; + +void OPN2_DoIO(ym3438_t *chip) +{ + /* Write signal check */ + chip->write_a_en = (chip->write_a & 0x03) == 0x01; + chip->write_d_en = (chip->write_d & 0x03) == 0x01; + chip->write_a <<= 1; + chip->write_d <<= 1; + /* Busy counter */ + chip->busy = chip->write_busy; + chip->write_busy_cnt += chip->write_busy; + chip->write_busy = (chip->write_busy && !(chip->write_busy_cnt >> 5)) || chip->write_d_en; + chip->write_busy_cnt &= 0x1f; +} + +void OPN2_DoRegWrite(ym3438_t *chip) +{ + Bit32u i; + Bit32u slot = chip->cycles % 12; + Bit32u address; + Bit32u channel = chip->channel; + /* Update registers */ + if (chip->write_fm_data) + { + /* Slot */ + if (op_offset[slot] == (chip->address & 0x107)) + { + if (chip->address & 0x08) + { + /* OP2, OP4 */ + slot += 12; + } + address = chip->address & 0xf0; + switch (address) + { + case 0x30: /* DT, MULTI */ + chip->multi[slot] = chip->data & 0x0f; + if (!chip->multi[slot]) + { + chip->multi[slot] = 1; + } + else + { + chip->multi[slot] <<= 1; + } + chip->dt[slot] = (chip->data >> 4) & 0x07; + break; + case 0x40: /* TL */ + chip->tl[slot] = chip->data & 0x7f; + break; + case 0x50: /* KS, AR */ + chip->ar[slot] = chip->data & 0x1f; + chip->ks[slot] = (chip->data >> 6) & 0x03; + break; + case 0x60: /* AM, DR */ + chip->dr[slot] = chip->data & 0x1f; + chip->am[slot] = (chip->data >> 7) & 0x01; + break; + case 0x70: /* SR */ + chip->sr[slot] = chip->data & 0x1f; + break; + case 0x80: /* SL, RR */ + chip->rr[slot] = chip->data & 0x0f; + chip->sl[slot] = (chip->data >> 4) & 0x0f; + chip->sl[slot] |= (chip->sl[slot] + 1) & 0x10; + break; + case 0x90: /* SSG-EG */ + chip->ssg_eg[slot] = chip->data & 0x0f; + break; + default: + break; + } + } + + /* Channel */ + if (ch_offset[channel] == (chip->address & 0x103)) + { + address = chip->address & 0xfc; + switch (address) + { + case 0xa0: + chip->fnum[channel] = (chip->data & 0xff) | ((chip->reg_a4 & 0x07) << 8); + chip->block[channel] = (chip->reg_a4 >> 3) & 0x07; + chip->kcode[channel] = (chip->block[channel] << 2) | fn_note[chip->fnum[channel] >> 7]; + break; + case 0xa4: + chip->reg_a4 = chip->data & 0xff; + break; + case 0xa8: + chip->fnum_3ch[channel] = (chip->data & 0xff) | ((chip->reg_ac & 0x07) << 8); + chip->block_3ch[channel] = (chip->reg_ac >> 3) & 0x07; + chip->kcode_3ch[channel] = (chip->block_3ch[channel] << 2) | fn_note[chip->fnum_3ch[channel] >> 7]; + break; + case 0xac: + chip->reg_ac = chip->data & 0xff; + break; + case 0xb0: + chip->connect[channel] = chip->data & 0x07; + chip->fb[channel] = (chip->data >> 3) & 0x07; + break; + case 0xb4: + chip->pms[channel] = chip->data & 0x07; + chip->ams[channel] = (chip->data >> 4) & 0x03; + chip->pan_l[channel] = (chip->data >> 7) & 0x01; + chip->pan_r[channel] = (chip->data >> 6) & 0x01; + break; + default: + break; + } + } + } + + if (chip->write_a_en || chip->write_d_en) + { + /* Data */ + if (chip->write_a_en) + { + chip->write_fm_data = 0; + } + + if (chip->write_fm_address && chip->write_d_en) + { + chip->write_fm_data = 1; + } + + /* Address */ + if (chip->write_a_en) + { + if ((chip->write_data & 0xf0) != 0x00) + { + /* FM Write */ + chip->address = chip->write_data; + chip->write_fm_address = 1; + } + else + { + /* SSG write */ + chip->write_fm_address = 0; + } + } + + /* FM Mode */ + /* Data */ + if (chip->write_d_en && (chip->write_data & 0x100) == 0) + { + switch (chip->write_fm_mode_a) + { + case 0x21: /* LSI test 1 */ + for (i = 0; i < 8; i++) + { + chip->mode_test_21[i] = (chip->write_data >> i) & 0x01; + } + break; + case 0x22: /* LFO control */ + if ((chip->write_data >> 3) & 0x01) + { + chip->lfo_en = 0x7f; + } + else + { + chip->lfo_en = 0; + } + chip->lfo_freq = chip->write_data & 0x07; + break; + case 0x24: /* Timer A */ + chip->timer_a_reg &= 0x03; + chip->timer_a_reg |= (chip->write_data & 0xff) << 2; + break; + case 0x25: + chip->timer_a_reg &= 0x3fc; + chip->timer_a_reg |= chip->write_data & 0x03; + break; + case 0x26: /* Timer B */ + chip->timer_b_reg = chip->write_data & 0xff; + break; + case 0x27: /* CSM, Timer control */ + chip->mode_ch3 = (chip->write_data & 0xc0) >> 6; + chip->mode_csm = chip->mode_ch3 == 2; + chip->timer_a_load = chip->write_data & 0x01; + chip->timer_a_enable = (chip->write_data >> 2) & 0x01; + chip->timer_a_reset = (chip->write_data >> 4) & 0x01; + chip->timer_b_load = (chip->write_data >> 1) & 0x01; + chip->timer_b_enable = (chip->write_data >> 3) & 0x01; + chip->timer_b_reset = (chip->write_data >> 5) & 0x01; + break; + case 0x28: /* Key on/off */ + for (i = 0; i < 4; i++) + { + chip->mode_kon_operator[i] = (chip->write_data >> (4 + i)) & 0x01; + } + if ((chip->write_data & 0x03) == 0x03) + { + /* Invalid address */ + chip->mode_kon_channel = 0xff; + } + else + { + chip->mode_kon_channel = (chip->write_data & 0x03) + ((chip->write_data >> 2) & 1) * 3; + } + break; + case 0x2a: /* DAC data */ + chip->dacdata &= 0x01; + chip->dacdata |= (chip->write_data ^ 0x80) << 1; + break; + case 0x2b: /* DAC enable */ + chip->dacen = chip->write_data >> 7; + break; + case 0x2c: /* LSI test 2 */ + for (i = 0; i < 8; i++) + { + chip->mode_test_2c[i] = (chip->write_data >> i) & 0x01; + } + chip->dacdata &= 0x1fe; + chip->dacdata |= chip->mode_test_2c[3]; + chip->eg_custom_timer = !chip->mode_test_2c[7] && chip->mode_test_2c[6]; + break; + default: + break; + } + } + + /* Address */ + if (chip->write_a_en) + { + chip->write_fm_mode_a = chip->write_data & 0x1ff; + } + } + + if (chip->write_fm_data) + { + chip->data = chip->write_data & 0xff; + } +} + +void OPN2_PhaseCalcIncrement(ym3438_t *chip) +{ + Bit32u chan = chip->channel; + Bit32u slot = chip->cycles; + Bit32u fnum = chip->pg_fnum; + Bit32u fnum_h = fnum >> 4; + Bit32u fm; + Bit32u basefreq; + Bit8u lfo = chip->lfo_pm; + Bit8u lfo_l = lfo & 0x0f; + Bit8u pms = chip->pms[chan]; + Bit8u dt = chip->dt[slot]; + Bit8u dt_l = dt & 0x03; + Bit8u detune = 0; + Bit8u block, note; + Bit8u sum, sum_h, sum_l; + Bit8u kcode = chip->pg_kcode; + + fnum <<= 1; + /* Apply LFO */ + if (lfo_l & 0x08) + { + lfo_l ^= 0x0f; + } + fm = (fnum_h >> pg_lfo_sh1[pms][lfo_l]) + (fnum_h >> pg_lfo_sh2[pms][lfo_l]); + if (pms > 5) + { + fm <<= pms - 5; + } + fm >>= 2; + if (lfo & 0x10) + { + fnum -= fm; + } + else + { + fnum += fm; + } + fnum &= 0xfff; + + basefreq = (fnum << chip->pg_block) >> 2; + + /* Apply detune */ + if (dt_l) + { + if (kcode > 0x1c) + { + kcode = 0x1c; + } + block = kcode >> 2; + note = kcode & 0x03; + sum = block + 9 + ((dt_l == 3) | (dt_l & 0x02)); + sum_h = sum >> 1; + sum_l = sum & 0x01; + detune = pg_detune[(sum_l << 2) | note] >> (9 - sum_h); + } + if (dt & 0x04) + { + basefreq -= detune; + } + else + { + basefreq += detune; + } + basefreq &= 0x1ffff; + chip->pg_inc[slot] = (basefreq * chip->multi[slot]) >> 1; + chip->pg_inc[slot] &= 0xfffff; +} + +void OPN2_PhaseGenerate(ym3438_t *chip) +{ + Bit32u slot; + /* Mask increment */ + slot = (chip->cycles + 20) % 24; + if (chip->pg_reset[slot]) + { + chip->pg_inc[slot] = 0; + } + /* Phase step */ + slot = (chip->cycles + 19) % 24; + if (chip->pg_reset[slot] || chip->mode_test_21[3]) + { + chip->pg_phase[slot] = 0; + } + chip->pg_phase[slot] += chip->pg_inc[slot]; + chip->pg_phase[slot] &= 0xfffff; +} + +void OPN2_EnvelopeSSGEG(ym3438_t *chip) +{ + Bit32u slot = chip->cycles; + Bit8u direction = 0; + chip->eg_ssg_pgrst_latch[slot] = 0; + chip->eg_ssg_repeat_latch[slot] = 0; + chip->eg_ssg_hold_up_latch[slot] = 0; + chip->eg_ssg_inv[slot] = 0; + if (chip->ssg_eg[slot] & 0x08) + { + direction = chip->eg_ssg_dir[slot]; + if (chip->eg_level[slot] & 0x200) + { + /* Reset */ + if ((chip->ssg_eg[slot] & 0x03) == 0x00) + { + chip->eg_ssg_pgrst_latch[slot] = 1; + } + /* Repeat */ + if ((chip->ssg_eg[slot] & 0x01) == 0x00) + { + chip->eg_ssg_repeat_latch[slot] = 1; + } + /* Inverse */ + if ((chip->ssg_eg[slot] & 0x03) == 0x02) + { + direction ^= 1; + } + if ((chip->ssg_eg[slot] & 0x03) == 0x03) + { + direction = 1; + } + } + /* Hold up */ + if (chip->eg_kon_latch[slot] + && ((chip->ssg_eg[slot] & 0x07) == 0x05 || (chip->ssg_eg[slot] & 0x07) == 0x03)) + { + chip->eg_ssg_hold_up_latch[slot] = 1; + } + direction &= chip->eg_kon[slot]; + chip->eg_ssg_inv[slot] = (chip->eg_ssg_dir[slot] ^ ((chip->ssg_eg[slot] >> 2) & 0x01)) + & chip->eg_kon[slot]; + } + chip->eg_ssg_dir[slot] = direction; + chip->eg_ssg_enable[slot] = (chip->ssg_eg[slot] >> 3) & 0x01; +} + +void OPN2_EnvelopeADSR(ym3438_t *chip) +{ + Bit32u slot = (chip->cycles + 22) % 24; + + Bit8u nkon = chip->eg_kon_latch[slot]; + Bit8u okon = chip->eg_kon[slot]; + Bit8u kon_event; + Bit8u koff_event; + Bit8u eg_off; + Bit16s level; + Bit16s nextlevel = 0; + Bit16s ssg_level; + Bit8u nextstate = chip->eg_state[slot]; + Bit16s inc = 0; + chip->eg_read[0] = chip->eg_read_inc; + chip->eg_read_inc = chip->eg_inc > 0; + + /* Reset phase generator */ + chip->pg_reset[slot] = (nkon && !okon) || chip->eg_ssg_pgrst_latch[slot]; + + /* KeyOn/Off */ + kon_event = (nkon && !okon) || (okon && chip->eg_ssg_repeat_latch[slot]); + koff_event = okon && !nkon; + + ssg_level = level = (Bit16s)chip->eg_level[slot]; + + if (chip->eg_ssg_inv[slot]) + { + /* Inverse */ + ssg_level = 512 - level; + ssg_level &= 0x3ff; + } + if (koff_event) + { + level = ssg_level; + } + if (chip->eg_ssg_enable[slot]) + { + eg_off = level >> 9; + } + else + { + eg_off = (level & 0x3f0) == 0x3f0; + } + nextlevel = level; + if (kon_event) + { + nextstate = eg_num_attack; + /* Instant attack */ + if (chip->eg_ratemax) + { + nextlevel = 0; + } + else if (chip->eg_state[slot] == eg_num_attack && level != 0 && chip->eg_inc && nkon) + { + inc = (~level << chip->eg_inc) >> 5; + } + } + else + { + switch (chip->eg_state[slot]) + { + case eg_num_attack: + if (level == 0) + { + nextstate = eg_num_decay; + } + else if(chip->eg_inc && !chip->eg_ratemax && nkon) + { + inc = (~level << chip->eg_inc) >> 5; + } + break; + case eg_num_decay: + if ((level >> 5) == chip->eg_sl[1]) + { + nextstate = eg_num_sustain; + } + else if (!eg_off && chip->eg_inc) + { + inc = 1 << (chip->eg_inc - 1); + if (chip->eg_ssg_enable[slot]) + { + inc <<= 2; + } + } + break; + case eg_num_sustain: + case eg_num_release: + if (!eg_off && chip->eg_inc) + { + inc = 1 << (chip->eg_inc - 1); + if (chip->eg_ssg_enable[slot]) + { + inc <<= 2; + } + } + break; + default: + break; + } + if (!nkon) + { + nextstate = eg_num_release; + } + } + if (chip->eg_kon_csm[slot]) + { + nextlevel |= chip->eg_tl[1] << 3; + } + + /* Envelope off */ + if (!kon_event && !chip->eg_ssg_hold_up_latch[slot] && chip->eg_state[slot] != eg_num_attack && eg_off) + { + nextstate = eg_num_release; + nextlevel = 0x3ff; + } + + nextlevel += inc; + + chip->eg_kon[slot] = chip->eg_kon_latch[slot]; + chip->eg_level[slot] = (Bit16u)nextlevel & 0x3ff; + chip->eg_state[slot] = nextstate; +} + +void OPN2_EnvelopePrepare(ym3438_t *chip) +{ + Bit8u rate; + Bit8u sum; + Bit8u inc = 0; + Bit32u slot = chip->cycles; + Bit8u rate_sel; + + /* Prepare increment */ + rate = (chip->eg_rate << 1) + chip->eg_ksv; + + if (rate > 0x3f) + { + rate = 0x3f; + } + + sum = ((rate >> 2) + chip->eg_shift_lock) & 0x0f; + if (chip->eg_rate != 0 && chip->eg_quotient == 2) + { + if (rate < 48) + { + switch (sum) + { + case 12: + inc = 1; + break; + case 13: + inc = (rate >> 1) & 0x01; + break; + case 14: + inc = rate & 0x01; + break; + default: + break; + } + } + else + { + inc = eg_stephi[rate & 0x03][chip->eg_timer_low_lock] + (rate >> 2) - 11; + if (inc > 4) + { + inc = 4; + } + } + } + chip->eg_inc = inc; + chip->eg_ratemax = (rate >> 1) == 0x1f; + + /* Prepare rate & ksv */ + rate_sel = chip->eg_state[slot]; + if ((chip->eg_kon[slot] && chip->eg_ssg_repeat_latch[slot]) + || (!chip->eg_kon[slot] && chip->eg_kon_latch[slot])) + { + rate_sel = eg_num_attack; + } + switch (rate_sel) + { + case eg_num_attack: + chip->eg_rate = chip->ar[slot]; + break; + case eg_num_decay: + chip->eg_rate = chip->dr[slot]; + break; + case eg_num_sustain: + chip->eg_rate = chip->sr[slot]; + break; + case eg_num_release: + chip->eg_rate = (chip->rr[slot] << 1) | 0x01; + break; + default: + break; + } + chip->eg_ksv = chip->pg_kcode >> (chip->ks[slot] ^ 0x03); + if (chip->am[slot]) + { + chip->eg_lfo_am = chip->lfo_am >> eg_am_shift[chip->ams[chip->channel]]; + } + else + { + chip->eg_lfo_am = 0; + } + /* Delay TL & SL value */ + chip->eg_tl[1] = chip->eg_tl[0]; + chip->eg_tl[0] = chip->tl[slot]; + chip->eg_sl[1] = chip->eg_sl[0]; + chip->eg_sl[0] = chip->sl[slot]; +} + +void OPN2_EnvelopeGenerate(ym3438_t *chip) +{ + Bit32u slot = (chip->cycles + 23) % 24; + Bit16u level; + + level = chip->eg_level[slot]; + + if (chip->eg_ssg_inv[slot]) + { + /* Inverse */ + level = 512 - level; + } + if (chip->mode_test_21[5]) + { + level = 0; + } + level &= 0x3ff; + + /* Apply AM LFO */ + level += chip->eg_lfo_am; + + /* Apply TL */ + if (!(chip->mode_csm && chip->channel == 2 + 1)) + { + level += chip->eg_tl[0] << 3; + } + if (level > 0x3ff) + { + level = 0x3ff; + } + chip->eg_out[slot] = level; +} + +void OPN2_UpdateLFO(ym3438_t *chip) +{ + if ((chip->lfo_quotient & lfo_cycles[chip->lfo_freq]) == lfo_cycles[chip->lfo_freq]) + { + chip->lfo_quotient = 0; + chip->lfo_cnt++; + } + else + { + chip->lfo_quotient += chip->lfo_inc; + } + chip->lfo_cnt &= chip->lfo_en; +} + +void OPN2_FMPrepare(ym3438_t *chip) +{ + Bit32u slot = (chip->cycles + 6) % 24; + Bit32u channel = chip->channel; + Bit16s mod, mod1, mod2; + Bit32u op = slot / 6; + Bit8u connect = chip->connect[channel]; + Bit32u prevslot = (chip->cycles + 18) % 24; + + /* Calculate modulation */ + mod1 = mod2 = 0; + + if (fm_algorithm[op][0][connect]) + { + mod2 |= chip->fm_op1[channel][0]; + } + if (fm_algorithm[op][1][connect]) + { + mod1 |= chip->fm_op1[channel][1]; + } + if (fm_algorithm[op][2][connect]) + { + mod1 |= chip->fm_op2[channel]; + } + if (fm_algorithm[op][3][connect]) + { + mod2 |= chip->fm_out[prevslot]; + } + if (fm_algorithm[op][4][connect]) + { + mod1 |= chip->fm_out[prevslot]; + } + mod = mod1 + mod2; + if (op == 0) + { + /* Feedback */ + mod = mod >> (10 - chip->fb[channel]); + if (!chip->fb[channel]) + { + mod = 0; + } + } + else + { + mod >>= 1; + } + chip->fm_mod[slot] = mod; + + slot = (chip->cycles + 18) % 24; + /* OP1 */ + if (slot / 6 == 0) + { + chip->fm_op1[channel][1] = chip->fm_op1[channel][0]; + chip->fm_op1[channel][0] = chip->fm_out[slot]; + } + /* OP2 */ + if (slot / 6 == 2) + { + chip->fm_op2[channel] = chip->fm_out[slot]; + } +} + +void OPN2_ChGenerate(ym3438_t *chip) +{ + Bit32u slot = (chip->cycles + 18) % 24; + Bit32u channel = chip->channel; + Bit32u op = slot / 6; + Bit32u test_dac = chip->mode_test_2c[5]; + Bit16s acc = chip->ch_acc[channel]; + Bit16s add = test_dac; + Bit16s sum = 0; + if (op == 0 && !test_dac) + { + acc = 0; + } + if (fm_algorithm[op][5][chip->connect[channel]] && !test_dac) + { + add += chip->fm_out[slot] >> 5; + } + sum = acc + add; + /* Clamp */ + if (sum > 255) + { + sum = 255; + } + else if(sum < -256) + { + sum = -256; + } + + if (op == 0 || test_dac) + { + chip->ch_out[channel] = chip->ch_acc[channel]; + } + chip->ch_acc[channel] = sum; +} + +void OPN2_ChOutput(ym3438_t *chip) +{ + Bit32u cycles = chip->cycles; + Bit32u slot = chip->cycles; + Bit32u channel = chip->channel; + Bit32u test_dac = chip->mode_test_2c[5]; + Bit16s out; + Bit16s sign; + Bit32u out_en; + chip->ch_read = chip->ch_lock; + if (slot < 12) + { + /* Ch 4,5,6 */ + channel++; + } + if ((cycles & 3) == 0) + { + if (!test_dac) + { + /* Lock value */ + chip->ch_lock = chip->ch_out[channel]; + } + chip->ch_lock_l = chip->pan_l[channel]; + chip->ch_lock_r = chip->pan_r[channel]; + } + /* Ch 6 */ + if (((cycles >> 2) == 1 && chip->dacen) || test_dac) + { + out = (Bit16s)chip->dacdata; + out <<= 7; + out >>= 7; + } + else + { + out = chip->ch_lock; + } + chip->mol = 0; + chip->mor = 0; + + if (chip_type & ym3438_mode_ym2612) + { + out_en = ((cycles & 3) == 3) || test_dac; + /* YM2612 DAC emulation(not verified) */ + sign = out >> 8; + if (out >= 0) + { + out++; + sign++; + } + if (chip->ch_lock_l && out_en) + { + chip->mol = out; + } + else + { + chip->mol = sign; + } + if (chip->ch_lock_r && out_en) + { + chip->mor = out; + } + else + { + chip->mor = sign; + } + /* Amplify signal */ + chip->mol *= 3; + chip->mor *= 3; + } + else + { + out_en = ((cycles & 3) != 0) || test_dac; + if (chip->ch_lock_l && out_en) + { + chip->mol = out; + } + if (chip->ch_lock_r && out_en) + { + chip->mor = out; + } + } +} + +void OPN2_FMGenerate(ym3438_t *chip) +{ + Bit32u slot = (chip->cycles + 19) % 24; + /* Calculate phase */ + Bit16u phase = (chip->fm_mod[slot] + (chip->pg_phase[slot] >> 10)) & 0x3ff; + Bit16u quarter; + Bit16u level; + Bit16s output; + if (phase & 0x100) + { + quarter = (phase ^ 0xff) & 0xff; + } + else + { + quarter = phase & 0xff; + } + level = logsinrom[quarter]; + /* Apply envelope */ + level += chip->eg_out[slot] << 2; + /* Transform */ + if (level > 0x1fff) + { + level = 0x1fff; + } + output = ((exprom[(level & 0xff) ^ 0xff] | 0x400) << 2) >> (level >> 8); + if (phase & 0x200) + { + output = ((~output) ^ (chip->mode_test_21[4] << 13)) + 1; + } + else + { + output = output ^ (chip->mode_test_21[4] << 13); + } + output <<= 2; + output >>= 2; + chip->fm_out[slot] = output; +} + +void OPN2_DoTimerA(ym3438_t *chip) +{ + Bit16u time; + Bit8u load; + load = chip->timer_a_overflow; + if (chip->cycles == 2) + { + /* Lock load value */ + load |= (!chip->timer_a_load_lock && chip->timer_a_load); + chip->timer_a_load_lock = chip->timer_a_load; + if (chip->mode_csm) + { + /* CSM KeyOn */ + chip->mode_kon_csm = load; + } + else + { + chip->mode_kon_csm = 0; + } + } + /* Load counter */ + if (chip->timer_a_load_latch) + { + time = chip->timer_a_reg; + } + else + { + time = chip->timer_a_cnt; + } + chip->timer_a_load_latch = load; + /* Increase counter */ + if ((chip->cycles == 1 && chip->timer_a_load_lock) || chip->mode_test_21[2]) + { + time++; + } + /* Set overflow flag */ + if (chip->timer_a_reset) + { + chip->timer_a_reset = 0; + chip->timer_a_overflow_flag = 0; + } + else + { + chip->timer_a_overflow_flag |= chip->timer_a_overflow & chip->timer_a_enable; + } + chip->timer_a_overflow = (time >> 10); + chip->timer_a_cnt = time & 0x3ff; +} + +void OPN2_DoTimerB(ym3438_t *chip) +{ + Bit16u time; + Bit8u load; + load = chip->timer_b_overflow; + if (chip->cycles == 2) + { + /* Lock load value */ + load |= (!chip->timer_b_load_lock && chip->timer_b_load); + chip->timer_b_load_lock = chip->timer_b_load; + } + /* Load counter */ + if (chip->timer_b_load_latch) + { + time = chip->timer_b_reg; + } + else + { + time = chip->timer_b_cnt; + } + chip->timer_b_load_latch = load; + /* Increase counter */ + if (chip->cycles == 1) + { + chip->timer_b_subcnt++; + } + if ((chip->timer_b_subcnt == 0x10 && chip->timer_b_load_lock) || chip->mode_test_21[2]) + { + time++; + } + chip->timer_b_subcnt &= 0x0f; + /* Set overflow flag */ + if (chip->timer_b_reset) + { + chip->timer_b_reset = 0; + chip->timer_b_overflow_flag = 0; + } + else + { + chip->timer_b_overflow_flag |= chip->timer_b_overflow & chip->timer_b_enable; + } + chip->timer_b_overflow = (time >> 8); + chip->timer_b_cnt = time & 0xff; +} + +void OPN2_KeyOn(ym3438_t*chip) +{ + Bit32u slot = chip->cycles; + Bit32u chan = chip->channel; + /* Key On */ + chip->eg_kon_latch[slot] = chip->mode_kon[slot]; + chip->eg_kon_csm[slot] = 0; + if (chip->channel == 2 && chip->mode_kon_csm) + { + /* CSM Key On */ + chip->eg_kon_latch[slot] = 1; + chip->eg_kon_csm[slot] = 1; + } + if (chip->cycles == chip->mode_kon_channel) + { + /* OP1 */ + chip->mode_kon[chan] = chip->mode_kon_operator[0]; + /* OP2 */ + chip->mode_kon[chan + 12] = chip->mode_kon_operator[1]; + /* OP3 */ + chip->mode_kon[chan + 6] = chip->mode_kon_operator[2]; + /* OP4 */ + chip->mode_kon[chan + 18] = chip->mode_kon_operator[3]; + } +} + +void OPN2_Reset(ym3438_t *chip) +{ + Bit32u i; + memset(chip, 0, sizeof(ym3438_t)); + for (i = 0; i < 24; i++) + { + chip->eg_out[i] = 0x3ff; + chip->eg_level[i] = 0x3ff; + chip->eg_state[i] = eg_num_release; + chip->multi[i] = 1; + } + for (i = 0; i < 6; i++) + { + chip->pan_l[i] = 1; + chip->pan_r[i] = 1; + } +} + +void OPN2_SetChipType(Bit32u type) +{ + chip_type = type; +} + +void OPN2_Clock(ym3438_t *chip, Bit16s *buffer) +{ + Bit32u slot = chip->cycles; + chip->lfo_inc = chip->mode_test_21[1]; + chip->pg_read >>= 1; + chip->eg_read[1] >>= 1; + chip->eg_cycle++; + /* Lock envelope generator timer value */ + if (chip->cycles == 1 && chip->eg_quotient == 2) + { + if (chip->eg_cycle_stop) + { + chip->eg_shift_lock = 0; + } + else + { + chip->eg_shift_lock = chip->eg_shift + 1; + } + chip->eg_timer_low_lock = chip->eg_timer & 0x03; + } + /* Cycle specific functions */ + switch (chip->cycles) + { + case 0: + chip->lfo_pm = chip->lfo_cnt >> 2; + if (chip->lfo_cnt & 0x40) + { + chip->lfo_am = chip->lfo_cnt & 0x3f; + } + else + { + chip->lfo_am = chip->lfo_cnt ^ 0x3f; + } + chip->lfo_am <<= 1; + break; + case 1: + chip->eg_quotient++; + chip->eg_quotient %= 3; + chip->eg_cycle = 0; + chip->eg_cycle_stop = 1; + chip->eg_shift = 0; + chip->eg_timer_inc |= chip->eg_quotient >> 1; + chip->eg_timer = chip->eg_timer + chip->eg_timer_inc; + chip->eg_timer_inc = chip->eg_timer >> 12; + chip->eg_timer &= 0xfff; + break; + case 2: + chip->pg_read = chip->pg_phase[21] & 0x3ff; + chip->eg_read[1] = chip->eg_out[0]; + break; + case 13: + chip->eg_cycle = 0; + chip->eg_cycle_stop = 1; + chip->eg_shift = 0; + chip->eg_timer = chip->eg_timer + chip->eg_timer_inc; + chip->eg_timer_inc = chip->eg_timer >> 12; + chip->eg_timer &= 0xfff; + break; + case 23: + chip->lfo_inc |= 1; + break; + } + chip->eg_timer &= ~(chip->mode_test_21[5] << chip->eg_cycle); + if (((chip->eg_timer >> chip->eg_cycle) | (chip->pin_test_in & chip->eg_custom_timer)) & chip->eg_cycle_stop) + { + chip->eg_shift = chip->eg_cycle; + chip->eg_cycle_stop = 0; + } + + OPN2_DoIO(chip); + + OPN2_DoTimerA(chip); + OPN2_DoTimerB(chip); + OPN2_KeyOn(chip); + + OPN2_ChOutput(chip); + OPN2_ChGenerate(chip); + + OPN2_FMPrepare(chip); + OPN2_FMGenerate(chip); + + OPN2_PhaseGenerate(chip); + OPN2_PhaseCalcIncrement(chip); + + OPN2_EnvelopeADSR(chip); + OPN2_EnvelopeGenerate(chip); + OPN2_EnvelopeSSGEG(chip); + OPN2_EnvelopePrepare(chip); + + /* Prepare fnum & block */ + if (chip->mode_ch3) + { + /* Channel 3 special mode */ + switch (slot) + { + case 1: /* OP1 */ + chip->pg_fnum = chip->fnum_3ch[1]; + chip->pg_block = chip->block_3ch[1]; + chip->pg_kcode = chip->kcode_3ch[1]; + break; + case 7: /* OP3 */ + chip->pg_fnum = chip->fnum_3ch[0]; + chip->pg_block = chip->block_3ch[0]; + chip->pg_kcode = chip->kcode_3ch[0]; + break; + case 13: /* OP2 */ + chip->pg_fnum = chip->fnum_3ch[2]; + chip->pg_block = chip->block_3ch[2]; + chip->pg_kcode = chip->kcode_3ch[2]; + break; + case 19: /* OP4 */ + default: + chip->pg_fnum = chip->fnum[(chip->channel + 1) % 6]; + chip->pg_block = chip->block[(chip->channel + 1) % 6]; + chip->pg_kcode = chip->kcode[(chip->channel + 1) % 6]; + break; + } + } + else + { + chip->pg_fnum = chip->fnum[(chip->channel + 1) % 6]; + chip->pg_block = chip->block[(chip->channel + 1) % 6]; + chip->pg_kcode = chip->kcode[(chip->channel + 1) % 6]; + } + + OPN2_UpdateLFO(chip); + OPN2_DoRegWrite(chip); + chip->cycles = (chip->cycles + 1) % 24; + chip->channel = chip->cycles % 6; + + buffer[0] = chip->mol; + buffer[1] = chip->mor; + + if (chip->status_time) + chip->status_time--; +} + +void OPN2_Write(ym3438_t *chip, Bit32u port, Bit8u data) +{ + port &= 3; + chip->write_data = ((port << 7) & 0x100) | data; + if (port & 1) + { + /* Data */ + chip->write_d |= 1; + } + else + { + /* Address */ + chip->write_a |= 1; + } +} + +void OPN2_SetTestPin(ym3438_t *chip, Bit32u value) +{ + chip->pin_test_in = value & 1; +} + +Bit32u OPN2_ReadTestPin(ym3438_t *chip) +{ + if (!chip->mode_test_2c[7]) + { + return 0; + } + return chip->cycles == 23; +} + +Bit32u OPN2_ReadIRQPin(ym3438_t *chip) +{ + return chip->timer_a_overflow_flag | chip->timer_b_overflow_flag; +} + +Bit8u OPN2_Read(ym3438_t *chip, Bit32u port) +{ + if ((port & 3) == 0 || (chip_type & ym3438_mode_readmode)) + { + if (chip->mode_test_21[6]) + { + /* Read test data */ + Bit32u slot = (chip->cycles + 18) % 24; + Bit16u testdata = ((chip->pg_read & 0x01) << 15) + | ((chip->eg_read[chip->mode_test_21[0]] & 0x01) << 14); + if (chip->mode_test_2c[4]) + { + testdata |= chip->ch_read & 0x1ff; + } + else + { + testdata |= chip->fm_out[slot] & 0x3fff; + } + if (chip->mode_test_21[7]) + { + chip->status = testdata & 0xff; + } + else + { + chip->status = testdata >> 8; + } + } + else + { + chip->status = (chip->busy << 7) | (chip->timer_b_overflow_flag << 1) + | chip->timer_a_overflow_flag; + } + if (chip_type & ym3438_mode_ym2612) + { + chip->status_time = 300000; + } + else + { + chip->status_time = 40000000; + } + } + if (chip->status_time) + { + return chip->status; + } + return 0; +} diff --git a/Core/ym3438.h b/Core/ym3438.h new file mode 100644 index 00000000..090a57cf --- /dev/null +++ b/Core/ym3438.h @@ -0,0 +1,211 @@ +/* + * Copyright (C) 2017-2018 Alexey Khokholov (Nuke.YKT) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * + * Nuked OPN2(Yamaha YM3438) emulator. + * Thanks: + * Silicon Pr0n: + * Yamaha YM3438 decap and die shot(digshadow). + * OPLx decapsulated(Matthew Gambrell, Olli Niemitalo): + * OPL2 ROMs. + * + * version: 1.0.9 + */ + +#ifndef YM3438_H +#define YM3438_H + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + ym3438_mode_ym2612 = 0x01, /* Enables YM2612 emulation (MD1, MD2 VA2) */ + ym3438_mode_readmode = 0x02 /* Enables status read on any port (TeraDrive, MD1 VA7, MD2, etc) */ +}; + +#include + +typedef uintptr_t Bitu; +typedef intptr_t Bits; +typedef uint64_t Bit64u; +typedef int64_t Bit64s; +typedef uint32_t Bit32u; +typedef int32_t Bit32s; +typedef uint16_t Bit16u; +typedef int16_t Bit16s; +typedef uint8_t Bit8u; +typedef int8_t Bit8s; + +typedef struct +{ + Bit32u cycles; + Bit32u channel; + Bit16s mol, mor; + /* IO */ + Bit16u write_data; + Bit8u write_a; + Bit8u write_d; + Bit8u write_a_en; + Bit8u write_d_en; + Bit8u write_busy; + Bit8u write_busy_cnt; + Bit8u write_fm_address; + Bit8u write_fm_data; + Bit16u write_fm_mode_a; + Bit16u address; + Bit8u data; + Bit8u pin_test_in; + Bit8u pin_irq; + Bit8u busy; + /* LFO */ + Bit8u lfo_en; + Bit8u lfo_freq; + Bit8u lfo_pm; + Bit8u lfo_am; + Bit8u lfo_cnt; + Bit8u lfo_inc; + Bit8u lfo_quotient; + /* Phase generator */ + Bit16u pg_fnum; + Bit8u pg_block; + Bit8u pg_kcode; + Bit32u pg_inc[24]; + Bit32u pg_phase[24]; + Bit8u pg_reset[24]; + Bit32u pg_read; + /* Envelope generator */ + Bit8u eg_cycle; + Bit8u eg_cycle_stop; + Bit8u eg_shift; + Bit8u eg_shift_lock; + Bit8u eg_timer_low_lock; + Bit16u eg_timer; + Bit8u eg_timer_inc; + Bit16u eg_quotient; + Bit8u eg_custom_timer; + Bit8u eg_rate; + Bit8u eg_ksv; + Bit8u eg_inc; + Bit8u eg_ratemax; + Bit8u eg_sl[2]; + Bit8u eg_lfo_am; + Bit8u eg_tl[2]; + Bit8u eg_state[24]; + Bit16u eg_level[24]; + Bit16u eg_out[24]; + Bit8u eg_kon[24]; + Bit8u eg_kon_csm[24]; + Bit8u eg_kon_latch[24]; + Bit8u eg_csm_mode[24]; + Bit8u eg_ssg_enable[24]; + Bit8u eg_ssg_pgrst_latch[24]; + Bit8u eg_ssg_repeat_latch[24]; + Bit8u eg_ssg_hold_up_latch[24]; + Bit8u eg_ssg_dir[24]; + Bit8u eg_ssg_inv[24]; + Bit32u eg_read[2]; + Bit8u eg_read_inc; + /* FM */ + Bit16s fm_op1[6][2]; + Bit16s fm_op2[6]; + Bit16s fm_out[24]; + Bit16u fm_mod[24]; + /* Channel */ + Bit16s ch_acc[6]; + Bit16s ch_out[6]; + Bit16s ch_lock; + Bit8u ch_lock_l; + Bit8u ch_lock_r; + Bit16s ch_read; + /* Timer */ + Bit16u timer_a_cnt; + Bit16u timer_a_reg; + Bit8u timer_a_load_lock; + Bit8u timer_a_load; + Bit8u timer_a_enable; + Bit8u timer_a_reset; + Bit8u timer_a_load_latch; + Bit8u timer_a_overflow_flag; + Bit8u timer_a_overflow; + + Bit16u timer_b_cnt; + Bit8u timer_b_subcnt; + Bit16u timer_b_reg; + Bit8u timer_b_load_lock; + Bit8u timer_b_load; + Bit8u timer_b_enable; + Bit8u timer_b_reset; + Bit8u timer_b_load_latch; + Bit8u timer_b_overflow_flag; + Bit8u timer_b_overflow; + + /* Register set */ + Bit8u mode_test_21[8]; + Bit8u mode_test_2c[8]; + Bit8u mode_ch3; + Bit8u mode_kon_channel; + Bit8u mode_kon_operator[4]; + Bit8u mode_kon[24]; + Bit8u mode_csm; + Bit8u mode_kon_csm; + Bit8u dacen; + Bit16s dacdata; + + Bit8u ks[24]; + Bit8u ar[24]; + Bit8u sr[24]; + Bit8u dt[24]; + Bit8u multi[24]; + Bit8u sl[24]; + Bit8u rr[24]; + Bit8u dr[24]; + Bit8u am[24]; + Bit8u tl[24]; + Bit8u ssg_eg[24]; + + Bit16u fnum[6]; + Bit8u block[6]; + Bit8u kcode[6]; + Bit16u fnum_3ch[6]; + Bit8u block_3ch[6]; + Bit8u kcode_3ch[6]; + Bit8u reg_a4; + Bit8u reg_ac; + Bit8u connect[6]; + Bit8u fb[6]; + Bit8u pan_l[6], pan_r[6]; + Bit8u ams[6]; + Bit8u pms[6]; + Bit8u status; + Bit32u status_time; +} ym3438_t; + +void OPN2_Reset(ym3438_t *chip); +void OPN2_SetChipType(Bit32u type); +void OPN2_Clock(ym3438_t *chip, Bit16s *buffer); +void OPN2_Write(ym3438_t *chip, Bit32u port, Bit8u data); +void OPN2_SetTestPin(ym3438_t *chip, Bit32u value); +Bit32u OPN2_ReadTestPin(ym3438_t *chip); +Bit32u OPN2_ReadIRQPin(ym3438_t *chip); +Bit8u OPN2_Read(ym3438_t *chip, Bit32u port); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/GUI.NET/Config/AudioInfo.cs b/GUI.NET/Config/AudioInfo.cs index c7b3cb79..1f650814 100644 --- a/GUI.NET/Config/AudioInfo.cs +++ b/GUI.NET/Config/AudioInfo.cs @@ -6,6 +6,7 @@ namespace Mesen.GUI.Config { public string AudioDevice = ""; public bool EnableAudio = true; + public bool EnableEPSG = true; public bool DisableDynamicSampleRate = false; @@ -23,6 +24,10 @@ namespace Mesen.GUI.Config [MinMax(0, 100)] public UInt32 Vrc7Volume = 100; [MinMax(0, 100)] public UInt32 Namco163Volume = 100; [MinMax(0, 100)] public UInt32 Sunsoft5bVolume = 100; + [MinMax(0, 100)] public UInt32 EPSGVolume_L = 50; + [MinMax(0, 100)] public UInt32 EPSGVolume_R = 50; + + [MinMax(10000, 32000000)] public UInt32 EPSGClockFrequency = 3579545; [MinMax(-100, 100)] public Int32 Square1Panning = 0; [MinMax(-100, 100)] public Int32 Square2Panning = 0; @@ -35,6 +40,8 @@ namespace Mesen.GUI.Config [MinMax(-100, 100)] public Int32 Vrc7Panning = 0; [MinMax(-100, 100)] public Int32 Namco163Panning = 0; [MinMax(-100, 100)] public Int32 Sunsoft5bPanning = 0; + [MinMax(-100, 100)] public Int32 EPSGPanning_L = -100; + [MinMax(-100, 100)] public Int32 EPSGPanning_R = 100; [ValidValues(11025, 22050, 44100, 48000, 96000)] public UInt32 SampleRate = 48000; public bool ReduceSoundInBackground = true; @@ -87,7 +94,7 @@ namespace Mesen.GUI.Config { } - static private double ConvertVolume(UInt32 volume) + static public double ConvertVolume(UInt32 volume) { return ((double)volume / 100d); } @@ -114,6 +121,8 @@ namespace Mesen.GUI.Config InteropEmu.SetChannelVolume(AudioChannel.VRC7, ConvertVolume(audioInfo.Vrc7Volume)); InteropEmu.SetChannelVolume(AudioChannel.Namco163, ConvertVolume(audioInfo.Namco163Volume)); InteropEmu.SetChannelVolume(AudioChannel.Sunsoft5B, ConvertVolume(audioInfo.Sunsoft5bVolume)); + InteropEmu.SetChannelVolume(AudioChannel.EPSG_L, ConvertVolume(audioInfo.EPSGVolume_L)); + InteropEmu.SetChannelVolume(AudioChannel.EPSG_R, ConvertVolume(audioInfo.EPSGVolume_R)); InteropEmu.SetChannelPanning(AudioChannel.Square1, ConvertPanning(audioInfo.Square1Panning)); InteropEmu.SetChannelPanning(AudioChannel.Square2, ConvertPanning(audioInfo.Square2Panning)); @@ -126,6 +135,10 @@ namespace Mesen.GUI.Config InteropEmu.SetChannelPanning(AudioChannel.VRC7, ConvertPanning(audioInfo.Vrc7Panning)); InteropEmu.SetChannelPanning(AudioChannel.Namco163, ConvertPanning(audioInfo.Namco163Panning)); InteropEmu.SetChannelPanning(AudioChannel.Sunsoft5B, ConvertPanning(audioInfo.Sunsoft5bPanning)); + InteropEmu.SetChannelPanning(AudioChannel.EPSG_L, ConvertPanning(audioInfo.EPSGPanning_L)); + InteropEmu.SetChannelPanning(AudioChannel.EPSG_R, ConvertPanning(audioInfo.EPSGPanning_R)); + + InteropEmu.SetEPSGClockFrequency(audioInfo.EPSGClockFrequency); InteropEmu.SetEqualizerFilterType(audioInfo.EnableEqualizer ? audioInfo.EqualizerFilterType : EqualizerFilterType.None); diff --git a/GUI.NET/Controls/ctrlNsfPlayer.Designer.cs b/GUI.NET/Controls/ctrlNsfPlayer.Designer.cs index 7499b153..4b28ccdc 100644 --- a/GUI.NET/Controls/ctrlNsfPlayer.Designer.cs +++ b/GUI.NET/Controls/ctrlNsfPlayer.Designer.cs @@ -46,6 +46,7 @@ this.lblSunsoft = new System.Windows.Forms.Label(); this.lblVrc6 = new System.Windows.Forms.Label(); this.lblVrc7 = new System.Windows.Forms.Label(); + this.lblEpsg = new System.Windows.Forms.Label(); this.lblSoundChips = new System.Windows.Forms.Label(); this.trkVolume = new System.Windows.Forms.TrackBar(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); @@ -253,7 +254,7 @@ // // tableLayoutPanel3 // - this.tableLayoutPanel3.ColumnCount = 6; + this.tableLayoutPanel3.ColumnCount = 7; this.tlpNsfInfo.SetColumnSpan(this.tableLayoutPanel3, 2); this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); @@ -267,6 +268,7 @@ this.tableLayoutPanel3.Controls.Add(this.lblSunsoft, 3, 0); this.tableLayoutPanel3.Controls.Add(this.lblVrc6, 4, 0); this.tableLayoutPanel3.Controls.Add(this.lblVrc7, 5, 0); + this.tableLayoutPanel3.Controls.Add(this.lblEpsg, 6, 0); this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel3.Location = new System.Drawing.Point(101, 66); this.tableLayoutPanel3.Name = "tableLayoutPanel3"; @@ -355,6 +357,19 @@ this.lblVrc7.TabIndex = 3; this.lblVrc7.Text = "VRC7"; // + // lblEpsg + // + this.lblEpsg.AutoSize = true; + this.lblEpsg.BackColor = System.Drawing.Color.Transparent; + this.lblEpsg.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblEpsg.ForeColor = System.Drawing.Color.White; + this.lblEpsg.Location = new System.Drawing.Point(220, 0); + this.lblEpsg.Margin = new System.Windows.Forms.Padding(0); + this.lblEpsg.Name = "lblEpsg"; + this.lblEpsg.Size = new System.Drawing.Size(35, 13); + this.lblEpsg.TabIndex = 3; + this.lblEpsg.Text = "EPSG"; + // // lblSoundChips // this.lblSoundChips.AutoSize = true; @@ -728,6 +743,7 @@ private System.Windows.Forms.Label lblSunsoft; private System.Windows.Forms.Label lblVrc6; private System.Windows.Forms.Label lblVrc7; + private System.Windows.Forms.Label lblEpsg; private System.Windows.Forms.Label lblMmc5; private System.Windows.Forms.Label lblNamco; private System.Windows.Forms.Label lblFds; diff --git a/GUI.NET/Controls/ctrlNsfPlayer.cs b/GUI.NET/Controls/ctrlNsfPlayer.cs index 23414c05..db288cd8 100644 --- a/GUI.NET/Controls/ctrlNsfPlayer.cs +++ b/GUI.NET/Controls/ctrlNsfPlayer.cs @@ -274,8 +274,9 @@ namespace Mesen.GUI.Controls lblMmc5.ForeColor = (header.SoundChips & 0x08) == 0x08 ? Color.White : Color.Gray; lblNamco.ForeColor = (header.SoundChips & 0x10) == 0x10 ? Color.White : Color.Gray; lblSunsoft.ForeColor = (header.SoundChips & 0x20) == 0x20 ? Color.White : Color.Gray; + lblEpsg.ForeColor = (header.SoundChips & 0x40) == 0x40 ? Color.White : Color.Gray; - if(InteropEmu.IsPaused()) { + if (InteropEmu.IsPaused()) { btnPause.Image = Properties.Resources.Play; } else { btnPause.Image = Properties.Resources.Pause; diff --git a/GUI.NET/Debugger/frmApuViewer.Designer.cs b/GUI.NET/Debugger/frmApuViewer.Designer.cs index d05fd226..84e6f53f 100644 --- a/GUI.NET/Debugger/frmApuViewer.Designer.cs +++ b/GUI.NET/Debugger/frmApuViewer.Designer.cs @@ -41,6 +41,7 @@ this.chkVrc7 = new System.Windows.Forms.CheckBox(); this.chkDmc = new System.Windows.Forms.CheckBox(); this.chkSunsoft = new System.Windows.Forms.CheckBox(); + this.chkEPSG = new System.Windows.Forms.CheckBox(); this.chkVrc6 = new System.Windows.Forms.CheckBox(); this.grpSquare1 = new System.Windows.Forms.GroupBox(); this.ctrlSquareInfo1 = new Mesen.GUI.Debugger.Controls.ctrlSquareInfo(); @@ -118,6 +119,7 @@ this.tableLayoutPanel2.Controls.Add(this.chkVrc7, 2, 1); this.tableLayoutPanel2.Controls.Add(this.chkDmc, 0, 4); this.tableLayoutPanel2.Controls.Add(this.chkSunsoft, 1, 3); + this.tableLayoutPanel2.Controls.Add(this.chkEPSG, 1, 4); this.tableLayoutPanel2.Controls.Add(this.chkVrc6, 2, 0); this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 16); @@ -271,6 +273,20 @@ this.chkSunsoft.UseVisualStyleBackColor = true; this.chkSunsoft.CheckedChanged += new System.EventHandler(this.chkSoundChannel_CheckedChanged); // + // chkEPSG + // + this.chkEPSG.AutoSize = true; + this.chkEPSG.Checked = true; + this.chkEPSG.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkEPSG.Location = new System.Drawing.Point(99, 80); + this.chkEPSG.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3); + this.chkEPSG.Name = "chkEPSG"; + this.chkEPSG.Size = new System.Drawing.Size(78, 17); + this.chkEPSG.TabIndex = 10; + this.chkEPSG.Text = "EPSG"; + this.chkEPSG.UseVisualStyleBackColor = true; + this.chkEPSG.CheckedChanged += new System.EventHandler(this.chkSoundChannel_CheckedChanged); + // // chkVrc6 // this.chkVrc6.AutoSize = true; @@ -459,5 +475,6 @@ private System.Windows.Forms.CheckBox chkVrc7; private System.Windows.Forms.CheckBox chkVrc6; private System.Windows.Forms.CheckBox chkSunsoft; + private System.Windows.Forms.CheckBox chkEPSG; } } \ No newline at end of file diff --git a/GUI.NET/Debugger/frmApuViewer.cs b/GUI.NET/Debugger/frmApuViewer.cs index a6f0526e..6d0b5761 100644 --- a/GUI.NET/Debugger/frmApuViewer.cs +++ b/GUI.NET/Debugger/frmApuViewer.cs @@ -54,7 +54,9 @@ namespace Mesen.GUI.Debugger } private void chkSoundChannel_CheckedChanged(object sender, EventArgs e) - { + { + AudioInfo audioInfo = ConfigManager.Config.AudioInfo; + InteropEmu.SetChannelVolume(AudioChannel.Square1, chkSquare1.Checked ? 1 : 0); InteropEmu.SetChannelVolume(AudioChannel.Square2, chkSquare2.Checked ? 1 : 0); InteropEmu.SetChannelVolume(AudioChannel.Triangle, chkTriangle.Checked ? 1 : 0); @@ -66,6 +68,8 @@ namespace Mesen.GUI.Debugger InteropEmu.SetChannelVolume(AudioChannel.VRC7, chkVrc7.Checked ? 1 : 0); InteropEmu.SetChannelVolume(AudioChannel.MMC5, chkMmc5.Checked ? 1 : 0); InteropEmu.SetChannelVolume(AudioChannel.Sunsoft5B, chkSunsoft.Checked ? 1 : 0); - } + InteropEmu.SetChannelVolume(AudioChannel.EPSG_L, chkEPSG.Checked ? AudioInfo.ConvertVolume(audioInfo.EPSGVolume_L) : 0); + InteropEmu.SetChannelVolume(AudioChannel.EPSG_R, chkEPSG.Checked ? AudioInfo.ConvertVolume(audioInfo.EPSGVolume_R) : 0); + } } } diff --git a/GUI.NET/Forms/Config/frmAudioConfig.Designer.cs b/GUI.NET/Forms/Config/frmAudioConfig.Designer.cs index 64bb96bc..7a84563c 100644 --- a/GUI.NET/Forms/Config/frmAudioConfig.Designer.cs +++ b/GUI.NET/Forms/Config/frmAudioConfig.Designer.cs @@ -29,1999 +29,2135 @@ namespace Mesen.GUI.Forms.Config /// private void InitializeComponent() { - this.grpVolume = new System.Windows.Forms.GroupBox(); - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.trkDmcVol = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkNoiseVol = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkTriangleVol = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkSquare2Vol = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkSquare1Vol = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkMaster = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkFdsVol = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkMmc5Vol = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkVrc6Vol = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkVrc7Vol = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkNamco163Vol = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkSunsoft5b = new Mesen.GUI.Controls.ctrlTrackbar(); - this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); - this.lblVolumeReductionSettings = new System.Windows.Forms.Label(); - this.chkEnableAudio = new System.Windows.Forms.CheckBox(); - this.lblSampleRate = new System.Windows.Forms.Label(); - this.lblAudioLatency = new System.Windows.Forms.Label(); - this.cboSampleRate = new System.Windows.Forms.ComboBox(); - this.lblAudioDevice = new System.Windows.Forms.Label(); - this.cboAudioDevice = new System.Windows.Forms.ComboBox(); - this.tableLayoutPanel7 = new System.Windows.Forms.TableLayoutPanel(); - this.lblLatencyWarning = new System.Windows.Forms.Label(); - this.picLatencyWarning = new System.Windows.Forms.PictureBox(); - this.lblLatencyMs = new System.Windows.Forms.Label(); - this.nudLatency = new Mesen.GUI.Controls.MesenNumericUpDown(); - this.tableLayoutPanel8 = new System.Windows.Forms.TableLayoutPanel(); - this.chkReduceSoundInBackground = new System.Windows.Forms.CheckBox(); - this.chkReduceSoundInFastForward = new System.Windows.Forms.CheckBox(); - this.trkVolumeReduction = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); - this.chkMuteSoundInBackground = new System.Windows.Forms.CheckBox(); - this.btnReset = new System.Windows.Forms.Button(); - this.tabMain = new System.Windows.Forms.TabControl(); - this.tpgGeneral = new System.Windows.Forms.TabPage(); - this.tpgVolume = new System.Windows.Forms.TabPage(); - this.tpgPanning = new System.Windows.Forms.TabPage(); - this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel(); - this.trkSquare1Pan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); - this.trkFdsPan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); - this.trkSquare2Pan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); - this.trkMmc5Pan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); - this.trkTrianglePan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); - this.trkNoisePan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); - this.trkDmcPan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); - this.trkVrc6Pan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); - this.trkVrc7Pan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); - this.trkNamcoPan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); - this.trkSunsoftPan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); - this.tpgEqualizer = new System.Windows.Forms.TabPage(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.chkEnableEqualizer = new System.Windows.Forms.CheckBox(); - this.tlpEqualizer = new System.Windows.Forms.TableLayoutPanel(); - this.trkBand6Gain = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkBand5Gain = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkBand4Gain = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkBand3Gain = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkBand2Gain = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkBand1Gain = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkBand11Gain = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkBand12Gain = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkBand13Gain = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkBand14Gain = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkBand15Gain = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkBand16Gain = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkBand7Gain = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkBand8Gain = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkBand9Gain = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkBand10Gain = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkBand17Gain = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkBand18Gain = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkBand19Gain = new Mesen.GUI.Controls.ctrlTrackbar(); - this.trkBand20Gain = new Mesen.GUI.Controls.ctrlTrackbar(); - this.flowLayoutPanel6 = new System.Windows.Forms.FlowLayoutPanel(); - this.lblEqualizerPreset = new System.Windows.Forms.Label(); - this.cboEqualizerPreset = new System.Windows.Forms.ComboBox(); - this.flowLayoutPanel7 = new System.Windows.Forms.FlowLayoutPanel(); - this.lblEqualizerFilterType = new System.Windows.Forms.Label(); - this.cboEqualizerFilterType = new System.Windows.Forms.ComboBox(); - this.tpgEffects = new System.Windows.Forms.TabPage(); - this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); - this.grpStereo = new System.Windows.Forms.GroupBox(); - this.tlpStereoFilter = new System.Windows.Forms.TableLayoutPanel(); - this.radStereoCombFilter = new System.Windows.Forms.RadioButton(); - this.lblStereoDelayMs = new System.Windows.Forms.Label(); - this.lblStereoPanningAngle = new System.Windows.Forms.Label(); - this.radStereoDisabled = new System.Windows.Forms.RadioButton(); - this.radStereoDelay = new System.Windows.Forms.RadioButton(); - this.radStereoPanning = new System.Windows.Forms.RadioButton(); - this.nudStereoDelay = new Mesen.GUI.Controls.MesenNumericUpDown(); - this.nudStereoPanning = new Mesen.GUI.Controls.MesenNumericUpDown(); - this.tableLayoutPanel9 = new System.Windows.Forms.TableLayoutPanel(); - this.nudStereoCombFilterStrength = new Mesen.GUI.Controls.MesenNumericUpDown(); - this.lblStereoCombFilterMs = new System.Windows.Forms.Label(); - this.nudStereoCombFilterDelay = new Mesen.GUI.Controls.MesenNumericUpDown(); - this.lblStereoCombFilterDelay = new System.Windows.Forms.Label(); - this.lblStereoCombFilterStrength = new System.Windows.Forms.Label(); - this.lblCombFilterPercent = new System.Windows.Forms.Label(); - this.grpReverb = new System.Windows.Forms.GroupBox(); - this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); - this.chkReverbEnabled = new System.Windows.Forms.CheckBox(); - this.lblReverbStrength = new System.Windows.Forms.Label(); - this.lblReverbDelay = new System.Windows.Forms.Label(); - this.trkReverbDelay = new System.Windows.Forms.TrackBar(); - this.trkReverbStrength = new System.Windows.Forms.TrackBar(); - this.flowLayoutPanel5 = new System.Windows.Forms.FlowLayoutPanel(); - this.chkCrossFeedEnabled = new System.Windows.Forms.CheckBox(); - this.nudCrossFeedRatio = new Mesen.GUI.Controls.MesenNumericUpDown(); - this.lblCrossFeedRatio = new System.Windows.Forms.Label(); - this.tpgAdvanced = new System.Windows.Forms.TabPage(); - this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); - this.chkDisableDynamicSampleRate = new Mesen.GUI.Controls.ctrlRiskyOption(); - this.chkDisableNoiseModeFlag = new Mesen.GUI.Controls.ctrlRiskyOption(); - this.chkSilenceTriangleHighFreq = new System.Windows.Forms.CheckBox(); - this.chkSwapDutyCycles = new Mesen.GUI.Controls.ctrlRiskyOption(); - this.chkReduceDmcPopping = new System.Windows.Forms.CheckBox(); - this.baseConfigPanel.SuspendLayout(); - this.grpVolume.SuspendLayout(); - this.tableLayoutPanel1.SuspendLayout(); - this.tableLayoutPanel2.SuspendLayout(); - this.tableLayoutPanel7.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.picLatencyWarning)).BeginInit(); - this.tableLayoutPanel8.SuspendLayout(); - this.tabMain.SuspendLayout(); - this.tpgGeneral.SuspendLayout(); - this.tpgVolume.SuspendLayout(); - this.tpgPanning.SuspendLayout(); - this.tableLayoutPanel6.SuspendLayout(); - this.tpgEqualizer.SuspendLayout(); - this.groupBox1.SuspendLayout(); - this.tlpEqualizer.SuspendLayout(); - this.flowLayoutPanel6.SuspendLayout(); - this.flowLayoutPanel7.SuspendLayout(); - this.tpgEffects.SuspendLayout(); - this.tableLayoutPanel4.SuspendLayout(); - this.grpStereo.SuspendLayout(); - this.tlpStereoFilter.SuspendLayout(); - this.tableLayoutPanel9.SuspendLayout(); - this.grpReverb.SuspendLayout(); - this.tableLayoutPanel5.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.trkReverbDelay)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.trkReverbStrength)).BeginInit(); - this.flowLayoutPanel5.SuspendLayout(); - this.tpgAdvanced.SuspendLayout(); - this.tableLayoutPanel3.SuspendLayout(); - this.SuspendLayout(); - // - // baseConfigPanel - // - this.baseConfigPanel.Controls.Add(this.btnReset); - this.baseConfigPanel.Location = new System.Drawing.Point(0, 373); - this.baseConfigPanel.Size = new System.Drawing.Size(477, 29); - this.baseConfigPanel.Controls.SetChildIndex(this.btnReset, 0); - // - // grpVolume - // - this.grpVolume.Controls.Add(this.tableLayoutPanel1); - this.grpVolume.Dock = System.Windows.Forms.DockStyle.Fill; - this.grpVolume.Location = new System.Drawing.Point(3, 3); - this.grpVolume.Name = "grpVolume"; - this.grpVolume.Size = new System.Drawing.Size(463, 341); - this.grpVolume.TabIndex = 2; - this.grpVolume.TabStop = false; - this.grpVolume.Text = "Volume"; - // - // tableLayoutPanel1 - // - this.tableLayoutPanel1.ColumnCount = 6; - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.66667F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.66667F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.66667F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.66667F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.66667F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.66667F)); - this.tableLayoutPanel1.Controls.Add(this.trkDmcVol, 5, 0); - this.tableLayoutPanel1.Controls.Add(this.trkNoiseVol, 4, 0); - this.tableLayoutPanel1.Controls.Add(this.trkTriangleVol, 3, 0); - this.tableLayoutPanel1.Controls.Add(this.trkSquare2Vol, 2, 0); - this.tableLayoutPanel1.Controls.Add(this.trkSquare1Vol, 1, 0); - this.tableLayoutPanel1.Controls.Add(this.trkMaster, 0, 0); - this.tableLayoutPanel1.Controls.Add(this.trkFdsVol, 0, 1); - this.tableLayoutPanel1.Controls.Add(this.trkMmc5Vol, 1, 1); - this.tableLayoutPanel1.Controls.Add(this.trkVrc6Vol, 2, 1); - this.tableLayoutPanel1.Controls.Add(this.trkVrc7Vol, 3, 1); - this.tableLayoutPanel1.Controls.Add(this.trkNamco163Vol, 4, 1); - this.tableLayoutPanel1.Controls.Add(this.trkSunsoft5b, 5, 1); - this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 16); - this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - this.tableLayoutPanel1.RowCount = 3; - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(457, 322); - this.tableLayoutPanel1.TabIndex = 2; - // - // trkDmcVol - // - this.trkDmcVol.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkDmcVol.Location = new System.Drawing.Point(387, 0); - this.trkDmcVol.Margin = new System.Windows.Forms.Padding(0); - this.trkDmcVol.Maximum = 100; - this.trkDmcVol.MaximumSize = new System.Drawing.Size(63, 160); - this.trkDmcVol.Minimum = 0; - this.trkDmcVol.MinimumSize = new System.Drawing.Size(63, 160); - this.trkDmcVol.Name = "trkDmcVol"; - this.trkDmcVol.Size = new System.Drawing.Size(63, 160); - this.trkDmcVol.TabIndex = 16; - this.trkDmcVol.Text = "DMC"; - this.trkDmcVol.Value = 50; - // - // trkNoiseVol - // - this.trkNoiseVol.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkNoiseVol.Location = new System.Drawing.Point(310, 0); - this.trkNoiseVol.Margin = new System.Windows.Forms.Padding(0); - this.trkNoiseVol.Maximum = 100; - this.trkNoiseVol.MaximumSize = new System.Drawing.Size(63, 160); - this.trkNoiseVol.Minimum = 0; - this.trkNoiseVol.MinimumSize = new System.Drawing.Size(63, 160); - this.trkNoiseVol.Name = "trkNoiseVol"; - this.trkNoiseVol.Size = new System.Drawing.Size(63, 160); - this.trkNoiseVol.TabIndex = 15; - this.trkNoiseVol.Text = "Noise"; - this.trkNoiseVol.Value = 50; - // - // trkTriangleVol - // - this.trkTriangleVol.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkTriangleVol.Location = new System.Drawing.Point(234, 0); - this.trkTriangleVol.Margin = new System.Windows.Forms.Padding(0); - this.trkTriangleVol.Maximum = 100; - this.trkTriangleVol.MaximumSize = new System.Drawing.Size(63, 160); - this.trkTriangleVol.Minimum = 0; - this.trkTriangleVol.MinimumSize = new System.Drawing.Size(63, 160); - this.trkTriangleVol.Name = "trkTriangleVol"; - this.trkTriangleVol.Size = new System.Drawing.Size(63, 160); - this.trkTriangleVol.TabIndex = 14; - this.trkTriangleVol.Text = "Triangle"; - this.trkTriangleVol.Value = 50; - // - // trkSquare2Vol - // - this.trkSquare2Vol.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkSquare2Vol.Location = new System.Drawing.Point(158, 0); - this.trkSquare2Vol.Margin = new System.Windows.Forms.Padding(0); - this.trkSquare2Vol.Maximum = 100; - this.trkSquare2Vol.MaximumSize = new System.Drawing.Size(63, 160); - this.trkSquare2Vol.Minimum = 0; - this.trkSquare2Vol.MinimumSize = new System.Drawing.Size(63, 160); - this.trkSquare2Vol.Name = "trkSquare2Vol"; - this.trkSquare2Vol.Size = new System.Drawing.Size(63, 160); - this.trkSquare2Vol.TabIndex = 13; - this.trkSquare2Vol.Text = "Square 2"; - this.trkSquare2Vol.Value = 50; - // - // trkSquare1Vol - // - this.trkSquare1Vol.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkSquare1Vol.Location = new System.Drawing.Point(82, 0); - this.trkSquare1Vol.Margin = new System.Windows.Forms.Padding(0); - this.trkSquare1Vol.Maximum = 100; - this.trkSquare1Vol.MaximumSize = new System.Drawing.Size(63, 160); - this.trkSquare1Vol.Minimum = 0; - this.trkSquare1Vol.MinimumSize = new System.Drawing.Size(63, 160); - this.trkSquare1Vol.Name = "trkSquare1Vol"; - this.trkSquare1Vol.Size = new System.Drawing.Size(63, 160); - this.trkSquare1Vol.TabIndex = 12; - this.trkSquare1Vol.Text = "Square 1"; - this.trkSquare1Vol.Value = 50; - // - // trkMaster - // - this.trkMaster.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkMaster.Location = new System.Drawing.Point(6, 0); - this.trkMaster.Margin = new System.Windows.Forms.Padding(0); - this.trkMaster.Maximum = 100; - this.trkMaster.MaximumSize = new System.Drawing.Size(63, 160); - this.trkMaster.Minimum = 0; - this.trkMaster.MinimumSize = new System.Drawing.Size(63, 160); - this.trkMaster.Name = "trkMaster"; - this.trkMaster.Size = new System.Drawing.Size(63, 160); - this.trkMaster.TabIndex = 11; - this.trkMaster.Text = "Master"; - this.trkMaster.Value = 50; - // - // trkFdsVol - // - this.trkFdsVol.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkFdsVol.Location = new System.Drawing.Point(6, 160); - this.trkFdsVol.Margin = new System.Windows.Forms.Padding(0); - this.trkFdsVol.Maximum = 100; - this.trkFdsVol.MaximumSize = new System.Drawing.Size(63, 160); - this.trkFdsVol.Minimum = 0; - this.trkFdsVol.MinimumSize = new System.Drawing.Size(63, 160); - this.trkFdsVol.Name = "trkFdsVol"; - this.trkFdsVol.Size = new System.Drawing.Size(63, 160); - this.trkFdsVol.TabIndex = 17; - this.trkFdsVol.Text = "FDS"; - this.trkFdsVol.Value = 50; - // - // trkMmc5Vol - // - this.trkMmc5Vol.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkMmc5Vol.Location = new System.Drawing.Point(82, 160); - this.trkMmc5Vol.Margin = new System.Windows.Forms.Padding(0); - this.trkMmc5Vol.Maximum = 100; - this.trkMmc5Vol.MaximumSize = new System.Drawing.Size(63, 160); - this.trkMmc5Vol.Minimum = 0; - this.trkMmc5Vol.MinimumSize = new System.Drawing.Size(63, 160); - this.trkMmc5Vol.Name = "trkMmc5Vol"; - this.trkMmc5Vol.Size = new System.Drawing.Size(63, 160); - this.trkMmc5Vol.TabIndex = 18; - this.trkMmc5Vol.Text = "MMC5"; - this.trkMmc5Vol.Value = 50; - // - // trkVrc6Vol - // - this.trkVrc6Vol.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkVrc6Vol.Location = new System.Drawing.Point(158, 160); - this.trkVrc6Vol.Margin = new System.Windows.Forms.Padding(0); - this.trkVrc6Vol.Maximum = 100; - this.trkVrc6Vol.MaximumSize = new System.Drawing.Size(63, 160); - this.trkVrc6Vol.Minimum = 0; - this.trkVrc6Vol.MinimumSize = new System.Drawing.Size(63, 160); - this.trkVrc6Vol.Name = "trkVrc6Vol"; - this.trkVrc6Vol.Size = new System.Drawing.Size(63, 160); - this.trkVrc6Vol.TabIndex = 19; - this.trkVrc6Vol.Text = "VRC6"; - this.trkVrc6Vol.Value = 50; - // - // trkVrc7Vol - // - this.trkVrc7Vol.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkVrc7Vol.Location = new System.Drawing.Point(234, 160); - this.trkVrc7Vol.Margin = new System.Windows.Forms.Padding(0); - this.trkVrc7Vol.Maximum = 100; - this.trkVrc7Vol.MaximumSize = new System.Drawing.Size(63, 160); - this.trkVrc7Vol.Minimum = 0; - this.trkVrc7Vol.MinimumSize = new System.Drawing.Size(63, 160); - this.trkVrc7Vol.Name = "trkVrc7Vol"; - this.trkVrc7Vol.Size = new System.Drawing.Size(63, 160); - this.trkVrc7Vol.TabIndex = 20; - this.trkVrc7Vol.Text = "VRC7"; - this.trkVrc7Vol.Value = 50; - // - // trkNamco163Vol - // - this.trkNamco163Vol.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkNamco163Vol.Location = new System.Drawing.Point(310, 160); - this.trkNamco163Vol.Margin = new System.Windows.Forms.Padding(0); - this.trkNamco163Vol.Maximum = 100; - this.trkNamco163Vol.MaximumSize = new System.Drawing.Size(63, 160); - this.trkNamco163Vol.Minimum = 0; - this.trkNamco163Vol.MinimumSize = new System.Drawing.Size(63, 160); - this.trkNamco163Vol.Name = "trkNamco163Vol"; - this.trkNamco163Vol.Size = new System.Drawing.Size(63, 160); - this.trkNamco163Vol.TabIndex = 21; - this.trkNamco163Vol.Text = "Namco"; - this.trkNamco163Vol.Value = 50; - // - // trkSunsoft5b - // - this.trkSunsoft5b.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkSunsoft5b.Location = new System.Drawing.Point(387, 160); - this.trkSunsoft5b.Margin = new System.Windows.Forms.Padding(0); - this.trkSunsoft5b.Maximum = 100; - this.trkSunsoft5b.MaximumSize = new System.Drawing.Size(63, 160); - this.trkSunsoft5b.Minimum = 0; - this.trkSunsoft5b.MinimumSize = new System.Drawing.Size(63, 160); - this.trkSunsoft5b.Name = "trkSunsoft5b"; - this.trkSunsoft5b.Size = new System.Drawing.Size(63, 160); - this.trkSunsoft5b.TabIndex = 22; - this.trkSunsoft5b.Text = "Sunsoft"; - this.trkSunsoft5b.Value = 50; - // - // tableLayoutPanel2 - // - this.tableLayoutPanel2.ColumnCount = 2; - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel2.Controls.Add(this.lblVolumeReductionSettings, 0, 4); - this.tableLayoutPanel2.Controls.Add(this.chkEnableAudio, 0, 0); - this.tableLayoutPanel2.Controls.Add(this.lblSampleRate, 0, 2); - this.tableLayoutPanel2.Controls.Add(this.lblAudioLatency, 0, 3); - this.tableLayoutPanel2.Controls.Add(this.cboSampleRate, 1, 2); - this.tableLayoutPanel2.Controls.Add(this.lblAudioDevice, 0, 1); - this.tableLayoutPanel2.Controls.Add(this.cboAudioDevice, 1, 1); - this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel7, 1, 3); - this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel8, 0, 5); - this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 3); - this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0); - this.tableLayoutPanel2.Name = "tableLayoutPanel2"; - this.tableLayoutPanel2.RowCount = 9; - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22F)); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel2.Size = new System.Drawing.Size(463, 341); - this.tableLayoutPanel2.TabIndex = 3; - // - // lblVolumeReductionSettings - // - this.lblVolumeReductionSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.lblVolumeReductionSettings.AutoSize = true; - this.tableLayoutPanel2.SetColumnSpan(this.lblVolumeReductionSettings, 2); - this.lblVolumeReductionSettings.ForeColor = System.Drawing.SystemColors.GrayText; - this.lblVolumeReductionSettings.Location = new System.Drawing.Point(0, 116); - this.lblVolumeReductionSettings.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0); - this.lblVolumeReductionSettings.Name = "lblVolumeReductionSettings"; - this.lblVolumeReductionSettings.Size = new System.Drawing.Size(94, 13); - this.lblVolumeReductionSettings.TabIndex = 24; - this.lblVolumeReductionSettings.Text = "Volume Reduction"; - // - // chkEnableAudio - // - this.chkEnableAudio.AutoSize = true; - this.tableLayoutPanel2.SetColumnSpan(this.chkEnableAudio, 2); - this.chkEnableAudio.Location = new System.Drawing.Point(6, 6); - this.chkEnableAudio.Margin = new System.Windows.Forms.Padding(6, 6, 6, 3); - this.chkEnableAudio.Name = "chkEnableAudio"; - this.chkEnableAudio.Size = new System.Drawing.Size(89, 17); - this.chkEnableAudio.TabIndex = 3; - this.chkEnableAudio.Text = "Enable Audio"; - this.chkEnableAudio.UseVisualStyleBackColor = true; - // - // lblSampleRate - // - this.lblSampleRate.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.lblSampleRate.AutoSize = true; - this.lblSampleRate.Location = new System.Drawing.Point(3, 60); - this.lblSampleRate.Name = "lblSampleRate"; - this.lblSampleRate.Size = new System.Drawing.Size(71, 13); - this.lblSampleRate.TabIndex = 0; - this.lblSampleRate.Text = "Sample Rate:"; - // - // lblAudioLatency - // - this.lblAudioLatency.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.lblAudioLatency.AutoSize = true; - this.lblAudioLatency.Location = new System.Drawing.Point(3, 87); - this.lblAudioLatency.Name = "lblAudioLatency"; - this.lblAudioLatency.Size = new System.Drawing.Size(48, 13); - this.lblAudioLatency.TabIndex = 0; - this.lblAudioLatency.Text = "Latency:"; - // - // cboSampleRate - // - this.cboSampleRate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboSampleRate.FormattingEnabled = true; - this.cboSampleRate.Items.AddRange(new object[] { + this.grpVolume = new System.Windows.Forms.GroupBox(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.trkDmcVol = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkNoiseVol = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkTriangleVol = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkSquare2Vol = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkSquare1Vol = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkMaster = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkFdsVol = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkMmc5Vol = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkVrc6Vol = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkVrc7Vol = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkNamco163Vol = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkSunsoft5b = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkEPSGVol_L = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkEPSGVol_R = new Mesen.GUI.Controls.ctrlTrackbar(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); + this.lblVolumeReductionSettings = new System.Windows.Forms.Label(); + this.chkEnableAudio = new System.Windows.Forms.CheckBox(); + this.chkEnableEPSG = new System.Windows.Forms.CheckBox(); + this.lblSampleRate = new System.Windows.Forms.Label(); + this.lblAudioLatency = new System.Windows.Forms.Label(); + this.cboSampleRate = new System.Windows.Forms.ComboBox(); + this.lblAudioDevice = new System.Windows.Forms.Label(); + this.cboAudioDevice = new System.Windows.Forms.ComboBox(); + this.tableLayoutPanel7 = new System.Windows.Forms.TableLayoutPanel(); + this.lblLatencyWarning = new System.Windows.Forms.Label(); + this.picLatencyWarning = new System.Windows.Forms.PictureBox(); + this.lblLatencyMs = new System.Windows.Forms.Label(); + this.nudLatency = new Mesen.GUI.Controls.MesenNumericUpDown(); + this.tableLayoutPanel8 = new System.Windows.Forms.TableLayoutPanel(); + this.chkReduceSoundInBackground = new System.Windows.Forms.CheckBox(); + this.chkReduceSoundInFastForward = new System.Windows.Forms.CheckBox(); + this.trkVolumeReduction = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); + this.chkMuteSoundInBackground = new System.Windows.Forms.CheckBox(); + this.btnReset = new System.Windows.Forms.Button(); + this.tabMain = new System.Windows.Forms.TabControl(); + this.tpgGeneral = new System.Windows.Forms.TabPage(); + this.tpgVolume = new System.Windows.Forms.TabPage(); + this.tpgPanning = new System.Windows.Forms.TabPage(); + this.tableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel(); + this.trkSquare1Pan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); + this.trkFdsPan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); + this.trkSquare2Pan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); + this.trkMmc5Pan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); + this.trkTrianglePan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); + this.trkNoisePan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); + this.trkDmcPan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); + this.trkVrc6Pan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); + this.trkVrc7Pan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); + this.trkNamcoPan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); + this.trkSunsoftPan = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); + this.trkEPSGPan_L = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); + this.trkEPSGPan_R = new Mesen.GUI.Controls.ctrlHorizontalTrackbar(); + this.tpgEqualizer = new System.Windows.Forms.TabPage(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.chkEnableEqualizer = new System.Windows.Forms.CheckBox(); + this.tlpEqualizer = new System.Windows.Forms.TableLayoutPanel(); + this.trkBand6Gain = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkBand5Gain = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkBand4Gain = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkBand3Gain = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkBand2Gain = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkBand1Gain = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkBand11Gain = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkBand12Gain = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkBand13Gain = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkBand14Gain = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkBand15Gain = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkBand16Gain = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkBand7Gain = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkBand8Gain = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkBand9Gain = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkBand10Gain = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkBand17Gain = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkBand18Gain = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkBand19Gain = new Mesen.GUI.Controls.ctrlTrackbar(); + this.trkBand20Gain = new Mesen.GUI.Controls.ctrlTrackbar(); + this.flowLayoutPanel6 = new System.Windows.Forms.FlowLayoutPanel(); + this.lblEqualizerPreset = new System.Windows.Forms.Label(); + this.cboEqualizerPreset = new System.Windows.Forms.ComboBox(); + this.flowLayoutPanel7 = new System.Windows.Forms.FlowLayoutPanel(); + this.lblEqualizerFilterType = new System.Windows.Forms.Label(); + this.cboEqualizerFilterType = new System.Windows.Forms.ComboBox(); + this.tpgEffects = new System.Windows.Forms.TabPage(); + this.tableLayoutPanel4 = new System.Windows.Forms.TableLayoutPanel(); + this.grpStereo = new System.Windows.Forms.GroupBox(); + this.tlpStereoFilter = new System.Windows.Forms.TableLayoutPanel(); + this.radStereoCombFilter = new System.Windows.Forms.RadioButton(); + this.lblStereoDelayMs = new System.Windows.Forms.Label(); + this.lblStereoPanningAngle = new System.Windows.Forms.Label(); + this.radStereoDisabled = new System.Windows.Forms.RadioButton(); + this.radStereoDelay = new System.Windows.Forms.RadioButton(); + this.radStereoPanning = new System.Windows.Forms.RadioButton(); + this.nudStereoDelay = new Mesen.GUI.Controls.MesenNumericUpDown(); + this.nudStereoPanning = new Mesen.GUI.Controls.MesenNumericUpDown(); + this.tableLayoutPanel9 = new System.Windows.Forms.TableLayoutPanel(); + this.nudStereoCombFilterStrength = new Mesen.GUI.Controls.MesenNumericUpDown(); + this.lblStereoCombFilterMs = new System.Windows.Forms.Label(); + this.nudStereoCombFilterDelay = new Mesen.GUI.Controls.MesenNumericUpDown(); + this.lblStereoCombFilterDelay = new System.Windows.Forms.Label(); + this.lblStereoCombFilterStrength = new System.Windows.Forms.Label(); + this.lblCombFilterPercent = new System.Windows.Forms.Label(); + this.grpReverb = new System.Windows.Forms.GroupBox(); + this.tableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel(); + this.chkReverbEnabled = new System.Windows.Forms.CheckBox(); + this.lblReverbStrength = new System.Windows.Forms.Label(); + this.lblReverbDelay = new System.Windows.Forms.Label(); + this.trkReverbDelay = new System.Windows.Forms.TrackBar(); + this.trkReverbStrength = new System.Windows.Forms.TrackBar(); + this.flowLayoutPanel5 = new System.Windows.Forms.FlowLayoutPanel(); + this.chkCrossFeedEnabled = new System.Windows.Forms.CheckBox(); + this.nudCrossFeedRatio = new Mesen.GUI.Controls.MesenNumericUpDown(); + this.lblCrossFeedRatio = new System.Windows.Forms.Label(); + this.tpgAdvanced = new System.Windows.Forms.TabPage(); + this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); + this.chkDisableDynamicSampleRate = new Mesen.GUI.Controls.ctrlRiskyOption(); + this.chkDisableNoiseModeFlag = new Mesen.GUI.Controls.ctrlRiskyOption(); + this.nudEPSGClockFrequency = new Mesen.GUI.Controls.MesenNumericUpDown(); + this.lblEPSGClockFrequency = new System.Windows.Forms.Label(); + this.chkSilenceTriangleHighFreq = new System.Windows.Forms.CheckBox(); + this.chkSwapDutyCycles = new Mesen.GUI.Controls.ctrlRiskyOption(); + this.chkReduceDmcPopping = new System.Windows.Forms.CheckBox(); + this.baseConfigPanel.SuspendLayout(); + this.grpVolume.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); + this.tableLayoutPanel7.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picLatencyWarning)).BeginInit(); + this.tableLayoutPanel8.SuspendLayout(); + this.tabMain.SuspendLayout(); + this.tpgGeneral.SuspendLayout(); + this.tpgVolume.SuspendLayout(); + this.tpgPanning.SuspendLayout(); + this.tableLayoutPanel6.SuspendLayout(); + this.tpgEqualizer.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.tlpEqualizer.SuspendLayout(); + this.flowLayoutPanel6.SuspendLayout(); + this.flowLayoutPanel7.SuspendLayout(); + this.tpgEffects.SuspendLayout(); + this.tableLayoutPanel4.SuspendLayout(); + this.grpStereo.SuspendLayout(); + this.tlpStereoFilter.SuspendLayout(); + this.tableLayoutPanel9.SuspendLayout(); + this.grpReverb.SuspendLayout(); + this.tableLayoutPanel5.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.trkReverbDelay)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.trkReverbStrength)).BeginInit(); + this.flowLayoutPanel5.SuspendLayout(); + this.tpgAdvanced.SuspendLayout(); + this.tableLayoutPanel3.SuspendLayout(); + this.SuspendLayout(); + // + // baseConfigPanel + // + this.baseConfigPanel.Controls.Add(this.btnReset); + this.baseConfigPanel.Location = new System.Drawing.Point(0, 421); + this.baseConfigPanel.Size = new System.Drawing.Size(477, 29); + this.baseConfigPanel.Controls.SetChildIndex(this.btnReset, 0); + // + // grpVolume + // + this.grpVolume.Controls.Add(this.tableLayoutPanel1); + this.grpVolume.Dock = System.Windows.Forms.DockStyle.Fill; + this.grpVolume.Location = new System.Drawing.Point(3, 3); + this.grpVolume.Name = "grpVolume"; + this.grpVolume.Size = new System.Drawing.Size(463, 357); + this.grpVolume.TabIndex = 2; + this.grpVolume.TabStop = false; + this.grpVolume.Text = "Volume"; + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 7; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.66667F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.66667F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.66667F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.66667F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.66667F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 16.66667F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.Controls.Add(this.trkDmcVol, 5, 0); + this.tableLayoutPanel1.Controls.Add(this.trkNoiseVol, 4, 0); + this.tableLayoutPanel1.Controls.Add(this.trkTriangleVol, 3, 0); + this.tableLayoutPanel1.Controls.Add(this.trkSquare2Vol, 2, 0); + this.tableLayoutPanel1.Controls.Add(this.trkSquare1Vol, 1, 0); + this.tableLayoutPanel1.Controls.Add(this.trkMaster, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.trkFdsVol, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.trkMmc5Vol, 1, 1); + this.tableLayoutPanel1.Controls.Add(this.trkVrc6Vol, 2, 1); + this.tableLayoutPanel1.Controls.Add(this.trkVrc7Vol, 3, 1); + this.tableLayoutPanel1.Controls.Add(this.trkNamco163Vol, 4, 1); + this.tableLayoutPanel1.Controls.Add(this.trkSunsoft5b, 6, 0); + this.tableLayoutPanel1.Controls.Add(this.trkEPSGVol_L, 5, 1); + this.tableLayoutPanel1.Controls.Add(this.trkEPSGVol_R, 6, 1); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 16); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 3; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(457, 338); + this.tableLayoutPanel1.TabIndex = 2; + // + // trkDmcVol + // + this.trkDmcVol.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkDmcVol.Location = new System.Drawing.Point(364, 0); + this.trkDmcVol.Margin = new System.Windows.Forms.Padding(0); + this.trkDmcVol.Maximum = 100; + this.trkDmcVol.MaximumSize = new System.Drawing.Size(63, 160); + this.trkDmcVol.Minimum = 0; + this.trkDmcVol.MinimumSize = new System.Drawing.Size(63, 160); + this.trkDmcVol.Name = "trkDmcVol"; + this.trkDmcVol.Size = new System.Drawing.Size(63, 160); + this.trkDmcVol.TabIndex = 16; + this.trkDmcVol.Text = "DMC"; + this.trkDmcVol.Value = 50; + // + // trkNoiseVol + // + this.trkNoiseVol.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkNoiseVol.Location = new System.Drawing.Point(292, 0); + this.trkNoiseVol.Margin = new System.Windows.Forms.Padding(0); + this.trkNoiseVol.Maximum = 100; + this.trkNoiseVol.MaximumSize = new System.Drawing.Size(63, 160); + this.trkNoiseVol.Minimum = 0; + this.trkNoiseVol.MinimumSize = new System.Drawing.Size(63, 160); + this.trkNoiseVol.Name = "trkNoiseVol"; + this.trkNoiseVol.Size = new System.Drawing.Size(63, 160); + this.trkNoiseVol.TabIndex = 15; + this.trkNoiseVol.Text = "Noise"; + this.trkNoiseVol.Value = 50; + // + // trkTriangleVol + // + this.trkTriangleVol.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkTriangleVol.Location = new System.Drawing.Point(220, 0); + this.trkTriangleVol.Margin = new System.Windows.Forms.Padding(0); + this.trkTriangleVol.Maximum = 100; + this.trkTriangleVol.MaximumSize = new System.Drawing.Size(63, 160); + this.trkTriangleVol.Minimum = 0; + this.trkTriangleVol.MinimumSize = new System.Drawing.Size(63, 160); + this.trkTriangleVol.Name = "trkTriangleVol"; + this.trkTriangleVol.Size = new System.Drawing.Size(63, 160); + this.trkTriangleVol.TabIndex = 14; + this.trkTriangleVol.Text = "Triangle"; + this.trkTriangleVol.Value = 50; + // + // trkSquare2Vol + // + this.trkSquare2Vol.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkSquare2Vol.Location = new System.Drawing.Point(148, 0); + this.trkSquare2Vol.Margin = new System.Windows.Forms.Padding(0); + this.trkSquare2Vol.Maximum = 100; + this.trkSquare2Vol.MaximumSize = new System.Drawing.Size(63, 160); + this.trkSquare2Vol.Minimum = 0; + this.trkSquare2Vol.MinimumSize = new System.Drawing.Size(63, 160); + this.trkSquare2Vol.Name = "trkSquare2Vol"; + this.trkSquare2Vol.Size = new System.Drawing.Size(63, 160); + this.trkSquare2Vol.TabIndex = 13; + this.trkSquare2Vol.Text = "Square 2"; + this.trkSquare2Vol.Value = 50; + // + // trkSquare1Vol + // + this.trkSquare1Vol.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkSquare1Vol.Location = new System.Drawing.Point(76, 0); + this.trkSquare1Vol.Margin = new System.Windows.Forms.Padding(0); + this.trkSquare1Vol.Maximum = 100; + this.trkSquare1Vol.MaximumSize = new System.Drawing.Size(63, 160); + this.trkSquare1Vol.Minimum = 0; + this.trkSquare1Vol.MinimumSize = new System.Drawing.Size(63, 160); + this.trkSquare1Vol.Name = "trkSquare1Vol"; + this.trkSquare1Vol.Size = new System.Drawing.Size(63, 160); + this.trkSquare1Vol.TabIndex = 12; + this.trkSquare1Vol.Text = "Square 1"; + this.trkSquare1Vol.Value = 50; + // + // trkMaster + // + this.trkMaster.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkMaster.Location = new System.Drawing.Point(4, 0); + this.trkMaster.Margin = new System.Windows.Forms.Padding(0); + this.trkMaster.Maximum = 100; + this.trkMaster.MaximumSize = new System.Drawing.Size(63, 160); + this.trkMaster.Minimum = 0; + this.trkMaster.MinimumSize = new System.Drawing.Size(63, 160); + this.trkMaster.Name = "trkMaster"; + this.trkMaster.Size = new System.Drawing.Size(63, 160); + this.trkMaster.TabIndex = 11; + this.trkMaster.Text = "Master"; + this.trkMaster.Value = 50; + // + // trkFdsVol + // + this.trkFdsVol.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkFdsVol.Location = new System.Drawing.Point(4, 160); + this.trkFdsVol.Margin = new System.Windows.Forms.Padding(0); + this.trkFdsVol.Maximum = 100; + this.trkFdsVol.MaximumSize = new System.Drawing.Size(63, 160); + this.trkFdsVol.Minimum = 0; + this.trkFdsVol.MinimumSize = new System.Drawing.Size(63, 160); + this.trkFdsVol.Name = "trkFdsVol"; + this.trkFdsVol.Size = new System.Drawing.Size(63, 160); + this.trkFdsVol.TabIndex = 17; + this.trkFdsVol.Text = "FDS"; + this.trkFdsVol.Value = 50; + // + // trkMmc5Vol + // + this.trkMmc5Vol.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkMmc5Vol.Location = new System.Drawing.Point(76, 160); + this.trkMmc5Vol.Margin = new System.Windows.Forms.Padding(0); + this.trkMmc5Vol.Maximum = 100; + this.trkMmc5Vol.MaximumSize = new System.Drawing.Size(63, 160); + this.trkMmc5Vol.Minimum = 0; + this.trkMmc5Vol.MinimumSize = new System.Drawing.Size(63, 160); + this.trkMmc5Vol.Name = "trkMmc5Vol"; + this.trkMmc5Vol.Size = new System.Drawing.Size(63, 160); + this.trkMmc5Vol.TabIndex = 18; + this.trkMmc5Vol.Text = "MMC5"; + this.trkMmc5Vol.Value = 50; + // + // trkVrc6Vol + // + this.trkVrc6Vol.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkVrc6Vol.Location = new System.Drawing.Point(148, 160); + this.trkVrc6Vol.Margin = new System.Windows.Forms.Padding(0); + this.trkVrc6Vol.Maximum = 100; + this.trkVrc6Vol.MaximumSize = new System.Drawing.Size(63, 160); + this.trkVrc6Vol.Minimum = 0; + this.trkVrc6Vol.MinimumSize = new System.Drawing.Size(63, 160); + this.trkVrc6Vol.Name = "trkVrc6Vol"; + this.trkVrc6Vol.Size = new System.Drawing.Size(63, 160); + this.trkVrc6Vol.TabIndex = 19; + this.trkVrc6Vol.Text = "VRC6"; + this.trkVrc6Vol.Value = 50; + // + // trkVrc7Vol + // + this.trkVrc7Vol.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkVrc7Vol.Location = new System.Drawing.Point(220, 160); + this.trkVrc7Vol.Margin = new System.Windows.Forms.Padding(0); + this.trkVrc7Vol.Maximum = 100; + this.trkVrc7Vol.MaximumSize = new System.Drawing.Size(63, 160); + this.trkVrc7Vol.Minimum = 0; + this.trkVrc7Vol.MinimumSize = new System.Drawing.Size(63, 160); + this.trkVrc7Vol.Name = "trkVrc7Vol"; + this.trkVrc7Vol.Size = new System.Drawing.Size(63, 160); + this.trkVrc7Vol.TabIndex = 20; + this.trkVrc7Vol.Text = "VRC7"; + this.trkVrc7Vol.Value = 50; + // + // trkNamco163Vol + // + this.trkNamco163Vol.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkNamco163Vol.Location = new System.Drawing.Point(292, 160); + this.trkNamco163Vol.Margin = new System.Windows.Forms.Padding(0); + this.trkNamco163Vol.Maximum = 100; + this.trkNamco163Vol.MaximumSize = new System.Drawing.Size(63, 160); + this.trkNamco163Vol.Minimum = 0; + this.trkNamco163Vol.MinimumSize = new System.Drawing.Size(63, 160); + this.trkNamco163Vol.Name = "trkNamco163Vol"; + this.trkNamco163Vol.Size = new System.Drawing.Size(63, 160); + this.trkNamco163Vol.TabIndex = 21; + this.trkNamco163Vol.Text = "Namco"; + this.trkNamco163Vol.Value = 50; + // + // trkSunsoft5b + // + this.trkSunsoft5b.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkSunsoft5b.Location = new System.Drawing.Point(432, 0); + this.trkSunsoft5b.Margin = new System.Windows.Forms.Padding(0); + this.trkSunsoft5b.Maximum = 100; + this.trkSunsoft5b.MaximumSize = new System.Drawing.Size(63, 160); + this.trkSunsoft5b.Minimum = 0; + this.trkSunsoft5b.MinimumSize = new System.Drawing.Size(63, 160); + this.trkSunsoft5b.Name = "trkSunsoft5b"; + this.trkSunsoft5b.Size = new System.Drawing.Size(63, 160); + this.trkSunsoft5b.TabIndex = 22; + this.trkSunsoft5b.Text = "Sunsoft"; + this.trkSunsoft5b.Value = 50; + // + // trkEPSGVol_L + // + this.trkEPSGVol_L.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkEPSGVol_L.Location = new System.Drawing.Point(364, 160); + this.trkEPSGVol_L.Margin = new System.Windows.Forms.Padding(0); + this.trkEPSGVol_L.Maximum = 100; + this.trkEPSGVol_L.MaximumSize = new System.Drawing.Size(63, 160); + this.trkEPSGVol_L.Minimum = 0; + this.trkEPSGVol_L.MinimumSize = new System.Drawing.Size(63, 160); + this.trkEPSGVol_L.Name = "trkEPSGVol_L"; + this.trkEPSGVol_L.Size = new System.Drawing.Size(63, 160); + this.trkEPSGVol_L.TabIndex = 22; + this.trkEPSGVol_L.Text = "EPSG Left"; + this.trkEPSGVol_L.Value = 100; + // + // trkEPSGVol_R + // + this.trkEPSGVol_R.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkEPSGVol_R.Location = new System.Drawing.Point(432, 160); + this.trkEPSGVol_R.Margin = new System.Windows.Forms.Padding(0); + this.trkEPSGVol_R.Maximum = 100; + this.trkEPSGVol_R.MaximumSize = new System.Drawing.Size(63, 160); + this.trkEPSGVol_R.Minimum = 0; + this.trkEPSGVol_R.MinimumSize = new System.Drawing.Size(63, 160); + this.trkEPSGVol_R.Name = "trkEPSGVol_R"; + this.trkEPSGVol_R.Size = new System.Drawing.Size(63, 160); + this.trkEPSGVol_R.TabIndex = 22; + this.trkEPSGVol_R.Text = "EPSG Right"; + this.trkEPSGVol_R.Value = 100; + // + // tableLayoutPanel2 + // + this.tableLayoutPanel2.ColumnCount = 2; + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel2.Controls.Add(this.chkEnableAudio, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.chkEnableEPSG, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.lblSampleRate, 0, 2); + this.tableLayoutPanel2.Controls.Add(this.lblAudioLatency, 0, 3); + this.tableLayoutPanel2.Controls.Add(this.cboSampleRate, 1, 2); + this.tableLayoutPanel2.Controls.Add(this.lblAudioDevice, 0, 1); + this.tableLayoutPanel2.Controls.Add(this.cboAudioDevice, 1, 1); + this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel7, 1, 3); + this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel8, 0, 5); + this.tableLayoutPanel2.Controls.Add(this.lblVolumeReductionSettings, 0, 5); + this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 3); + this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + this.tableLayoutPanel2.RowCount = 9; + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel2.Size = new System.Drawing.Size(463, 389); + this.tableLayoutPanel2.TabIndex = 3; + // + // lblVolumeReductionSettings + // + this.lblVolumeReductionSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.lblVolumeReductionSettings.AutoSize = true; + this.tableLayoutPanel2.SetColumnSpan(this.lblVolumeReductionSettings, 2); + this.lblVolumeReductionSettings.ForeColor = System.Drawing.SystemColors.GrayText; + this.lblVolumeReductionSettings.Location = new System.Drawing.Point(0, 136); + this.lblVolumeReductionSettings.Margin = new System.Windows.Forms.Padding(0, 3, 3, 0); + this.lblVolumeReductionSettings.Name = "lblVolumeReductionSettings"; + this.lblVolumeReductionSettings.Size = new System.Drawing.Size(94, 13); + this.lblVolumeReductionSettings.TabIndex = 24; + this.lblVolumeReductionSettings.Text = "Volume Reduction"; + // + // chkEnableAudio + // + this.chkEnableAudio.AutoSize = true; + this.tableLayoutPanel2.SetColumnSpan(this.chkEnableAudio, 2); + this.chkEnableAudio.Location = new System.Drawing.Point(6, 32); + this.chkEnableAudio.Margin = new System.Windows.Forms.Padding(6, 6, 6, 3); + this.chkEnableAudio.Name = "chkEnableAudio"; + this.chkEnableAudio.Size = new System.Drawing.Size(89, 17); + this.chkEnableAudio.TabIndex = 3; + this.chkEnableAudio.Text = "Enable Audio"; + this.chkEnableAudio.UseVisualStyleBackColor = true; + // + // chkEnableEPSG + // + this.chkEnableEPSG.AutoSize = true; + this.tableLayoutPanel2.SetColumnSpan(this.chkEnableEPSG, 2); + this.chkEnableEPSG.Location = new System.Drawing.Point(6, 6); + this.chkEnableEPSG.Margin = new System.Windows.Forms.Padding(6, 6, 6, 3); + this.chkEnableEPSG.Name = "chkEnableEPSG"; + this.chkEnableEPSG.Size = new System.Drawing.Size(91, 17); + this.chkEnableEPSG.TabIndex = 3; + this.chkEnableEPSG.Text = "Enable EPSG"; + this.chkEnableEPSG.UseVisualStyleBackColor = true; + // + // lblSampleRate + // + this.lblSampleRate.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblSampleRate.AutoSize = true; + this.lblSampleRate.Location = new System.Drawing.Point(3, 86); + this.lblSampleRate.Name = "lblSampleRate"; + this.lblSampleRate.Size = new System.Drawing.Size(71, 13); + this.lblSampleRate.TabIndex = 0; + this.lblSampleRate.Text = "Sample Rate:"; + // + // lblAudioLatency + // + this.lblAudioLatency.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblAudioLatency.AutoSize = true; + this.lblAudioLatency.Location = new System.Drawing.Point(3, 113); + this.lblAudioLatency.Name = "lblAudioLatency"; + this.lblAudioLatency.Size = new System.Drawing.Size(48, 13); + this.lblAudioLatency.TabIndex = 0; + this.lblAudioLatency.Text = "Latency:"; + // + // cboSampleRate + // + this.cboSampleRate.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cboSampleRate.FormattingEnabled = true; + this.cboSampleRate.Items.AddRange(new object[] { "11,025 Hz", "22,050 Hz", "44,100 Hz", "48,000 Hz", "96,000 Hz"}); - this.cboSampleRate.Location = new System.Drawing.Point(80, 56); - this.cboSampleRate.Name = "cboSampleRate"; - this.cboSampleRate.Size = new System.Drawing.Size(75, 21); - this.cboSampleRate.TabIndex = 5; - // - // lblAudioDevice - // - this.lblAudioDevice.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.lblAudioDevice.AutoSize = true; - this.lblAudioDevice.Location = new System.Drawing.Point(3, 33); - this.lblAudioDevice.Name = "lblAudioDevice"; - this.lblAudioDevice.Size = new System.Drawing.Size(44, 13); - this.lblAudioDevice.TabIndex = 6; - this.lblAudioDevice.Text = "Device:"; - // - // cboAudioDevice - // - this.cboAudioDevice.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboAudioDevice.FormattingEnabled = true; - this.cboAudioDevice.Location = new System.Drawing.Point(80, 29); - this.cboAudioDevice.Name = "cboAudioDevice"; - this.cboAudioDevice.Size = new System.Drawing.Size(209, 21); - this.cboAudioDevice.TabIndex = 7; - // - // tableLayoutPanel7 - // - this.tableLayoutPanel7.AutoSize = true; - this.tableLayoutPanel7.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.tableLayoutPanel7.ColumnCount = 4; - this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel7.Controls.Add(this.lblLatencyWarning, 3, 0); - this.tableLayoutPanel7.Controls.Add(this.picLatencyWarning, 2, 0); - this.tableLayoutPanel7.Controls.Add(this.lblLatencyMs, 1, 0); - this.tableLayoutPanel7.Controls.Add(this.nudLatency, 0, 0); - this.tableLayoutPanel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel7.Location = new System.Drawing.Point(77, 80); - this.tableLayoutPanel7.Margin = new System.Windows.Forms.Padding(0); - this.tableLayoutPanel7.Name = "tableLayoutPanel7"; - this.tableLayoutPanel7.RowCount = 1; - this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel7.Size = new System.Drawing.Size(386, 27); - this.tableLayoutPanel7.TabIndex = 15; - // - // lblLatencyWarning - // - this.lblLatencyWarning.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.lblLatencyWarning.AutoSize = true; - this.lblLatencyWarning.Location = new System.Drawing.Point(98, 7); - this.lblLatencyWarning.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0); - this.lblLatencyWarning.Name = "lblLatencyWarning"; - this.lblLatencyWarning.Size = new System.Drawing.Size(192, 13); - this.lblLatencyWarning.TabIndex = 4; - this.lblLatencyWarning.Text = "Low values may cause sound problems"; - // - // picLatencyWarning - // - this.picLatencyWarning.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.picLatencyWarning.BackgroundImage = global::Mesen.GUI.Properties.Resources.Warning; - this.picLatencyWarning.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; - this.picLatencyWarning.Location = new System.Drawing.Point(82, 5); - this.picLatencyWarning.Margin = new System.Windows.Forms.Padding(5, 3, 0, 3); - this.picLatencyWarning.Name = "picLatencyWarning"; - this.picLatencyWarning.Size = new System.Drawing.Size(16, 16); - this.picLatencyWarning.TabIndex = 3; - this.picLatencyWarning.TabStop = false; - // - // lblLatencyMs - // - this.lblLatencyMs.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.lblLatencyMs.AutoSize = true; - this.lblLatencyMs.Location = new System.Drawing.Point(54, 7); - this.lblLatencyMs.Name = "lblLatencyMs"; - this.lblLatencyMs.Size = new System.Drawing.Size(20, 13); - this.lblLatencyMs.TabIndex = 2; - this.lblLatencyMs.Text = "ms"; - // - // nudLatency - // - this.nudLatency.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.nudLatency.DecimalPlaces = 0; - this.nudLatency.Increment = new decimal(new int[] { + this.cboSampleRate.Location = new System.Drawing.Point(80, 82); + this.cboSampleRate.Name = "cboSampleRate"; + this.cboSampleRate.Size = new System.Drawing.Size(75, 21); + this.cboSampleRate.TabIndex = 5; + // + // lblAudioDevice + // + this.lblAudioDevice.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblAudioDevice.AutoSize = true; + this.lblAudioDevice.Location = new System.Drawing.Point(3, 59); + this.lblAudioDevice.Name = "lblAudioDevice"; + this.lblAudioDevice.Size = new System.Drawing.Size(44, 13); + this.lblAudioDevice.TabIndex = 6; + this.lblAudioDevice.Text = "Device:"; + // + // cboAudioDevice + // + this.cboAudioDevice.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cboAudioDevice.FormattingEnabled = true; + this.cboAudioDevice.Location = new System.Drawing.Point(80, 55); + this.cboAudioDevice.Name = "cboAudioDevice"; + this.cboAudioDevice.Size = new System.Drawing.Size(209, 21); + this.cboAudioDevice.TabIndex = 7; + // + // tableLayoutPanel7 + // + this.tableLayoutPanel7.AutoSize = true; + this.tableLayoutPanel7.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tableLayoutPanel7.ColumnCount = 4; + this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel7.Controls.Add(this.lblLatencyWarning, 3, 0); + this.tableLayoutPanel7.Controls.Add(this.picLatencyWarning, 2, 0); + this.tableLayoutPanel7.Controls.Add(this.lblLatencyMs, 1, 0); + this.tableLayoutPanel7.Controls.Add(this.nudLatency, 0, 0); + this.tableLayoutPanel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel7.Location = new System.Drawing.Point(77, 106); + this.tableLayoutPanel7.Margin = new System.Windows.Forms.Padding(0); + this.tableLayoutPanel7.Name = "tableLayoutPanel7"; + this.tableLayoutPanel7.RowCount = 1; + this.tableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel7.Size = new System.Drawing.Size(386, 27); + this.tableLayoutPanel7.TabIndex = 15; + // + // lblLatencyWarning + // + this.lblLatencyWarning.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblLatencyWarning.AutoSize = true; + this.lblLatencyWarning.Location = new System.Drawing.Point(98, 7); + this.lblLatencyWarning.Margin = new System.Windows.Forms.Padding(0, 0, 3, 0); + this.lblLatencyWarning.Name = "lblLatencyWarning"; + this.lblLatencyWarning.Size = new System.Drawing.Size(192, 13); + this.lblLatencyWarning.TabIndex = 4; + this.lblLatencyWarning.Text = "Low values may cause sound problems"; + // + // picLatencyWarning + // + this.picLatencyWarning.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.picLatencyWarning.BackgroundImage = global::Mesen.GUI.Properties.Resources.Warning; + this.picLatencyWarning.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; + this.picLatencyWarning.Location = new System.Drawing.Point(82, 5); + this.picLatencyWarning.Margin = new System.Windows.Forms.Padding(5, 3, 0, 3); + this.picLatencyWarning.Name = "picLatencyWarning"; + this.picLatencyWarning.Size = new System.Drawing.Size(16, 16); + this.picLatencyWarning.TabIndex = 3; + this.picLatencyWarning.TabStop = false; + // + // lblLatencyMs + // + this.lblLatencyMs.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblLatencyMs.AutoSize = true; + this.lblLatencyMs.Location = new System.Drawing.Point(54, 7); + this.lblLatencyMs.Name = "lblLatencyMs"; + this.lblLatencyMs.Size = new System.Drawing.Size(20, 13); + this.lblLatencyMs.TabIndex = 2; + this.lblLatencyMs.Text = "ms"; + // + // nudLatency + // + this.nudLatency.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.nudLatency.DecimalPlaces = 0; + this.nudLatency.Increment = new decimal(new int[] { 1, 0, 0, 0}); - this.nudLatency.Location = new System.Drawing.Point(3, 3); - this.nudLatency.Maximum = new decimal(new int[] { + this.nudLatency.IsHex = false; + this.nudLatency.Location = new System.Drawing.Point(3, 3); + this.nudLatency.Maximum = new decimal(new int[] { 300, 0, 0, 0}); - this.nudLatency.MaximumSize = new System.Drawing.Size(10000, 20); - this.nudLatency.Minimum = new decimal(new int[] { + this.nudLatency.MaximumSize = new System.Drawing.Size(10000, 20); + this.nudLatency.Minimum = new decimal(new int[] { 15, 0, 0, 0}); - this.nudLatency.MinimumSize = new System.Drawing.Size(0, 21); - this.nudLatency.Name = "nudLatency"; - this.nudLatency.Size = new System.Drawing.Size(45, 21); - this.nudLatency.TabIndex = 1; - this.nudLatency.Value = new decimal(new int[] { + this.nudLatency.MinimumSize = new System.Drawing.Size(0, 21); + this.nudLatency.Name = "nudLatency"; + this.nudLatency.Size = new System.Drawing.Size(45, 21); + this.nudLatency.TabIndex = 1; + this.nudLatency.Value = new decimal(new int[] { 100, 0, 0, 0}); - this.nudLatency.ValueChanged += new System.EventHandler(this.nudLatency_ValueChanged); - // - // tableLayoutPanel8 - // - this.tableLayoutPanel8.ColumnCount = 2; - this.tableLayoutPanel2.SetColumnSpan(this.tableLayoutPanel8, 2); - this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel8.Controls.Add(this.chkReduceSoundInBackground, 0, 1); - this.tableLayoutPanel8.Controls.Add(this.chkReduceSoundInFastForward, 0, 2); - this.tableLayoutPanel8.Controls.Add(this.trkVolumeReduction, 1, 1); - this.tableLayoutPanel8.Controls.Add(this.chkMuteSoundInBackground, 0, 0); - this.tableLayoutPanel8.Location = new System.Drawing.Point(10, 132); - this.tableLayoutPanel8.Margin = new System.Windows.Forms.Padding(10, 3, 0, 0); - this.tableLayoutPanel8.Name = "tableLayoutPanel8"; - this.tableLayoutPanel8.RowCount = 4; - this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel8.Size = new System.Drawing.Size(453, 81); - this.tableLayoutPanel8.TabIndex = 25; - // - // chkReduceSoundInBackground - // - this.chkReduceSoundInBackground.AutoSize = true; - this.chkReduceSoundInBackground.Location = new System.Drawing.Point(3, 26); - this.chkReduceSoundInBackground.Name = "chkReduceSoundInBackground"; - this.chkReduceSoundInBackground.Size = new System.Drawing.Size(164, 17); - this.chkReduceSoundInBackground.TabIndex = 13; - this.chkReduceSoundInBackground.Text = "Reduce when in background"; - this.chkReduceSoundInBackground.UseVisualStyleBackColor = true; - this.chkReduceSoundInBackground.CheckedChanged += new System.EventHandler(this.chkReduceVolume_CheckedChanged); - // - // chkReduceSoundInFastForward - // - this.chkReduceSoundInFastForward.AutoSize = true; - this.chkReduceSoundInFastForward.Location = new System.Drawing.Point(3, 49); - this.chkReduceSoundInFastForward.Name = "chkReduceSoundInFastForward"; - this.chkReduceSoundInFastForward.Size = new System.Drawing.Size(225, 17); - this.chkReduceSoundInFastForward.TabIndex = 16; - this.chkReduceSoundInFastForward.Text = "Reduce when fast forwarding or rewinding"; - this.chkReduceSoundInFastForward.UseVisualStyleBackColor = true; - this.chkReduceSoundInFastForward.CheckedChanged += new System.EventHandler(this.chkReduceVolume_CheckedChanged); - // - // trkVolumeReduction - // - this.trkVolumeReduction.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkVolumeReduction.Enabled = false; - this.trkVolumeReduction.Location = new System.Drawing.Point(231, 23); - this.trkVolumeReduction.Margin = new System.Windows.Forms.Padding(0); - this.trkVolumeReduction.Maximum = 100; - this.trkVolumeReduction.MaximumSize = new System.Drawing.Size(400, 55); - this.trkVolumeReduction.Minimum = 0; - this.trkVolumeReduction.MinimumSize = new System.Drawing.Size(150, 55); - this.trkVolumeReduction.Name = "trkVolumeReduction"; - this.tableLayoutPanel8.SetRowSpan(this.trkVolumeReduction, 2); - this.trkVolumeReduction.Size = new System.Drawing.Size(222, 55); - this.trkVolumeReduction.TabIndex = 17; - this.trkVolumeReduction.Text = "Volume Reduction"; - this.trkVolumeReduction.Value = 50; - // - // chkMuteSoundInBackground - // - this.chkMuteSoundInBackground.AutoSize = true; - this.chkMuteSoundInBackground.Location = new System.Drawing.Point(3, 3); - this.chkMuteSoundInBackground.Name = "chkMuteSoundInBackground"; - this.chkMuteSoundInBackground.Size = new System.Drawing.Size(182, 17); - this.chkMuteSoundInBackground.TabIndex = 18; - this.chkMuteSoundInBackground.Text = "Mute sound when in background"; - this.chkMuteSoundInBackground.UseVisualStyleBackColor = true; - this.chkMuteSoundInBackground.CheckedChanged += new System.EventHandler(this.chkMuteWhenInBackground_CheckedChanged); - // - // btnReset - // - this.btnReset.AutoSize = true; - this.btnReset.Location = new System.Drawing.Point(6, 3); - this.btnReset.Name = "btnReset"; - this.btnReset.Size = new System.Drawing.Size(99, 23); - this.btnReset.TabIndex = 3; - this.btnReset.Text = "Reset to Defaults"; - this.btnReset.UseVisualStyleBackColor = true; - this.btnReset.Click += new System.EventHandler(this.btnReset_Click); - // - // tabMain - // - this.tabMain.Controls.Add(this.tpgGeneral); - this.tabMain.Controls.Add(this.tpgVolume); - this.tabMain.Controls.Add(this.tpgPanning); - this.tabMain.Controls.Add(this.tpgEqualizer); - this.tabMain.Controls.Add(this.tpgEffects); - this.tabMain.Controls.Add(this.tpgAdvanced); - this.tabMain.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabMain.Location = new System.Drawing.Point(0, 0); - this.tabMain.Name = "tabMain"; - this.tabMain.SelectedIndex = 0; - this.tabMain.Size = new System.Drawing.Size(477, 373); - this.tabMain.TabIndex = 4; - // - // tpgGeneral - // - this.tpgGeneral.Controls.Add(this.tableLayoutPanel2); - this.tpgGeneral.Location = new System.Drawing.Point(4, 22); - this.tpgGeneral.Name = "tpgGeneral"; - this.tpgGeneral.Padding = new System.Windows.Forms.Padding(3); - this.tpgGeneral.Size = new System.Drawing.Size(469, 347); - this.tpgGeneral.TabIndex = 0; - this.tpgGeneral.Text = "General"; - this.tpgGeneral.UseVisualStyleBackColor = true; - // - // tpgVolume - // - this.tpgVolume.Controls.Add(this.grpVolume); - this.tpgVolume.Location = new System.Drawing.Point(4, 22); - this.tpgVolume.Name = "tpgVolume"; - this.tpgVolume.Padding = new System.Windows.Forms.Padding(3); - this.tpgVolume.Size = new System.Drawing.Size(469, 347); - this.tpgVolume.TabIndex = 1; - this.tpgVolume.Text = "Volume"; - this.tpgVolume.UseVisualStyleBackColor = true; - // - // tpgPanning - // - this.tpgPanning.Controls.Add(this.tableLayoutPanel6); - this.tpgPanning.Location = new System.Drawing.Point(4, 22); - this.tpgPanning.Name = "tpgPanning"; - this.tpgPanning.Padding = new System.Windows.Forms.Padding(3); - this.tpgPanning.Size = new System.Drawing.Size(469, 347); - this.tpgPanning.TabIndex = 4; - this.tpgPanning.Text = "Panning"; - this.tpgPanning.UseVisualStyleBackColor = true; - // - // tableLayoutPanel6 - // - this.tableLayoutPanel6.ColumnCount = 2; - this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); - this.tableLayoutPanel6.Controls.Add(this.trkSquare1Pan, 0, 0); - this.tableLayoutPanel6.Controls.Add(this.trkFdsPan, 1, 0); - this.tableLayoutPanel6.Controls.Add(this.trkSquare2Pan, 0, 1); - this.tableLayoutPanel6.Controls.Add(this.trkMmc5Pan, 1, 1); - this.tableLayoutPanel6.Controls.Add(this.trkTrianglePan, 0, 2); - this.tableLayoutPanel6.Controls.Add(this.trkNoisePan, 0, 3); - this.tableLayoutPanel6.Controls.Add(this.trkDmcPan, 0, 4); - this.tableLayoutPanel6.Controls.Add(this.trkVrc6Pan, 1, 2); - this.tableLayoutPanel6.Controls.Add(this.trkVrc7Pan, 1, 3); - this.tableLayoutPanel6.Controls.Add(this.trkNamcoPan, 1, 4); - this.tableLayoutPanel6.Controls.Add(this.trkSunsoftPan, 1, 5); - this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel6.Location = new System.Drawing.Point(3, 3); - this.tableLayoutPanel6.Name = "tableLayoutPanel6"; - this.tableLayoutPanel6.RowCount = 7; - this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tableLayoutPanel6.Size = new System.Drawing.Size(463, 341); - this.tableLayoutPanel6.TabIndex = 3; - // - // trkSquare1Pan - // - this.trkSquare1Pan.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkSquare1Pan.Location = new System.Drawing.Point(12, 0); - this.trkSquare1Pan.Margin = new System.Windows.Forms.Padding(0); - this.trkSquare1Pan.Maximum = 100; - this.trkSquare1Pan.MaximumSize = new System.Drawing.Size(63, 160); - this.trkSquare1Pan.Minimum = -100; - this.trkSquare1Pan.MinimumSize = new System.Drawing.Size(206, 55); - this.trkSquare1Pan.Name = "trkSquare1Pan"; - this.trkSquare1Pan.Size = new System.Drawing.Size(206, 55); - this.trkSquare1Pan.TabIndex = 12; - this.trkSquare1Pan.Text = "Square 1"; - this.trkSquare1Pan.Value = 0; - // - // trkFdsPan - // - this.trkFdsPan.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkFdsPan.Location = new System.Drawing.Point(244, 0); - this.trkFdsPan.Margin = new System.Windows.Forms.Padding(0); - this.trkFdsPan.Maximum = 100; - this.trkFdsPan.MaximumSize = new System.Drawing.Size(63, 160); - this.trkFdsPan.Minimum = -100; - this.trkFdsPan.MinimumSize = new System.Drawing.Size(206, 55); - this.trkFdsPan.Name = "trkFdsPan"; - this.trkFdsPan.Size = new System.Drawing.Size(206, 55); - this.trkFdsPan.TabIndex = 17; - this.trkFdsPan.Text = "FDS"; - this.trkFdsPan.Value = 0; - // - // trkSquare2Pan - // - this.trkSquare2Pan.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkSquare2Pan.Location = new System.Drawing.Point(12, 55); - this.trkSquare2Pan.Margin = new System.Windows.Forms.Padding(0); - this.trkSquare2Pan.Maximum = 100; - this.trkSquare2Pan.MaximumSize = new System.Drawing.Size(63, 160); - this.trkSquare2Pan.Minimum = -100; - this.trkSquare2Pan.MinimumSize = new System.Drawing.Size(206, 55); - this.trkSquare2Pan.Name = "trkSquare2Pan"; - this.trkSquare2Pan.Size = new System.Drawing.Size(206, 55); - this.trkSquare2Pan.TabIndex = 13; - this.trkSquare2Pan.Text = "Square 2"; - this.trkSquare2Pan.Value = 0; - // - // trkMmc5Pan - // - this.trkMmc5Pan.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkMmc5Pan.Location = new System.Drawing.Point(244, 55); - this.trkMmc5Pan.Margin = new System.Windows.Forms.Padding(0); - this.trkMmc5Pan.Maximum = 100; - this.trkMmc5Pan.MaximumSize = new System.Drawing.Size(63, 160); - this.trkMmc5Pan.Minimum = -100; - this.trkMmc5Pan.MinimumSize = new System.Drawing.Size(206, 55); - this.trkMmc5Pan.Name = "trkMmc5Pan"; - this.trkMmc5Pan.Size = new System.Drawing.Size(206, 55); - this.trkMmc5Pan.TabIndex = 18; - this.trkMmc5Pan.Text = "MMC5"; - this.trkMmc5Pan.Value = 0; - // - // trkTrianglePan - // - this.trkTrianglePan.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkTrianglePan.Location = new System.Drawing.Point(12, 110); - this.trkTrianglePan.Margin = new System.Windows.Forms.Padding(0); - this.trkTrianglePan.Maximum = 100; - this.trkTrianglePan.MaximumSize = new System.Drawing.Size(63, 160); - this.trkTrianglePan.Minimum = -100; - this.trkTrianglePan.MinimumSize = new System.Drawing.Size(206, 55); - this.trkTrianglePan.Name = "trkTrianglePan"; - this.trkTrianglePan.Size = new System.Drawing.Size(206, 55); - this.trkTrianglePan.TabIndex = 14; - this.trkTrianglePan.Text = "Triangle"; - this.trkTrianglePan.Value = 0; - // - // trkNoisePan - // - this.trkNoisePan.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkNoisePan.Location = new System.Drawing.Point(12, 165); - this.trkNoisePan.Margin = new System.Windows.Forms.Padding(0); - this.trkNoisePan.Maximum = 100; - this.trkNoisePan.MaximumSize = new System.Drawing.Size(63, 160); - this.trkNoisePan.Minimum = -100; - this.trkNoisePan.MinimumSize = new System.Drawing.Size(206, 55); - this.trkNoisePan.Name = "trkNoisePan"; - this.trkNoisePan.Size = new System.Drawing.Size(206, 55); - this.trkNoisePan.TabIndex = 15; - this.trkNoisePan.Text = "Noise"; - this.trkNoisePan.Value = 0; - // - // trkDmcPan - // - this.trkDmcPan.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkDmcPan.Location = new System.Drawing.Point(12, 220); - this.trkDmcPan.Margin = new System.Windows.Forms.Padding(0); - this.trkDmcPan.Maximum = 100; - this.trkDmcPan.MaximumSize = new System.Drawing.Size(63, 160); - this.trkDmcPan.Minimum = -100; - this.trkDmcPan.MinimumSize = new System.Drawing.Size(206, 55); - this.trkDmcPan.Name = "trkDmcPan"; - this.trkDmcPan.Size = new System.Drawing.Size(206, 55); - this.trkDmcPan.TabIndex = 16; - this.trkDmcPan.Text = "DMC"; - this.trkDmcPan.Value = 0; - // - // trkVrc6Pan - // - this.trkVrc6Pan.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkVrc6Pan.Location = new System.Drawing.Point(244, 110); - this.trkVrc6Pan.Margin = new System.Windows.Forms.Padding(0); - this.trkVrc6Pan.Maximum = 100; - this.trkVrc6Pan.MaximumSize = new System.Drawing.Size(63, 160); - this.trkVrc6Pan.Minimum = -100; - this.trkVrc6Pan.MinimumSize = new System.Drawing.Size(206, 55); - this.trkVrc6Pan.Name = "trkVrc6Pan"; - this.trkVrc6Pan.Size = new System.Drawing.Size(206, 55); - this.trkVrc6Pan.TabIndex = 19; - this.trkVrc6Pan.Text = "VRC6"; - this.trkVrc6Pan.Value = 0; - // - // trkVrc7Pan - // - this.trkVrc7Pan.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkVrc7Pan.Location = new System.Drawing.Point(244, 165); - this.trkVrc7Pan.Margin = new System.Windows.Forms.Padding(0); - this.trkVrc7Pan.Maximum = 100; - this.trkVrc7Pan.MaximumSize = new System.Drawing.Size(63, 160); - this.trkVrc7Pan.Minimum = -100; - this.trkVrc7Pan.MinimumSize = new System.Drawing.Size(206, 55); - this.trkVrc7Pan.Name = "trkVrc7Pan"; - this.trkVrc7Pan.Size = new System.Drawing.Size(206, 55); - this.trkVrc7Pan.TabIndex = 20; - this.trkVrc7Pan.Text = "VRC7"; - this.trkVrc7Pan.Value = 0; - // - // trkNamcoPan - // - this.trkNamcoPan.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkNamcoPan.Location = new System.Drawing.Point(244, 220); - this.trkNamcoPan.Margin = new System.Windows.Forms.Padding(0); - this.trkNamcoPan.Maximum = 100; - this.trkNamcoPan.MaximumSize = new System.Drawing.Size(63, 160); - this.trkNamcoPan.Minimum = -100; - this.trkNamcoPan.MinimumSize = new System.Drawing.Size(206, 55); - this.trkNamcoPan.Name = "trkNamcoPan"; - this.trkNamcoPan.Size = new System.Drawing.Size(206, 55); - this.trkNamcoPan.TabIndex = 21; - this.trkNamcoPan.Text = "Namco"; - this.trkNamcoPan.Value = 0; - // - // trkSunsoftPan - // - this.trkSunsoftPan.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.trkSunsoftPan.Location = new System.Drawing.Point(244, 275); - this.trkSunsoftPan.Margin = new System.Windows.Forms.Padding(0); - this.trkSunsoftPan.Maximum = 100; - this.trkSunsoftPan.MaximumSize = new System.Drawing.Size(63, 160); - this.trkSunsoftPan.Minimum = -100; - this.trkSunsoftPan.MinimumSize = new System.Drawing.Size(206, 55); - this.trkSunsoftPan.Name = "trkSunsoftPan"; - this.trkSunsoftPan.Size = new System.Drawing.Size(206, 55); - this.trkSunsoftPan.TabIndex = 22; - this.trkSunsoftPan.Text = "Sunsoft"; - this.trkSunsoftPan.Value = 0; - // - // tpgEqualizer - // - this.tpgEqualizer.Controls.Add(this.groupBox1); - this.tpgEqualizer.Location = new System.Drawing.Point(4, 22); - this.tpgEqualizer.Name = "tpgEqualizer"; - this.tpgEqualizer.Padding = new System.Windows.Forms.Padding(3); - this.tpgEqualizer.Size = new System.Drawing.Size(469, 347); - this.tpgEqualizer.TabIndex = 5; - this.tpgEqualizer.Text = "Equalizer"; - this.tpgEqualizer.UseVisualStyleBackColor = true; - // - // groupBox1 - // - this.groupBox1.Controls.Add(this.chkEnableEqualizer); - this.groupBox1.Controls.Add(this.tlpEqualizer); - this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; - this.groupBox1.Location = new System.Drawing.Point(3, 3); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(463, 341); - this.groupBox1.TabIndex = 4; - this.groupBox1.TabStop = false; - // - // chkEnableEqualizer - // - this.chkEnableEqualizer.AutoSize = true; - this.chkEnableEqualizer.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.chkEnableEqualizer.Location = new System.Drawing.Point(7, 0); - this.chkEnableEqualizer.Name = "chkEnableEqualizer"; - this.chkEnableEqualizer.Padding = new System.Windows.Forms.Padding(5, 0, 0, 0); - this.chkEnableEqualizer.Size = new System.Drawing.Size(110, 17); - this.chkEnableEqualizer.TabIndex = 5; - this.chkEnableEqualizer.Text = "Enable Equalizer"; - this.chkEnableEqualizer.UseVisualStyleBackColor = false; - this.chkEnableEqualizer.CheckedChanged += new System.EventHandler(this.chkEnableEqualizer_CheckedChanged); - // - // tlpEqualizer - // - this.tlpEqualizer.ColumnCount = 10; - this.tlpEqualizer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tlpEqualizer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tlpEqualizer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tlpEqualizer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tlpEqualizer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tlpEqualizer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tlpEqualizer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tlpEqualizer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tlpEqualizer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tlpEqualizer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); - this.tlpEqualizer.Controls.Add(this.trkBand6Gain, 5, 1); - this.tlpEqualizer.Controls.Add(this.trkBand5Gain, 4, 1); - this.tlpEqualizer.Controls.Add(this.trkBand4Gain, 3, 1); - this.tlpEqualizer.Controls.Add(this.trkBand3Gain, 2, 1); - this.tlpEqualizer.Controls.Add(this.trkBand2Gain, 1, 1); - this.tlpEqualizer.Controls.Add(this.trkBand1Gain, 0, 1); - this.tlpEqualizer.Controls.Add(this.trkBand11Gain, 0, 2); - this.tlpEqualizer.Controls.Add(this.trkBand12Gain, 1, 2); - this.tlpEqualizer.Controls.Add(this.trkBand13Gain, 2, 2); - this.tlpEqualizer.Controls.Add(this.trkBand14Gain, 3, 2); - this.tlpEqualizer.Controls.Add(this.trkBand15Gain, 4, 2); - this.tlpEqualizer.Controls.Add(this.trkBand16Gain, 5, 2); - this.tlpEqualizer.Controls.Add(this.trkBand7Gain, 6, 1); - this.tlpEqualizer.Controls.Add(this.trkBand8Gain, 7, 1); - this.tlpEqualizer.Controls.Add(this.trkBand9Gain, 8, 1); - this.tlpEqualizer.Controls.Add(this.trkBand10Gain, 9, 1); - this.tlpEqualizer.Controls.Add(this.trkBand17Gain, 6, 2); - this.tlpEqualizer.Controls.Add(this.trkBand18Gain, 7, 2); - this.tlpEqualizer.Controls.Add(this.trkBand19Gain, 8, 2); - this.tlpEqualizer.Controls.Add(this.trkBand20Gain, 9, 2); - this.tlpEqualizer.Controls.Add(this.flowLayoutPanel6, 0, 0); - this.tlpEqualizer.Controls.Add(this.flowLayoutPanel7, 6, 0); - this.tlpEqualizer.Dock = System.Windows.Forms.DockStyle.Fill; - this.tlpEqualizer.Location = new System.Drawing.Point(3, 16); - this.tlpEqualizer.Name = "tlpEqualizer"; - this.tlpEqualizer.RowCount = 4; - this.tlpEqualizer.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tlpEqualizer.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tlpEqualizer.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tlpEqualizer.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.tlpEqualizer.Size = new System.Drawing.Size(457, 322); - this.tlpEqualizer.TabIndex = 3; - // - // trkBand6Gain - // - this.trkBand6Gain.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkBand6Gain.Location = new System.Drawing.Point(225, 23); - this.trkBand6Gain.Margin = new System.Windows.Forms.Padding(0); - this.trkBand6Gain.Maximum = 200; - this.trkBand6Gain.MaximumSize = new System.Drawing.Size(63, 160); - this.trkBand6Gain.Minimum = -200; - this.trkBand6Gain.MinimumSize = new System.Drawing.Size(34, 160); - this.trkBand6Gain.Name = "trkBand6Gain"; - this.trkBand6Gain.Size = new System.Drawing.Size(45, 160); - this.trkBand6Gain.TabIndex = 16; - this.trkBand6Gain.Text = "225 Hz"; - this.trkBand6Gain.Value = 50; - this.trkBand6Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); - // - // trkBand5Gain - // - this.trkBand5Gain.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkBand5Gain.Location = new System.Drawing.Point(180, 23); - this.trkBand5Gain.Margin = new System.Windows.Forms.Padding(0); - this.trkBand5Gain.Maximum = 200; - this.trkBand5Gain.MaximumSize = new System.Drawing.Size(63, 160); - this.trkBand5Gain.Minimum = -200; - this.trkBand5Gain.MinimumSize = new System.Drawing.Size(34, 160); - this.trkBand5Gain.Name = "trkBand5Gain"; - this.trkBand5Gain.Size = new System.Drawing.Size(45, 160); - this.trkBand5Gain.TabIndex = 15; - this.trkBand5Gain.Text = "160 Hz"; - this.trkBand5Gain.Value = 50; - this.trkBand5Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); - // - // trkBand4Gain - // - this.trkBand4Gain.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkBand4Gain.Location = new System.Drawing.Point(135, 23); - this.trkBand4Gain.Margin = new System.Windows.Forms.Padding(0); - this.trkBand4Gain.Maximum = 200; - this.trkBand4Gain.MaximumSize = new System.Drawing.Size(63, 160); - this.trkBand4Gain.Minimum = -200; - this.trkBand4Gain.MinimumSize = new System.Drawing.Size(34, 160); - this.trkBand4Gain.Name = "trkBand4Gain"; - this.trkBand4Gain.Size = new System.Drawing.Size(45, 160); - this.trkBand4Gain.TabIndex = 14; - this.trkBand4Gain.Text = "113 Hz"; - this.trkBand4Gain.Value = 50; - this.trkBand4Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); - // - // trkBand3Gain - // - this.trkBand3Gain.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkBand3Gain.Location = new System.Drawing.Point(90, 23); - this.trkBand3Gain.Margin = new System.Windows.Forms.Padding(0); - this.trkBand3Gain.Maximum = 200; - this.trkBand3Gain.MaximumSize = new System.Drawing.Size(63, 160); - this.trkBand3Gain.Minimum = -200; - this.trkBand3Gain.MinimumSize = new System.Drawing.Size(34, 160); - this.trkBand3Gain.Name = "trkBand3Gain"; - this.trkBand3Gain.Size = new System.Drawing.Size(45, 160); - this.trkBand3Gain.TabIndex = 13; - this.trkBand3Gain.Text = "80 Hz"; - this.trkBand3Gain.Value = 50; - this.trkBand3Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); - // - // trkBand2Gain - // - this.trkBand2Gain.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkBand2Gain.Location = new System.Drawing.Point(45, 23); - this.trkBand2Gain.Margin = new System.Windows.Forms.Padding(0); - this.trkBand2Gain.Maximum = 200; - this.trkBand2Gain.MaximumSize = new System.Drawing.Size(63, 160); - this.trkBand2Gain.Minimum = -200; - this.trkBand2Gain.MinimumSize = new System.Drawing.Size(34, 160); - this.trkBand2Gain.Name = "trkBand2Gain"; - this.trkBand2Gain.Size = new System.Drawing.Size(45, 160); - this.trkBand2Gain.TabIndex = 12; - this.trkBand2Gain.Text = "56 Hz"; - this.trkBand2Gain.Value = 50; - this.trkBand2Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); - // - // trkBand1Gain - // - this.trkBand1Gain.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkBand1Gain.Location = new System.Drawing.Point(0, 23); - this.trkBand1Gain.Margin = new System.Windows.Forms.Padding(0); - this.trkBand1Gain.Maximum = 200; - this.trkBand1Gain.MaximumSize = new System.Drawing.Size(63, 160); - this.trkBand1Gain.Minimum = -200; - this.trkBand1Gain.MinimumSize = new System.Drawing.Size(34, 160); - this.trkBand1Gain.Name = "trkBand1Gain"; - this.trkBand1Gain.Size = new System.Drawing.Size(45, 160); - this.trkBand1Gain.TabIndex = 11; - this.trkBand1Gain.Text = "40 Hz"; - this.trkBand1Gain.Value = 50; - this.trkBand1Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); - // - // trkBand11Gain - // - this.trkBand11Gain.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkBand11Gain.Location = new System.Drawing.Point(0, 183); - this.trkBand11Gain.Margin = new System.Windows.Forms.Padding(0); - this.trkBand11Gain.Maximum = 200; - this.trkBand11Gain.MaximumSize = new System.Drawing.Size(63, 160); - this.trkBand11Gain.Minimum = -200; - this.trkBand11Gain.MinimumSize = new System.Drawing.Size(34, 160); - this.trkBand11Gain.Name = "trkBand11Gain"; - this.trkBand11Gain.Size = new System.Drawing.Size(45, 160); - this.trkBand11Gain.TabIndex = 17; - this.trkBand11Gain.Text = "1.0 kHz"; - this.trkBand11Gain.Value = 50; - this.trkBand11Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); - // - // trkBand12Gain - // - this.trkBand12Gain.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkBand12Gain.Location = new System.Drawing.Point(45, 183); - this.trkBand12Gain.Margin = new System.Windows.Forms.Padding(0); - this.trkBand12Gain.Maximum = 200; - this.trkBand12Gain.MaximumSize = new System.Drawing.Size(63, 160); - this.trkBand12Gain.Minimum = -200; - this.trkBand12Gain.MinimumSize = new System.Drawing.Size(34, 160); - this.trkBand12Gain.Name = "trkBand12Gain"; - this.trkBand12Gain.Size = new System.Drawing.Size(45, 160); - this.trkBand12Gain.TabIndex = 18; - this.trkBand12Gain.Text = "2.0 kHz"; - this.trkBand12Gain.Value = 50; - this.trkBand12Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); - // - // trkBand13Gain - // - this.trkBand13Gain.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkBand13Gain.Location = new System.Drawing.Point(90, 183); - this.trkBand13Gain.Margin = new System.Windows.Forms.Padding(0); - this.trkBand13Gain.Maximum = 200; - this.trkBand13Gain.MaximumSize = new System.Drawing.Size(63, 160); - this.trkBand13Gain.Minimum = -200; - this.trkBand13Gain.MinimumSize = new System.Drawing.Size(34, 160); - this.trkBand13Gain.Name = "trkBand13Gain"; - this.trkBand13Gain.Size = new System.Drawing.Size(45, 160); - this.trkBand13Gain.TabIndex = 19; - this.trkBand13Gain.Text = "3.0 kHz"; - this.trkBand13Gain.Value = 50; - this.trkBand13Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); - // - // trkBand14Gain - // - this.trkBand14Gain.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkBand14Gain.Location = new System.Drawing.Point(135, 183); - this.trkBand14Gain.Margin = new System.Windows.Forms.Padding(0); - this.trkBand14Gain.Maximum = 200; - this.trkBand14Gain.MaximumSize = new System.Drawing.Size(63, 160); - this.trkBand14Gain.Minimum = -200; - this.trkBand14Gain.MinimumSize = new System.Drawing.Size(34, 160); - this.trkBand14Gain.Name = "trkBand14Gain"; - this.trkBand14Gain.Size = new System.Drawing.Size(45, 160); - this.trkBand14Gain.TabIndex = 20; - this.trkBand14Gain.Text = "4.0 kHz"; - this.trkBand14Gain.Value = 50; - this.trkBand14Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); - // - // trkBand15Gain - // - this.trkBand15Gain.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkBand15Gain.Location = new System.Drawing.Point(180, 183); - this.trkBand15Gain.Margin = new System.Windows.Forms.Padding(0); - this.trkBand15Gain.Maximum = 200; - this.trkBand15Gain.MaximumSize = new System.Drawing.Size(63, 160); - this.trkBand15Gain.Minimum = -200; - this.trkBand15Gain.MinimumSize = new System.Drawing.Size(34, 160); - this.trkBand15Gain.Name = "trkBand15Gain"; - this.trkBand15Gain.Size = new System.Drawing.Size(45, 160); - this.trkBand15Gain.TabIndex = 21; - this.trkBand15Gain.Text = "5.0 kHz"; - this.trkBand15Gain.Value = 50; - this.trkBand15Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); - // - // trkBand16Gain - // - this.trkBand16Gain.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkBand16Gain.Location = new System.Drawing.Point(225, 183); - this.trkBand16Gain.Margin = new System.Windows.Forms.Padding(0); - this.trkBand16Gain.Maximum = 200; - this.trkBand16Gain.MaximumSize = new System.Drawing.Size(63, 160); - this.trkBand16Gain.Minimum = -200; - this.trkBand16Gain.MinimumSize = new System.Drawing.Size(34, 160); - this.trkBand16Gain.Name = "trkBand16Gain"; - this.trkBand16Gain.Size = new System.Drawing.Size(45, 160); - this.trkBand16Gain.TabIndex = 22; - this.trkBand16Gain.Text = "6.0 kHz"; - this.trkBand16Gain.Value = 50; - this.trkBand16Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); - // - // trkBand7Gain - // - this.trkBand7Gain.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkBand7Gain.Location = new System.Drawing.Point(270, 23); - this.trkBand7Gain.Margin = new System.Windows.Forms.Padding(0); - this.trkBand7Gain.Maximum = 200; - this.trkBand7Gain.MaximumSize = new System.Drawing.Size(63, 160); - this.trkBand7Gain.Minimum = -200; - this.trkBand7Gain.MinimumSize = new System.Drawing.Size(34, 160); - this.trkBand7Gain.Name = "trkBand7Gain"; - this.trkBand7Gain.Size = new System.Drawing.Size(45, 160); - this.trkBand7Gain.TabIndex = 23; - this.trkBand7Gain.Text = "320 Hz"; - this.trkBand7Gain.Value = 50; - this.trkBand7Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); - // - // trkBand8Gain - // - this.trkBand8Gain.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkBand8Gain.Location = new System.Drawing.Point(315, 23); - this.trkBand8Gain.Margin = new System.Windows.Forms.Padding(0); - this.trkBand8Gain.Maximum = 200; - this.trkBand8Gain.MaximumSize = new System.Drawing.Size(63, 160); - this.trkBand8Gain.Minimum = -200; - this.trkBand8Gain.MinimumSize = new System.Drawing.Size(34, 160); - this.trkBand8Gain.Name = "trkBand8Gain"; - this.trkBand8Gain.Size = new System.Drawing.Size(45, 160); - this.trkBand8Gain.TabIndex = 24; - this.trkBand8Gain.Text = "450 Hz"; - this.trkBand8Gain.Value = 50; - this.trkBand8Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); - // - // trkBand9Gain - // - this.trkBand9Gain.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkBand9Gain.Location = new System.Drawing.Point(360, 23); - this.trkBand9Gain.Margin = new System.Windows.Forms.Padding(0); - this.trkBand9Gain.Maximum = 200; - this.trkBand9Gain.MaximumSize = new System.Drawing.Size(63, 160); - this.trkBand9Gain.Minimum = -200; - this.trkBand9Gain.MinimumSize = new System.Drawing.Size(34, 160); - this.trkBand9Gain.Name = "trkBand9Gain"; - this.trkBand9Gain.Size = new System.Drawing.Size(45, 160); - this.trkBand9Gain.TabIndex = 25; - this.trkBand9Gain.Text = "600 Hz"; - this.trkBand9Gain.Value = 50; - this.trkBand9Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); - // - // trkBand10Gain - // - this.trkBand10Gain.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkBand10Gain.Location = new System.Drawing.Point(405, 23); - this.trkBand10Gain.Margin = new System.Windows.Forms.Padding(0); - this.trkBand10Gain.Maximum = 200; - this.trkBand10Gain.MaximumSize = new System.Drawing.Size(63, 160); - this.trkBand10Gain.Minimum = -200; - this.trkBand10Gain.MinimumSize = new System.Drawing.Size(34, 160); - this.trkBand10Gain.Name = "trkBand10Gain"; - this.trkBand10Gain.Size = new System.Drawing.Size(52, 160); - this.trkBand10Gain.TabIndex = 26; - this.trkBand10Gain.Text = "750 Hz"; - this.trkBand10Gain.Value = 50; - this.trkBand10Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); - // - // trkBand17Gain - // - this.trkBand17Gain.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkBand17Gain.Location = new System.Drawing.Point(270, 183); - this.trkBand17Gain.Margin = new System.Windows.Forms.Padding(0); - this.trkBand17Gain.Maximum = 200; - this.trkBand17Gain.MaximumSize = new System.Drawing.Size(63, 160); - this.trkBand17Gain.Minimum = -200; - this.trkBand17Gain.MinimumSize = new System.Drawing.Size(34, 160); - this.trkBand17Gain.Name = "trkBand17Gain"; - this.trkBand17Gain.Size = new System.Drawing.Size(45, 160); - this.trkBand17Gain.TabIndex = 27; - this.trkBand17Gain.Text = "7.0 kHz"; - this.trkBand17Gain.Value = 50; - this.trkBand17Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); - // - // trkBand18Gain - // - this.trkBand18Gain.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkBand18Gain.Location = new System.Drawing.Point(315, 183); - this.trkBand18Gain.Margin = new System.Windows.Forms.Padding(0); - this.trkBand18Gain.Maximum = 200; - this.trkBand18Gain.MaximumSize = new System.Drawing.Size(63, 160); - this.trkBand18Gain.Minimum = -200; - this.trkBand18Gain.MinimumSize = new System.Drawing.Size(34, 160); - this.trkBand18Gain.Name = "trkBand18Gain"; - this.trkBand18Gain.Size = new System.Drawing.Size(45, 160); - this.trkBand18Gain.TabIndex = 28; - this.trkBand18Gain.Text = "10.0 kHz"; - this.trkBand18Gain.Value = 50; - this.trkBand18Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); - // - // trkBand19Gain - // - this.trkBand19Gain.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkBand19Gain.Location = new System.Drawing.Point(360, 183); - this.trkBand19Gain.Margin = new System.Windows.Forms.Padding(0); - this.trkBand19Gain.Maximum = 200; - this.trkBand19Gain.MaximumSize = new System.Drawing.Size(63, 160); - this.trkBand19Gain.Minimum = -200; - this.trkBand19Gain.MinimumSize = new System.Drawing.Size(34, 160); - this.trkBand19Gain.Name = "trkBand19Gain"; - this.trkBand19Gain.Size = new System.Drawing.Size(45, 160); - this.trkBand19Gain.TabIndex = 29; - this.trkBand19Gain.Text = "12.5 kHz"; - this.trkBand19Gain.Value = 50; - this.trkBand19Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); - // - // trkBand20Gain - // - this.trkBand20Gain.Dock = System.Windows.Forms.DockStyle.Fill; - this.trkBand20Gain.Location = new System.Drawing.Point(405, 183); - this.trkBand20Gain.Margin = new System.Windows.Forms.Padding(0); - this.trkBand20Gain.Maximum = 200; - this.trkBand20Gain.MaximumSize = new System.Drawing.Size(63, 160); - this.trkBand20Gain.Minimum = -200; - this.trkBand20Gain.MinimumSize = new System.Drawing.Size(34, 160); - this.trkBand20Gain.Name = "trkBand20Gain"; - this.trkBand20Gain.Size = new System.Drawing.Size(52, 160); - this.trkBand20Gain.TabIndex = 30; - this.trkBand20Gain.Text = "15 kHz"; - this.trkBand20Gain.Value = 50; - this.trkBand20Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); - // - // flowLayoutPanel6 - // - this.flowLayoutPanel6.AutoSize = true; - this.tlpEqualizer.SetColumnSpan(this.flowLayoutPanel6, 5); - this.flowLayoutPanel6.Controls.Add(this.lblEqualizerPreset); - this.flowLayoutPanel6.Controls.Add(this.cboEqualizerPreset); - this.flowLayoutPanel6.Location = new System.Drawing.Point(0, 2); - this.flowLayoutPanel6.Margin = new System.Windows.Forms.Padding(0, 2, 0, 0); - this.flowLayoutPanel6.Name = "flowLayoutPanel6"; - this.flowLayoutPanel6.Size = new System.Drawing.Size(167, 21); - this.flowLayoutPanel6.TabIndex = 33; - this.flowLayoutPanel6.Visible = false; - // - // lblEqualizerPreset - // - this.lblEqualizerPreset.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.lblEqualizerPreset.AutoSize = true; - this.lblEqualizerPreset.Location = new System.Drawing.Point(3, 4); - this.lblEqualizerPreset.Name = "lblEqualizerPreset"; - this.lblEqualizerPreset.Size = new System.Drawing.Size(40, 13); - this.lblEqualizerPreset.TabIndex = 32; - this.lblEqualizerPreset.Text = "Preset:"; - // - // cboEqualizerPreset - // - this.cboEqualizerPreset.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.cboEqualizerPreset.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboEqualizerPreset.FormattingEnabled = true; - this.cboEqualizerPreset.Location = new System.Drawing.Point(46, 0); - this.cboEqualizerPreset.Margin = new System.Windows.Forms.Padding(0); - this.cboEqualizerPreset.Name = "cboEqualizerPreset"; - this.cboEqualizerPreset.Size = new System.Drawing.Size(121, 21); - this.cboEqualizerPreset.TabIndex = 33; - this.cboEqualizerPreset.SelectedIndexChanged += new System.EventHandler(this.cboEqualizerPreset_SelectedIndexChanged); - // - // flowLayoutPanel7 - // - this.flowLayoutPanel7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.flowLayoutPanel7.AutoSize = true; - this.tlpEqualizer.SetColumnSpan(this.flowLayoutPanel7, 4); - this.flowLayoutPanel7.Controls.Add(this.lblEqualizerFilterType); - this.flowLayoutPanel7.Controls.Add(this.cboEqualizerFilterType); - this.flowLayoutPanel7.Location = new System.Drawing.Point(298, 2); - this.flowLayoutPanel7.Margin = new System.Windows.Forms.Padding(0, 2, 0, 0); - this.flowLayoutPanel7.Name = "flowLayoutPanel7"; - this.flowLayoutPanel7.Size = new System.Drawing.Size(159, 21); - this.flowLayoutPanel7.TabIndex = 34; - this.flowLayoutPanel7.Visible = false; - // - // lblEqualizerFilterType - // - this.lblEqualizerFilterType.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.lblEqualizerFilterType.AutoSize = true; - this.lblEqualizerFilterType.Location = new System.Drawing.Point(3, 4); - this.lblEqualizerFilterType.Name = "lblEqualizerFilterType"; - this.lblEqualizerFilterType.Size = new System.Drawing.Size(32, 13); - this.lblEqualizerFilterType.TabIndex = 31; - this.lblEqualizerFilterType.Text = "Filter:"; - // - // cboEqualizerFilterType - // - this.cboEqualizerFilterType.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.cboEqualizerFilterType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cboEqualizerFilterType.FormattingEnabled = true; - this.cboEqualizerFilterType.Location = new System.Drawing.Point(38, 0); - this.cboEqualizerFilterType.Margin = new System.Windows.Forms.Padding(0); - this.cboEqualizerFilterType.Name = "cboEqualizerFilterType"; - this.cboEqualizerFilterType.Size = new System.Drawing.Size(121, 21); - this.cboEqualizerFilterType.TabIndex = 32; - // - // tpgEffects - // - this.tpgEffects.Controls.Add(this.tableLayoutPanel4); - this.tpgEffects.Location = new System.Drawing.Point(4, 22); - this.tpgEffects.Name = "tpgEffects"; - this.tpgEffects.Padding = new System.Windows.Forms.Padding(3); - this.tpgEffects.Size = new System.Drawing.Size(469, 347); - this.tpgEffects.TabIndex = 3; - this.tpgEffects.Text = "Effects"; - this.tpgEffects.UseVisualStyleBackColor = true; - // - // tableLayoutPanel4 - // - this.tableLayoutPanel4.ColumnCount = 1; - this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel4.Controls.Add(this.grpStereo, 0, 0); - this.tableLayoutPanel4.Controls.Add(this.grpReverb, 0, 1); - this.tableLayoutPanel4.Controls.Add(this.flowLayoutPanel5, 0, 2); - this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 3); - this.tableLayoutPanel4.Name = "tableLayoutPanel4"; - this.tableLayoutPanel4.RowCount = 4; - this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel4.Size = new System.Drawing.Size(463, 341); - this.tableLayoutPanel4.TabIndex = 0; - // - // grpStereo - // - this.grpStereo.Controls.Add(this.tlpStereoFilter); - this.grpStereo.Dock = System.Windows.Forms.DockStyle.Fill; - this.grpStereo.Location = new System.Drawing.Point(3, 3); - this.grpStereo.Name = "grpStereo"; - this.grpStereo.Size = new System.Drawing.Size(457, 115); - this.grpStereo.TabIndex = 0; - this.grpStereo.TabStop = false; - this.grpStereo.Text = "Stereo"; - // - // tlpStereoFilter - // - this.tlpStereoFilter.ColumnCount = 3; - this.tlpStereoFilter.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpStereoFilter.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tlpStereoFilter.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpStereoFilter.Controls.Add(this.radStereoCombFilter, 0, 3); - this.tlpStereoFilter.Controls.Add(this.lblStereoDelayMs, 2, 1); - this.tlpStereoFilter.Controls.Add(this.lblStereoPanningAngle, 2, 2); - this.tlpStereoFilter.Controls.Add(this.radStereoDisabled, 0, 0); - this.tlpStereoFilter.Controls.Add(this.radStereoDelay, 0, 1); - this.tlpStereoFilter.Controls.Add(this.radStereoPanning, 0, 2); - this.tlpStereoFilter.Controls.Add(this.nudStereoDelay, 1, 1); - this.tlpStereoFilter.Controls.Add(this.nudStereoPanning, 1, 2); - this.tlpStereoFilter.Controls.Add(this.tableLayoutPanel9, 1, 3); - this.tlpStereoFilter.Dock = System.Windows.Forms.DockStyle.Fill; - this.tlpStereoFilter.Location = new System.Drawing.Point(3, 16); - this.tlpStereoFilter.Name = "tlpStereoFilter"; - this.tlpStereoFilter.RowCount = 5; - this.tlpStereoFilter.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tlpStereoFilter.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tlpStereoFilter.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tlpStereoFilter.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tlpStereoFilter.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tlpStereoFilter.Size = new System.Drawing.Size(451, 96); - this.tlpStereoFilter.TabIndex = 0; - // - // radStereoCombFilter - // - this.radStereoCombFilter.AutoSize = true; - this.radStereoCombFilter.Location = new System.Drawing.Point(3, 72); - this.radStereoCombFilter.Name = "radStereoCombFilter"; - this.radStereoCombFilter.Size = new System.Drawing.Size(77, 17); - this.radStereoCombFilter.TabIndex = 4; - this.radStereoCombFilter.TabStop = true; - this.radStereoCombFilter.Tag = "Panning"; - this.radStereoCombFilter.Text = "Comb Filter"; - this.radStereoCombFilter.UseVisualStyleBackColor = true; - // - // lblStereoDelayMs - // - this.lblStereoDelayMs.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.lblStereoDelayMs.AutoSize = true; - this.lblStereoDelayMs.Location = new System.Drawing.Point(131, 28); - this.lblStereoDelayMs.Name = "lblStereoDelayMs"; - this.lblStereoDelayMs.Size = new System.Drawing.Size(20, 13); - this.lblStereoDelayMs.TabIndex = 1; - this.lblStereoDelayMs.Text = "ms"; - // - // lblStereoPanningAngle - // - this.lblStereoPanningAngle.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.lblStereoPanningAngle.AutoSize = true; - this.lblStereoPanningAngle.Location = new System.Drawing.Point(131, 51); - this.lblStereoPanningAngle.Name = "lblStereoPanningAngle"; - this.lblStereoPanningAngle.Size = new System.Drawing.Size(92, 13); - this.lblStereoPanningAngle.TabIndex = 1; - this.lblStereoPanningAngle.Text = "(Angle in degrees)"; - // - // radStereoDisabled - // - this.radStereoDisabled.AutoSize = true; - this.radStereoDisabled.Checked = true; - this.radStereoDisabled.Location = new System.Drawing.Point(3, 3); - this.radStereoDisabled.Name = "radStereoDisabled"; - this.radStereoDisabled.Size = new System.Drawing.Size(66, 17); - this.radStereoDisabled.TabIndex = 1; - this.radStereoDisabled.TabStop = true; - this.radStereoDisabled.Tag = "None"; - this.radStereoDisabled.Text = "Disabled"; - this.radStereoDisabled.UseVisualStyleBackColor = true; - // - // radStereoDelay - // - this.radStereoDelay.AutoSize = true; - this.radStereoDelay.Location = new System.Drawing.Point(3, 26); - this.radStereoDelay.Name = "radStereoDelay"; - this.radStereoDelay.Size = new System.Drawing.Size(52, 17); - this.radStereoDelay.TabIndex = 2; - this.radStereoDelay.TabStop = true; - this.radStereoDelay.Tag = "Delay"; - this.radStereoDelay.Text = "Delay"; - this.radStereoDelay.UseVisualStyleBackColor = true; - // - // radStereoPanning - // - this.radStereoPanning.AutoSize = true; - this.radStereoPanning.Location = new System.Drawing.Point(3, 49); - this.radStereoPanning.Name = "radStereoPanning"; - this.radStereoPanning.Size = new System.Drawing.Size(64, 17); - this.radStereoPanning.TabIndex = 3; - this.radStereoPanning.TabStop = true; - this.radStereoPanning.Tag = "Panning"; - this.radStereoPanning.Text = "Panning"; - this.radStereoPanning.UseVisualStyleBackColor = true; - // - // nudStereoDelay - // - this.nudStereoDelay.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.nudStereoDelay.DecimalPlaces = 0; - this.nudStereoDelay.Increment = new decimal(new int[] { + this.nudLatency.ValueChanged += new System.EventHandler(this.nudLatency_ValueChanged); + // + // tableLayoutPanel8 + // + this.tableLayoutPanel8.ColumnCount = 2; + this.tableLayoutPanel2.SetColumnSpan(this.tableLayoutPanel8, 2); + this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel8.Controls.Add(this.chkReduceSoundInBackground, 0, 1); + this.tableLayoutPanel8.Controls.Add(this.chkReduceSoundInFastForward, 0, 2); + this.tableLayoutPanel8.Controls.Add(this.trkVolumeReduction, 1, 1); + this.tableLayoutPanel8.Controls.Add(this.chkMuteSoundInBackground, 0, 0); + this.tableLayoutPanel8.Location = new System.Drawing.Point(10, 152); + this.tableLayoutPanel8.Margin = new System.Windows.Forms.Padding(10, 3, 0, 0); + this.tableLayoutPanel8.Name = "tableLayoutPanel8"; + this.tableLayoutPanel8.RowCount = 4; + this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel8.Size = new System.Drawing.Size(453, 81); + this.tableLayoutPanel8.TabIndex = 25; + // + // chkReduceSoundInBackground + // + this.chkReduceSoundInBackground.AutoSize = true; + this.chkReduceSoundInBackground.Location = new System.Drawing.Point(3, 26); + this.chkReduceSoundInBackground.Name = "chkReduceSoundInBackground"; + this.chkReduceSoundInBackground.Size = new System.Drawing.Size(164, 17); + this.chkReduceSoundInBackground.TabIndex = 13; + this.chkReduceSoundInBackground.Text = "Reduce when in background"; + this.chkReduceSoundInBackground.UseVisualStyleBackColor = true; + this.chkReduceSoundInBackground.CheckedChanged += new System.EventHandler(this.chkReduceVolume_CheckedChanged); + // + // chkReduceSoundInFastForward + // + this.chkReduceSoundInFastForward.AutoSize = true; + this.chkReduceSoundInFastForward.Location = new System.Drawing.Point(3, 49); + this.chkReduceSoundInFastForward.Name = "chkReduceSoundInFastForward"; + this.chkReduceSoundInFastForward.Size = new System.Drawing.Size(225, 17); + this.chkReduceSoundInFastForward.TabIndex = 16; + this.chkReduceSoundInFastForward.Text = "Reduce when fast forwarding or rewinding"; + this.chkReduceSoundInFastForward.UseVisualStyleBackColor = true; + this.chkReduceSoundInFastForward.CheckedChanged += new System.EventHandler(this.chkReduceVolume_CheckedChanged); + // + // trkVolumeReduction + // + this.trkVolumeReduction.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkVolumeReduction.Enabled = false; + this.trkVolumeReduction.Location = new System.Drawing.Point(231, 23); + this.trkVolumeReduction.Margin = new System.Windows.Forms.Padding(0); + this.trkVolumeReduction.Maximum = 100; + this.trkVolumeReduction.MaximumSize = new System.Drawing.Size(400, 55); + this.trkVolumeReduction.Minimum = 0; + this.trkVolumeReduction.MinimumSize = new System.Drawing.Size(150, 55); + this.trkVolumeReduction.Name = "trkVolumeReduction"; + this.tableLayoutPanel8.SetRowSpan(this.trkVolumeReduction, 2); + this.trkVolumeReduction.Size = new System.Drawing.Size(222, 55); + this.trkVolumeReduction.TabIndex = 17; + this.trkVolumeReduction.Text = "Volume Reduction"; + this.trkVolumeReduction.Value = 50; + // + // chkMuteSoundInBackground + // + this.chkMuteSoundInBackground.AutoSize = true; + this.chkMuteSoundInBackground.Location = new System.Drawing.Point(3, 3); + this.chkMuteSoundInBackground.Name = "chkMuteSoundInBackground"; + this.chkMuteSoundInBackground.Size = new System.Drawing.Size(182, 17); + this.chkMuteSoundInBackground.TabIndex = 18; + this.chkMuteSoundInBackground.Text = "Mute sound when in background"; + this.chkMuteSoundInBackground.UseVisualStyleBackColor = true; + this.chkMuteSoundInBackground.CheckedChanged += new System.EventHandler(this.chkMuteWhenInBackground_CheckedChanged); + // + // btnReset + // + this.btnReset.AutoSize = true; + this.btnReset.Location = new System.Drawing.Point(6, 3); + this.btnReset.Name = "btnReset"; + this.btnReset.Size = new System.Drawing.Size(99, 23); + this.btnReset.TabIndex = 3; + this.btnReset.Text = "Reset to Defaults"; + this.btnReset.UseVisualStyleBackColor = true; + this.btnReset.Click += new System.EventHandler(this.btnReset_Click); + // + // tabMain + // + this.tabMain.Controls.Add(this.tpgGeneral); + this.tabMain.Controls.Add(this.tpgVolume); + this.tabMain.Controls.Add(this.tpgPanning); + this.tabMain.Controls.Add(this.tpgEqualizer); + this.tabMain.Controls.Add(this.tpgEffects); + this.tabMain.Controls.Add(this.tpgAdvanced); + this.tabMain.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabMain.Location = new System.Drawing.Point(0, 0); + this.tabMain.Name = "tabMain"; + this.tabMain.SelectedIndex = 0; + this.tabMain.Size = new System.Drawing.Size(477, 421); + this.tabMain.TabIndex = 4; + // + // tpgGeneral + // + this.tpgGeneral.Controls.Add(this.tableLayoutPanel2); + this.tpgGeneral.Location = new System.Drawing.Point(4, 22); + this.tpgGeneral.Name = "tpgGeneral"; + this.tpgGeneral.Padding = new System.Windows.Forms.Padding(3); + this.tpgGeneral.Size = new System.Drawing.Size(469, 395); + this.tpgGeneral.TabIndex = 0; + this.tpgGeneral.Text = "General"; + this.tpgGeneral.UseVisualStyleBackColor = true; + // + // tpgVolume + // + this.tpgVolume.Controls.Add(this.grpVolume); + this.tpgVolume.Location = new System.Drawing.Point(4, 22); + this.tpgVolume.Name = "tpgVolume"; + this.tpgVolume.Padding = new System.Windows.Forms.Padding(3); + this.tpgVolume.Size = new System.Drawing.Size(469, 363); + this.tpgVolume.TabIndex = 1; + this.tpgVolume.Text = "Volume"; + this.tpgVolume.UseVisualStyleBackColor = true; + // + // tpgPanning + // + this.tpgPanning.Controls.Add(this.tableLayoutPanel6); + this.tpgPanning.Location = new System.Drawing.Point(4, 22); + this.tpgPanning.Name = "tpgPanning"; + this.tpgPanning.Padding = new System.Windows.Forms.Padding(3); + this.tpgPanning.Size = new System.Drawing.Size(469, 363); + this.tpgPanning.TabIndex = 4; + this.tpgPanning.Text = "Panning"; + this.tpgPanning.UseVisualStyleBackColor = true; + // + // tableLayoutPanel6 + // + this.tableLayoutPanel6.ColumnCount = 2; + this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel6.Controls.Add(this.trkSquare1Pan, 0, 0); + this.tableLayoutPanel6.Controls.Add(this.trkFdsPan, 1, 0); + this.tableLayoutPanel6.Controls.Add(this.trkSquare2Pan, 0, 1); + this.tableLayoutPanel6.Controls.Add(this.trkMmc5Pan, 1, 1); + this.tableLayoutPanel6.Controls.Add(this.trkTrianglePan, 0, 2); + this.tableLayoutPanel6.Controls.Add(this.trkNoisePan, 0, 3); + this.tableLayoutPanel6.Controls.Add(this.trkDmcPan, 0, 4); + this.tableLayoutPanel6.Controls.Add(this.trkVrc6Pan, 1, 2); + this.tableLayoutPanel6.Controls.Add(this.trkVrc7Pan, 1, 3); + this.tableLayoutPanel6.Controls.Add(this.trkNamcoPan, 1, 4); + this.tableLayoutPanel6.Controls.Add(this.trkSunsoftPan, 0, 6); + this.tableLayoutPanel6.Controls.Add(this.trkEPSGPan_L, 0, 5); + this.tableLayoutPanel6.Controls.Add(this.trkEPSGPan_R, 1, 5); + this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel6.Location = new System.Drawing.Point(3, 3); + this.tableLayoutPanel6.Name = "tableLayoutPanel6"; + this.tableLayoutPanel6.RowCount = 8; + this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel6.Size = new System.Drawing.Size(463, 357); + this.tableLayoutPanel6.TabIndex = 3; + // + // trkSquare1Pan + // + this.trkSquare1Pan.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkSquare1Pan.Location = new System.Drawing.Point(12, 0); + this.trkSquare1Pan.Margin = new System.Windows.Forms.Padding(0); + this.trkSquare1Pan.Maximum = 100; + this.trkSquare1Pan.MaximumSize = new System.Drawing.Size(63, 160); + this.trkSquare1Pan.Minimum = -100; + this.trkSquare1Pan.MinimumSize = new System.Drawing.Size(206, 55); + this.trkSquare1Pan.Name = "trkSquare1Pan"; + this.trkSquare1Pan.Size = new System.Drawing.Size(206, 55); + this.trkSquare1Pan.TabIndex = 12; + this.trkSquare1Pan.Text = "Square 1"; + this.trkSquare1Pan.Value = 0; + // + // trkFdsPan + // + this.trkFdsPan.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkFdsPan.Location = new System.Drawing.Point(244, 0); + this.trkFdsPan.Margin = new System.Windows.Forms.Padding(0); + this.trkFdsPan.Maximum = 100; + this.trkFdsPan.MaximumSize = new System.Drawing.Size(63, 160); + this.trkFdsPan.Minimum = -100; + this.trkFdsPan.MinimumSize = new System.Drawing.Size(206, 55); + this.trkFdsPan.Name = "trkFdsPan"; + this.trkFdsPan.Size = new System.Drawing.Size(206, 55); + this.trkFdsPan.TabIndex = 17; + this.trkFdsPan.Text = "FDS"; + this.trkFdsPan.Value = 0; + // + // trkSquare2Pan + // + this.trkSquare2Pan.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkSquare2Pan.Location = new System.Drawing.Point(12, 55); + this.trkSquare2Pan.Margin = new System.Windows.Forms.Padding(0); + this.trkSquare2Pan.Maximum = 100; + this.trkSquare2Pan.MaximumSize = new System.Drawing.Size(63, 160); + this.trkSquare2Pan.Minimum = -100; + this.trkSquare2Pan.MinimumSize = new System.Drawing.Size(206, 55); + this.trkSquare2Pan.Name = "trkSquare2Pan"; + this.trkSquare2Pan.Size = new System.Drawing.Size(206, 55); + this.trkSquare2Pan.TabIndex = 13; + this.trkSquare2Pan.Text = "Square 2"; + this.trkSquare2Pan.Value = 0; + // + // trkMmc5Pan + // + this.trkMmc5Pan.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkMmc5Pan.Location = new System.Drawing.Point(244, 55); + this.trkMmc5Pan.Margin = new System.Windows.Forms.Padding(0); + this.trkMmc5Pan.Maximum = 100; + this.trkMmc5Pan.MaximumSize = new System.Drawing.Size(63, 160); + this.trkMmc5Pan.Minimum = -100; + this.trkMmc5Pan.MinimumSize = new System.Drawing.Size(206, 55); + this.trkMmc5Pan.Name = "trkMmc5Pan"; + this.trkMmc5Pan.Size = new System.Drawing.Size(206, 55); + this.trkMmc5Pan.TabIndex = 18; + this.trkMmc5Pan.Text = "MMC5"; + this.trkMmc5Pan.Value = 0; + // + // trkTrianglePan + // + this.trkTrianglePan.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkTrianglePan.Location = new System.Drawing.Point(12, 110); + this.trkTrianglePan.Margin = new System.Windows.Forms.Padding(0); + this.trkTrianglePan.Maximum = 100; + this.trkTrianglePan.MaximumSize = new System.Drawing.Size(63, 160); + this.trkTrianglePan.Minimum = -100; + this.trkTrianglePan.MinimumSize = new System.Drawing.Size(206, 55); + this.trkTrianglePan.Name = "trkTrianglePan"; + this.trkTrianglePan.Size = new System.Drawing.Size(206, 55); + this.trkTrianglePan.TabIndex = 14; + this.trkTrianglePan.Text = "Triangle"; + this.trkTrianglePan.Value = 0; + // + // trkNoisePan + // + this.trkNoisePan.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkNoisePan.Location = new System.Drawing.Point(12, 165); + this.trkNoisePan.Margin = new System.Windows.Forms.Padding(0); + this.trkNoisePan.Maximum = 100; + this.trkNoisePan.MaximumSize = new System.Drawing.Size(63, 160); + this.trkNoisePan.Minimum = -100; + this.trkNoisePan.MinimumSize = new System.Drawing.Size(206, 55); + this.trkNoisePan.Name = "trkNoisePan"; + this.trkNoisePan.Size = new System.Drawing.Size(206, 55); + this.trkNoisePan.TabIndex = 15; + this.trkNoisePan.Text = "Noise"; + this.trkNoisePan.Value = 0; + // + // trkDmcPan + // + this.trkDmcPan.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkDmcPan.Location = new System.Drawing.Point(12, 220); + this.trkDmcPan.Margin = new System.Windows.Forms.Padding(0); + this.trkDmcPan.Maximum = 100; + this.trkDmcPan.MaximumSize = new System.Drawing.Size(63, 160); + this.trkDmcPan.Minimum = -100; + this.trkDmcPan.MinimumSize = new System.Drawing.Size(206, 55); + this.trkDmcPan.Name = "trkDmcPan"; + this.trkDmcPan.Size = new System.Drawing.Size(206, 55); + this.trkDmcPan.TabIndex = 16; + this.trkDmcPan.Text = "DMC"; + this.trkDmcPan.Value = 0; + // + // trkVrc6Pan + // + this.trkVrc6Pan.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkVrc6Pan.Location = new System.Drawing.Point(244, 110); + this.trkVrc6Pan.Margin = new System.Windows.Forms.Padding(0); + this.trkVrc6Pan.Maximum = 100; + this.trkVrc6Pan.MaximumSize = new System.Drawing.Size(63, 160); + this.trkVrc6Pan.Minimum = -100; + this.trkVrc6Pan.MinimumSize = new System.Drawing.Size(206, 55); + this.trkVrc6Pan.Name = "trkVrc6Pan"; + this.trkVrc6Pan.Size = new System.Drawing.Size(206, 55); + this.trkVrc6Pan.TabIndex = 19; + this.trkVrc6Pan.Text = "VRC6"; + this.trkVrc6Pan.Value = 0; + // + // trkVrc7Pan + // + this.trkVrc7Pan.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkVrc7Pan.Location = new System.Drawing.Point(244, 165); + this.trkVrc7Pan.Margin = new System.Windows.Forms.Padding(0); + this.trkVrc7Pan.Maximum = 100; + this.trkVrc7Pan.MaximumSize = new System.Drawing.Size(63, 160); + this.trkVrc7Pan.Minimum = -100; + this.trkVrc7Pan.MinimumSize = new System.Drawing.Size(206, 55); + this.trkVrc7Pan.Name = "trkVrc7Pan"; + this.trkVrc7Pan.Size = new System.Drawing.Size(206, 55); + this.trkVrc7Pan.TabIndex = 20; + this.trkVrc7Pan.Text = "VRC7"; + this.trkVrc7Pan.Value = 0; + // + // trkNamcoPan + // + this.trkNamcoPan.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkNamcoPan.Location = new System.Drawing.Point(244, 220); + this.trkNamcoPan.Margin = new System.Windows.Forms.Padding(0); + this.trkNamcoPan.Maximum = 100; + this.trkNamcoPan.MaximumSize = new System.Drawing.Size(63, 160); + this.trkNamcoPan.Minimum = -100; + this.trkNamcoPan.MinimumSize = new System.Drawing.Size(206, 55); + this.trkNamcoPan.Name = "trkNamcoPan"; + this.trkNamcoPan.Size = new System.Drawing.Size(206, 55); + this.trkNamcoPan.TabIndex = 21; + this.trkNamcoPan.Text = "Namco"; + this.trkNamcoPan.Value = 0; + // + // trkSunsoftPan + // + this.trkSunsoftPan.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkSunsoftPan.Location = new System.Drawing.Point(12, 330); + this.trkSunsoftPan.Margin = new System.Windows.Forms.Padding(0); + this.trkSunsoftPan.Maximum = 100; + this.trkSunsoftPan.MaximumSize = new System.Drawing.Size(63, 160); + this.trkSunsoftPan.Minimum = -100; + this.trkSunsoftPan.MinimumSize = new System.Drawing.Size(206, 55); + this.trkSunsoftPan.Name = "trkSunsoftPan"; + this.trkSunsoftPan.Size = new System.Drawing.Size(206, 55); + this.trkSunsoftPan.TabIndex = 22; + this.trkSunsoftPan.Text = "Sunsoft"; + this.trkSunsoftPan.Value = 0; + // + // trkEPSGPan_L + // + this.trkEPSGPan_L.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkEPSGPan_L.Location = new System.Drawing.Point(12, 275); + this.trkEPSGPan_L.Margin = new System.Windows.Forms.Padding(0); + this.trkEPSGPan_L.Maximum = 100; + this.trkEPSGPan_L.MaximumSize = new System.Drawing.Size(63, 160); + this.trkEPSGPan_L.Minimum = -100; + this.trkEPSGPan_L.MinimumSize = new System.Drawing.Size(206, 55); + this.trkEPSGPan_L.Name = "trkEPSGPan_L"; + this.trkEPSGPan_L.Size = new System.Drawing.Size(206, 55); + this.trkEPSGPan_L.TabIndex = 22; + this.trkEPSGPan_L.Text = "EPSG Left"; + this.trkEPSGPan_L.Value = -100; + // + // trkEPSGPan_R + // + this.trkEPSGPan_R.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.trkEPSGPan_R.Location = new System.Drawing.Point(244, 275); + this.trkEPSGPan_R.Margin = new System.Windows.Forms.Padding(0); + this.trkEPSGPan_R.Maximum = 100; + this.trkEPSGPan_R.MaximumSize = new System.Drawing.Size(63, 160); + this.trkEPSGPan_R.Minimum = -100; + this.trkEPSGPan_R.MinimumSize = new System.Drawing.Size(206, 55); + this.trkEPSGPan_R.Name = "trkEPSGPan_R"; + this.trkEPSGPan_R.Size = new System.Drawing.Size(206, 55); + this.trkEPSGPan_R.TabIndex = 22; + this.trkEPSGPan_R.Text = "EPSG Right"; + this.trkEPSGPan_R.Value = 100; + // + // tpgEqualizer + // + this.tpgEqualizer.Controls.Add(this.groupBox1); + this.tpgEqualizer.Location = new System.Drawing.Point(4, 22); + this.tpgEqualizer.Name = "tpgEqualizer"; + this.tpgEqualizer.Padding = new System.Windows.Forms.Padding(3); + this.tpgEqualizer.Size = new System.Drawing.Size(469, 363); + this.tpgEqualizer.TabIndex = 5; + this.tpgEqualizer.Text = "Equalizer"; + this.tpgEqualizer.UseVisualStyleBackColor = true; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.chkEnableEqualizer); + this.groupBox1.Controls.Add(this.tlpEqualizer); + this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox1.Location = new System.Drawing.Point(3, 3); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(463, 357); + this.groupBox1.TabIndex = 4; + this.groupBox1.TabStop = false; + // + // chkEnableEqualizer + // + this.chkEnableEqualizer.AutoSize = true; + this.chkEnableEqualizer.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.chkEnableEqualizer.Location = new System.Drawing.Point(7, 0); + this.chkEnableEqualizer.Name = "chkEnableEqualizer"; + this.chkEnableEqualizer.Padding = new System.Windows.Forms.Padding(5, 0, 0, 0); + this.chkEnableEqualizer.Size = new System.Drawing.Size(110, 17); + this.chkEnableEqualizer.TabIndex = 5; + this.chkEnableEqualizer.Text = "Enable Equalizer"; + this.chkEnableEqualizer.UseVisualStyleBackColor = false; + this.chkEnableEqualizer.CheckedChanged += new System.EventHandler(this.chkEnableEqualizer_CheckedChanged); + // + // tlpEqualizer + // + this.tlpEqualizer.ColumnCount = 10; + this.tlpEqualizer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); + this.tlpEqualizer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); + this.tlpEqualizer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); + this.tlpEqualizer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); + this.tlpEqualizer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); + this.tlpEqualizer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); + this.tlpEqualizer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); + this.tlpEqualizer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); + this.tlpEqualizer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); + this.tlpEqualizer.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10F)); + this.tlpEqualizer.Controls.Add(this.trkBand6Gain, 5, 1); + this.tlpEqualizer.Controls.Add(this.trkBand5Gain, 4, 1); + this.tlpEqualizer.Controls.Add(this.trkBand4Gain, 3, 1); + this.tlpEqualizer.Controls.Add(this.trkBand3Gain, 2, 1); + this.tlpEqualizer.Controls.Add(this.trkBand2Gain, 1, 1); + this.tlpEqualizer.Controls.Add(this.trkBand1Gain, 0, 1); + this.tlpEqualizer.Controls.Add(this.trkBand11Gain, 0, 2); + this.tlpEqualizer.Controls.Add(this.trkBand12Gain, 1, 2); + this.tlpEqualizer.Controls.Add(this.trkBand13Gain, 2, 2); + this.tlpEqualizer.Controls.Add(this.trkBand14Gain, 3, 2); + this.tlpEqualizer.Controls.Add(this.trkBand15Gain, 4, 2); + this.tlpEqualizer.Controls.Add(this.trkBand16Gain, 5, 2); + this.tlpEqualizer.Controls.Add(this.trkBand7Gain, 6, 1); + this.tlpEqualizer.Controls.Add(this.trkBand8Gain, 7, 1); + this.tlpEqualizer.Controls.Add(this.trkBand9Gain, 8, 1); + this.tlpEqualizer.Controls.Add(this.trkBand10Gain, 9, 1); + this.tlpEqualizer.Controls.Add(this.trkBand17Gain, 6, 2); + this.tlpEqualizer.Controls.Add(this.trkBand18Gain, 7, 2); + this.tlpEqualizer.Controls.Add(this.trkBand19Gain, 8, 2); + this.tlpEqualizer.Controls.Add(this.trkBand20Gain, 9, 2); + this.tlpEqualizer.Controls.Add(this.flowLayoutPanel6, 0, 0); + this.tlpEqualizer.Controls.Add(this.flowLayoutPanel7, 6, 0); + this.tlpEqualizer.Dock = System.Windows.Forms.DockStyle.Fill; + this.tlpEqualizer.Location = new System.Drawing.Point(3, 16); + this.tlpEqualizer.Name = "tlpEqualizer"; + this.tlpEqualizer.RowCount = 4; + this.tlpEqualizer.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpEqualizer.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpEqualizer.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpEqualizer.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tlpEqualizer.Size = new System.Drawing.Size(457, 338); + this.tlpEqualizer.TabIndex = 3; + // + // trkBand6Gain + // + this.trkBand6Gain.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkBand6Gain.Location = new System.Drawing.Point(225, 23); + this.trkBand6Gain.Margin = new System.Windows.Forms.Padding(0); + this.trkBand6Gain.Maximum = 200; + this.trkBand6Gain.MaximumSize = new System.Drawing.Size(63, 160); + this.trkBand6Gain.Minimum = -200; + this.trkBand6Gain.MinimumSize = new System.Drawing.Size(34, 160); + this.trkBand6Gain.Name = "trkBand6Gain"; + this.trkBand6Gain.Size = new System.Drawing.Size(45, 160); + this.trkBand6Gain.TabIndex = 16; + this.trkBand6Gain.Text = "225 Hz"; + this.trkBand6Gain.Value = 50; + this.trkBand6Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); + // + // trkBand5Gain + // + this.trkBand5Gain.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkBand5Gain.Location = new System.Drawing.Point(180, 23); + this.trkBand5Gain.Margin = new System.Windows.Forms.Padding(0); + this.trkBand5Gain.Maximum = 200; + this.trkBand5Gain.MaximumSize = new System.Drawing.Size(63, 160); + this.trkBand5Gain.Minimum = -200; + this.trkBand5Gain.MinimumSize = new System.Drawing.Size(34, 160); + this.trkBand5Gain.Name = "trkBand5Gain"; + this.trkBand5Gain.Size = new System.Drawing.Size(45, 160); + this.trkBand5Gain.TabIndex = 15; + this.trkBand5Gain.Text = "160 Hz"; + this.trkBand5Gain.Value = 50; + this.trkBand5Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); + // + // trkBand4Gain + // + this.trkBand4Gain.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkBand4Gain.Location = new System.Drawing.Point(135, 23); + this.trkBand4Gain.Margin = new System.Windows.Forms.Padding(0); + this.trkBand4Gain.Maximum = 200; + this.trkBand4Gain.MaximumSize = new System.Drawing.Size(63, 160); + this.trkBand4Gain.Minimum = -200; + this.trkBand4Gain.MinimumSize = new System.Drawing.Size(34, 160); + this.trkBand4Gain.Name = "trkBand4Gain"; + this.trkBand4Gain.Size = new System.Drawing.Size(45, 160); + this.trkBand4Gain.TabIndex = 14; + this.trkBand4Gain.Text = "113 Hz"; + this.trkBand4Gain.Value = 50; + this.trkBand4Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); + // + // trkBand3Gain + // + this.trkBand3Gain.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkBand3Gain.Location = new System.Drawing.Point(90, 23); + this.trkBand3Gain.Margin = new System.Windows.Forms.Padding(0); + this.trkBand3Gain.Maximum = 200; + this.trkBand3Gain.MaximumSize = new System.Drawing.Size(63, 160); + this.trkBand3Gain.Minimum = -200; + this.trkBand3Gain.MinimumSize = new System.Drawing.Size(34, 160); + this.trkBand3Gain.Name = "trkBand3Gain"; + this.trkBand3Gain.Size = new System.Drawing.Size(45, 160); + this.trkBand3Gain.TabIndex = 13; + this.trkBand3Gain.Text = "80 Hz"; + this.trkBand3Gain.Value = 50; + this.trkBand3Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); + // + // trkBand2Gain + // + this.trkBand2Gain.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkBand2Gain.Location = new System.Drawing.Point(45, 23); + this.trkBand2Gain.Margin = new System.Windows.Forms.Padding(0); + this.trkBand2Gain.Maximum = 200; + this.trkBand2Gain.MaximumSize = new System.Drawing.Size(63, 160); + this.trkBand2Gain.Minimum = -200; + this.trkBand2Gain.MinimumSize = new System.Drawing.Size(34, 160); + this.trkBand2Gain.Name = "trkBand2Gain"; + this.trkBand2Gain.Size = new System.Drawing.Size(45, 160); + this.trkBand2Gain.TabIndex = 12; + this.trkBand2Gain.Text = "56 Hz"; + this.trkBand2Gain.Value = 50; + this.trkBand2Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); + // + // trkBand1Gain + // + this.trkBand1Gain.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkBand1Gain.Location = new System.Drawing.Point(0, 23); + this.trkBand1Gain.Margin = new System.Windows.Forms.Padding(0); + this.trkBand1Gain.Maximum = 200; + this.trkBand1Gain.MaximumSize = new System.Drawing.Size(63, 160); + this.trkBand1Gain.Minimum = -200; + this.trkBand1Gain.MinimumSize = new System.Drawing.Size(34, 160); + this.trkBand1Gain.Name = "trkBand1Gain"; + this.trkBand1Gain.Size = new System.Drawing.Size(45, 160); + this.trkBand1Gain.TabIndex = 11; + this.trkBand1Gain.Text = "40 Hz"; + this.trkBand1Gain.Value = 50; + this.trkBand1Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); + // + // trkBand11Gain + // + this.trkBand11Gain.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkBand11Gain.Location = new System.Drawing.Point(0, 183); + this.trkBand11Gain.Margin = new System.Windows.Forms.Padding(0); + this.trkBand11Gain.Maximum = 200; + this.trkBand11Gain.MaximumSize = new System.Drawing.Size(63, 160); + this.trkBand11Gain.Minimum = -200; + this.trkBand11Gain.MinimumSize = new System.Drawing.Size(34, 160); + this.trkBand11Gain.Name = "trkBand11Gain"; + this.trkBand11Gain.Size = new System.Drawing.Size(45, 160); + this.trkBand11Gain.TabIndex = 17; + this.trkBand11Gain.Text = "1.0 kHz"; + this.trkBand11Gain.Value = 50; + this.trkBand11Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); + // + // trkBand12Gain + // + this.trkBand12Gain.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkBand12Gain.Location = new System.Drawing.Point(45, 183); + this.trkBand12Gain.Margin = new System.Windows.Forms.Padding(0); + this.trkBand12Gain.Maximum = 200; + this.trkBand12Gain.MaximumSize = new System.Drawing.Size(63, 160); + this.trkBand12Gain.Minimum = -200; + this.trkBand12Gain.MinimumSize = new System.Drawing.Size(34, 160); + this.trkBand12Gain.Name = "trkBand12Gain"; + this.trkBand12Gain.Size = new System.Drawing.Size(45, 160); + this.trkBand12Gain.TabIndex = 18; + this.trkBand12Gain.Text = "2.0 kHz"; + this.trkBand12Gain.Value = 50; + this.trkBand12Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); + // + // trkBand13Gain + // + this.trkBand13Gain.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkBand13Gain.Location = new System.Drawing.Point(90, 183); + this.trkBand13Gain.Margin = new System.Windows.Forms.Padding(0); + this.trkBand13Gain.Maximum = 200; + this.trkBand13Gain.MaximumSize = new System.Drawing.Size(63, 160); + this.trkBand13Gain.Minimum = -200; + this.trkBand13Gain.MinimumSize = new System.Drawing.Size(34, 160); + this.trkBand13Gain.Name = "trkBand13Gain"; + this.trkBand13Gain.Size = new System.Drawing.Size(45, 160); + this.trkBand13Gain.TabIndex = 19; + this.trkBand13Gain.Text = "3.0 kHz"; + this.trkBand13Gain.Value = 50; + this.trkBand13Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); + // + // trkBand14Gain + // + this.trkBand14Gain.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkBand14Gain.Location = new System.Drawing.Point(135, 183); + this.trkBand14Gain.Margin = new System.Windows.Forms.Padding(0); + this.trkBand14Gain.Maximum = 200; + this.trkBand14Gain.MaximumSize = new System.Drawing.Size(63, 160); + this.trkBand14Gain.Minimum = -200; + this.trkBand14Gain.MinimumSize = new System.Drawing.Size(34, 160); + this.trkBand14Gain.Name = "trkBand14Gain"; + this.trkBand14Gain.Size = new System.Drawing.Size(45, 160); + this.trkBand14Gain.TabIndex = 20; + this.trkBand14Gain.Text = "4.0 kHz"; + this.trkBand14Gain.Value = 50; + this.trkBand14Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); + // + // trkBand15Gain + // + this.trkBand15Gain.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkBand15Gain.Location = new System.Drawing.Point(180, 183); + this.trkBand15Gain.Margin = new System.Windows.Forms.Padding(0); + this.trkBand15Gain.Maximum = 200; + this.trkBand15Gain.MaximumSize = new System.Drawing.Size(63, 160); + this.trkBand15Gain.Minimum = -200; + this.trkBand15Gain.MinimumSize = new System.Drawing.Size(34, 160); + this.trkBand15Gain.Name = "trkBand15Gain"; + this.trkBand15Gain.Size = new System.Drawing.Size(45, 160); + this.trkBand15Gain.TabIndex = 21; + this.trkBand15Gain.Text = "5.0 kHz"; + this.trkBand15Gain.Value = 50; + this.trkBand15Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); + // + // trkBand16Gain + // + this.trkBand16Gain.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkBand16Gain.Location = new System.Drawing.Point(225, 183); + this.trkBand16Gain.Margin = new System.Windows.Forms.Padding(0); + this.trkBand16Gain.Maximum = 200; + this.trkBand16Gain.MaximumSize = new System.Drawing.Size(63, 160); + this.trkBand16Gain.Minimum = -200; + this.trkBand16Gain.MinimumSize = new System.Drawing.Size(34, 160); + this.trkBand16Gain.Name = "trkBand16Gain"; + this.trkBand16Gain.Size = new System.Drawing.Size(45, 160); + this.trkBand16Gain.TabIndex = 22; + this.trkBand16Gain.Text = "6.0 kHz"; + this.trkBand16Gain.Value = 50; + this.trkBand16Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); + // + // trkBand7Gain + // + this.trkBand7Gain.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkBand7Gain.Location = new System.Drawing.Point(270, 23); + this.trkBand7Gain.Margin = new System.Windows.Forms.Padding(0); + this.trkBand7Gain.Maximum = 200; + this.trkBand7Gain.MaximumSize = new System.Drawing.Size(63, 160); + this.trkBand7Gain.Minimum = -200; + this.trkBand7Gain.MinimumSize = new System.Drawing.Size(34, 160); + this.trkBand7Gain.Name = "trkBand7Gain"; + this.trkBand7Gain.Size = new System.Drawing.Size(45, 160); + this.trkBand7Gain.TabIndex = 23; + this.trkBand7Gain.Text = "320 Hz"; + this.trkBand7Gain.Value = 50; + this.trkBand7Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); + // + // trkBand8Gain + // + this.trkBand8Gain.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkBand8Gain.Location = new System.Drawing.Point(315, 23); + this.trkBand8Gain.Margin = new System.Windows.Forms.Padding(0); + this.trkBand8Gain.Maximum = 200; + this.trkBand8Gain.MaximumSize = new System.Drawing.Size(63, 160); + this.trkBand8Gain.Minimum = -200; + this.trkBand8Gain.MinimumSize = new System.Drawing.Size(34, 160); + this.trkBand8Gain.Name = "trkBand8Gain"; + this.trkBand8Gain.Size = new System.Drawing.Size(45, 160); + this.trkBand8Gain.TabIndex = 24; + this.trkBand8Gain.Text = "450 Hz"; + this.trkBand8Gain.Value = 50; + this.trkBand8Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); + // + // trkBand9Gain + // + this.trkBand9Gain.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkBand9Gain.Location = new System.Drawing.Point(360, 23); + this.trkBand9Gain.Margin = new System.Windows.Forms.Padding(0); + this.trkBand9Gain.Maximum = 200; + this.trkBand9Gain.MaximumSize = new System.Drawing.Size(63, 160); + this.trkBand9Gain.Minimum = -200; + this.trkBand9Gain.MinimumSize = new System.Drawing.Size(34, 160); + this.trkBand9Gain.Name = "trkBand9Gain"; + this.trkBand9Gain.Size = new System.Drawing.Size(45, 160); + this.trkBand9Gain.TabIndex = 25; + this.trkBand9Gain.Text = "600 Hz"; + this.trkBand9Gain.Value = 50; + this.trkBand9Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); + // + // trkBand10Gain + // + this.trkBand10Gain.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkBand10Gain.Location = new System.Drawing.Point(405, 23); + this.trkBand10Gain.Margin = new System.Windows.Forms.Padding(0); + this.trkBand10Gain.Maximum = 200; + this.trkBand10Gain.MaximumSize = new System.Drawing.Size(63, 160); + this.trkBand10Gain.Minimum = -200; + this.trkBand10Gain.MinimumSize = new System.Drawing.Size(34, 160); + this.trkBand10Gain.Name = "trkBand10Gain"; + this.trkBand10Gain.Size = new System.Drawing.Size(52, 160); + this.trkBand10Gain.TabIndex = 26; + this.trkBand10Gain.Text = "750 Hz"; + this.trkBand10Gain.Value = 50; + this.trkBand10Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); + // + // trkBand17Gain + // + this.trkBand17Gain.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkBand17Gain.Location = new System.Drawing.Point(270, 183); + this.trkBand17Gain.Margin = new System.Windows.Forms.Padding(0); + this.trkBand17Gain.Maximum = 200; + this.trkBand17Gain.MaximumSize = new System.Drawing.Size(63, 160); + this.trkBand17Gain.Minimum = -200; + this.trkBand17Gain.MinimumSize = new System.Drawing.Size(34, 160); + this.trkBand17Gain.Name = "trkBand17Gain"; + this.trkBand17Gain.Size = new System.Drawing.Size(45, 160); + this.trkBand17Gain.TabIndex = 27; + this.trkBand17Gain.Text = "7.0 kHz"; + this.trkBand17Gain.Value = 50; + this.trkBand17Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); + // + // trkBand18Gain + // + this.trkBand18Gain.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkBand18Gain.Location = new System.Drawing.Point(315, 183); + this.trkBand18Gain.Margin = new System.Windows.Forms.Padding(0); + this.trkBand18Gain.Maximum = 200; + this.trkBand18Gain.MaximumSize = new System.Drawing.Size(63, 160); + this.trkBand18Gain.Minimum = -200; + this.trkBand18Gain.MinimumSize = new System.Drawing.Size(34, 160); + this.trkBand18Gain.Name = "trkBand18Gain"; + this.trkBand18Gain.Size = new System.Drawing.Size(45, 160); + this.trkBand18Gain.TabIndex = 28; + this.trkBand18Gain.Text = "10.0 kHz"; + this.trkBand18Gain.Value = 50; + this.trkBand18Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); + // + // trkBand19Gain + // + this.trkBand19Gain.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkBand19Gain.Location = new System.Drawing.Point(360, 183); + this.trkBand19Gain.Margin = new System.Windows.Forms.Padding(0); + this.trkBand19Gain.Maximum = 200; + this.trkBand19Gain.MaximumSize = new System.Drawing.Size(63, 160); + this.trkBand19Gain.Minimum = -200; + this.trkBand19Gain.MinimumSize = new System.Drawing.Size(34, 160); + this.trkBand19Gain.Name = "trkBand19Gain"; + this.trkBand19Gain.Size = new System.Drawing.Size(45, 160); + this.trkBand19Gain.TabIndex = 29; + this.trkBand19Gain.Text = "12.5 kHz"; + this.trkBand19Gain.Value = 50; + this.trkBand19Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); + // + // trkBand20Gain + // + this.trkBand20Gain.Dock = System.Windows.Forms.DockStyle.Fill; + this.trkBand20Gain.Location = new System.Drawing.Point(405, 183); + this.trkBand20Gain.Margin = new System.Windows.Forms.Padding(0); + this.trkBand20Gain.Maximum = 200; + this.trkBand20Gain.MaximumSize = new System.Drawing.Size(63, 160); + this.trkBand20Gain.Minimum = -200; + this.trkBand20Gain.MinimumSize = new System.Drawing.Size(34, 160); + this.trkBand20Gain.Name = "trkBand20Gain"; + this.trkBand20Gain.Size = new System.Drawing.Size(52, 160); + this.trkBand20Gain.TabIndex = 30; + this.trkBand20Gain.Text = "15 kHz"; + this.trkBand20Gain.Value = 50; + this.trkBand20Gain.ValueChanged += new System.EventHandler(this.trkBandGain_ValueChanged); + // + // flowLayoutPanel6 + // + this.flowLayoutPanel6.AutoSize = true; + this.tlpEqualizer.SetColumnSpan(this.flowLayoutPanel6, 5); + this.flowLayoutPanel6.Controls.Add(this.lblEqualizerPreset); + this.flowLayoutPanel6.Controls.Add(this.cboEqualizerPreset); + this.flowLayoutPanel6.Location = new System.Drawing.Point(0, 2); + this.flowLayoutPanel6.Margin = new System.Windows.Forms.Padding(0, 2, 0, 0); + this.flowLayoutPanel6.Name = "flowLayoutPanel6"; + this.flowLayoutPanel6.Size = new System.Drawing.Size(167, 21); + this.flowLayoutPanel6.TabIndex = 33; + this.flowLayoutPanel6.Visible = false; + // + // lblEqualizerPreset + // + this.lblEqualizerPreset.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblEqualizerPreset.AutoSize = true; + this.lblEqualizerPreset.Location = new System.Drawing.Point(3, 4); + this.lblEqualizerPreset.Name = "lblEqualizerPreset"; + this.lblEqualizerPreset.Size = new System.Drawing.Size(40, 13); + this.lblEqualizerPreset.TabIndex = 32; + this.lblEqualizerPreset.Text = "Preset:"; + // + // cboEqualizerPreset + // + this.cboEqualizerPreset.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.cboEqualizerPreset.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cboEqualizerPreset.FormattingEnabled = true; + this.cboEqualizerPreset.Location = new System.Drawing.Point(46, 0); + this.cboEqualizerPreset.Margin = new System.Windows.Forms.Padding(0); + this.cboEqualizerPreset.Name = "cboEqualizerPreset"; + this.cboEqualizerPreset.Size = new System.Drawing.Size(121, 21); + this.cboEqualizerPreset.TabIndex = 33; + this.cboEqualizerPreset.SelectedIndexChanged += new System.EventHandler(this.cboEqualizerPreset_SelectedIndexChanged); + // + // flowLayoutPanel7 + // + this.flowLayoutPanel7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.flowLayoutPanel7.AutoSize = true; + this.tlpEqualizer.SetColumnSpan(this.flowLayoutPanel7, 4); + this.flowLayoutPanel7.Controls.Add(this.lblEqualizerFilterType); + this.flowLayoutPanel7.Controls.Add(this.cboEqualizerFilterType); + this.flowLayoutPanel7.Location = new System.Drawing.Point(298, 2); + this.flowLayoutPanel7.Margin = new System.Windows.Forms.Padding(0, 2, 0, 0); + this.flowLayoutPanel7.Name = "flowLayoutPanel7"; + this.flowLayoutPanel7.Size = new System.Drawing.Size(159, 21); + this.flowLayoutPanel7.TabIndex = 34; + this.flowLayoutPanel7.Visible = false; + // + // lblEqualizerFilterType + // + this.lblEqualizerFilterType.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblEqualizerFilterType.AutoSize = true; + this.lblEqualizerFilterType.Location = new System.Drawing.Point(3, 4); + this.lblEqualizerFilterType.Name = "lblEqualizerFilterType"; + this.lblEqualizerFilterType.Size = new System.Drawing.Size(32, 13); + this.lblEqualizerFilterType.TabIndex = 31; + this.lblEqualizerFilterType.Text = "Filter:"; + // + // cboEqualizerFilterType + // + this.cboEqualizerFilterType.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.cboEqualizerFilterType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cboEqualizerFilterType.FormattingEnabled = true; + this.cboEqualizerFilterType.Location = new System.Drawing.Point(38, 0); + this.cboEqualizerFilterType.Margin = new System.Windows.Forms.Padding(0); + this.cboEqualizerFilterType.Name = "cboEqualizerFilterType"; + this.cboEqualizerFilterType.Size = new System.Drawing.Size(121, 21); + this.cboEqualizerFilterType.TabIndex = 32; + // + // tpgEffects + // + this.tpgEffects.Controls.Add(this.tableLayoutPanel4); + this.tpgEffects.Location = new System.Drawing.Point(4, 22); + this.tpgEffects.Name = "tpgEffects"; + this.tpgEffects.Padding = new System.Windows.Forms.Padding(3); + this.tpgEffects.Size = new System.Drawing.Size(469, 363); + this.tpgEffects.TabIndex = 3; + this.tpgEffects.Text = "Effects"; + this.tpgEffects.UseVisualStyleBackColor = true; + // + // tableLayoutPanel4 + // + this.tableLayoutPanel4.ColumnCount = 1; + this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel4.Controls.Add(this.grpStereo, 0, 0); + this.tableLayoutPanel4.Controls.Add(this.grpReverb, 0, 1); + this.tableLayoutPanel4.Controls.Add(this.flowLayoutPanel5, 0, 2); + this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel4.Location = new System.Drawing.Point(3, 3); + this.tableLayoutPanel4.Name = "tableLayoutPanel4"; + this.tableLayoutPanel4.RowCount = 4; + this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel4.Size = new System.Drawing.Size(463, 357); + this.tableLayoutPanel4.TabIndex = 0; + // + // grpStereo + // + this.grpStereo.Controls.Add(this.tlpStereoFilter); + this.grpStereo.Dock = System.Windows.Forms.DockStyle.Fill; + this.grpStereo.Location = new System.Drawing.Point(3, 3); + this.grpStereo.Name = "grpStereo"; + this.grpStereo.Size = new System.Drawing.Size(457, 115); + this.grpStereo.TabIndex = 0; + this.grpStereo.TabStop = false; + this.grpStereo.Text = "Stereo"; + // + // tlpStereoFilter + // + this.tlpStereoFilter.ColumnCount = 3; + this.tlpStereoFilter.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tlpStereoFilter.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tlpStereoFilter.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpStereoFilter.Controls.Add(this.radStereoCombFilter, 0, 3); + this.tlpStereoFilter.Controls.Add(this.lblStereoDelayMs, 2, 1); + this.tlpStereoFilter.Controls.Add(this.lblStereoPanningAngle, 2, 2); + this.tlpStereoFilter.Controls.Add(this.radStereoDisabled, 0, 0); + this.tlpStereoFilter.Controls.Add(this.radStereoDelay, 0, 1); + this.tlpStereoFilter.Controls.Add(this.radStereoPanning, 0, 2); + this.tlpStereoFilter.Controls.Add(this.nudStereoDelay, 1, 1); + this.tlpStereoFilter.Controls.Add(this.nudStereoPanning, 1, 2); + this.tlpStereoFilter.Controls.Add(this.tableLayoutPanel9, 1, 3); + this.tlpStereoFilter.Dock = System.Windows.Forms.DockStyle.Fill; + this.tlpStereoFilter.Location = new System.Drawing.Point(3, 16); + this.tlpStereoFilter.Name = "tlpStereoFilter"; + this.tlpStereoFilter.RowCount = 5; + this.tlpStereoFilter.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpStereoFilter.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpStereoFilter.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpStereoFilter.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tlpStereoFilter.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tlpStereoFilter.Size = new System.Drawing.Size(451, 96); + this.tlpStereoFilter.TabIndex = 0; + // + // radStereoCombFilter + // + this.radStereoCombFilter.AutoSize = true; + this.radStereoCombFilter.Location = new System.Drawing.Point(3, 72); + this.radStereoCombFilter.Name = "radStereoCombFilter"; + this.radStereoCombFilter.Size = new System.Drawing.Size(77, 17); + this.radStereoCombFilter.TabIndex = 4; + this.radStereoCombFilter.TabStop = true; + this.radStereoCombFilter.Tag = "Panning"; + this.radStereoCombFilter.Text = "Comb Filter"; + this.radStereoCombFilter.UseVisualStyleBackColor = true; + // + // lblStereoDelayMs + // + this.lblStereoDelayMs.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblStereoDelayMs.AutoSize = true; + this.lblStereoDelayMs.Location = new System.Drawing.Point(131, 28); + this.lblStereoDelayMs.Name = "lblStereoDelayMs"; + this.lblStereoDelayMs.Size = new System.Drawing.Size(20, 13); + this.lblStereoDelayMs.TabIndex = 1; + this.lblStereoDelayMs.Text = "ms"; + // + // lblStereoPanningAngle + // + this.lblStereoPanningAngle.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblStereoPanningAngle.AutoSize = true; + this.lblStereoPanningAngle.Location = new System.Drawing.Point(131, 51); + this.lblStereoPanningAngle.Name = "lblStereoPanningAngle"; + this.lblStereoPanningAngle.Size = new System.Drawing.Size(92, 13); + this.lblStereoPanningAngle.TabIndex = 1; + this.lblStereoPanningAngle.Text = "(Angle in degrees)"; + // + // radStereoDisabled + // + this.radStereoDisabled.AutoSize = true; + this.radStereoDisabled.Checked = true; + this.radStereoDisabled.Location = new System.Drawing.Point(3, 3); + this.radStereoDisabled.Name = "radStereoDisabled"; + this.radStereoDisabled.Size = new System.Drawing.Size(66, 17); + this.radStereoDisabled.TabIndex = 1; + this.radStereoDisabled.TabStop = true; + this.radStereoDisabled.Tag = "None"; + this.radStereoDisabled.Text = "Disabled"; + this.radStereoDisabled.UseVisualStyleBackColor = true; + // + // radStereoDelay + // + this.radStereoDelay.AutoSize = true; + this.radStereoDelay.Location = new System.Drawing.Point(3, 26); + this.radStereoDelay.Name = "radStereoDelay"; + this.radStereoDelay.Size = new System.Drawing.Size(52, 17); + this.radStereoDelay.TabIndex = 2; + this.radStereoDelay.TabStop = true; + this.radStereoDelay.Tag = "Delay"; + this.radStereoDelay.Text = "Delay"; + this.radStereoDelay.UseVisualStyleBackColor = true; + // + // radStereoPanning + // + this.radStereoPanning.AutoSize = true; + this.radStereoPanning.Location = new System.Drawing.Point(3, 49); + this.radStereoPanning.Name = "radStereoPanning"; + this.radStereoPanning.Size = new System.Drawing.Size(64, 17); + this.radStereoPanning.TabIndex = 3; + this.radStereoPanning.TabStop = true; + this.radStereoPanning.Tag = "Panning"; + this.radStereoPanning.Text = "Panning"; + this.radStereoPanning.UseVisualStyleBackColor = true; + // + // nudStereoDelay + // + this.nudStereoDelay.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.nudStereoDelay.DecimalPlaces = 0; + this.nudStereoDelay.Increment = new decimal(new int[] { 1, 0, 0, 0}); - this.nudStereoDelay.Location = new System.Drawing.Point(83, 24); - this.nudStereoDelay.Margin = new System.Windows.Forms.Padding(0); - this.nudStereoDelay.Maximum = new decimal(new int[] { + this.nudStereoDelay.IsHex = false; + this.nudStereoDelay.Location = new System.Drawing.Point(83, 24); + this.nudStereoDelay.Margin = new System.Windows.Forms.Padding(0); + this.nudStereoDelay.Maximum = new decimal(new int[] { 100, 0, 0, 0}); - this.nudStereoDelay.MaximumSize = new System.Drawing.Size(10000, 20); - this.nudStereoDelay.Minimum = new decimal(new int[] { + this.nudStereoDelay.MaximumSize = new System.Drawing.Size(10000, 20); + this.nudStereoDelay.Minimum = new decimal(new int[] { 0, 0, 0, 0}); - this.nudStereoDelay.MinimumSize = new System.Drawing.Size(0, 21); - this.nudStereoDelay.Name = "nudStereoDelay"; - this.nudStereoDelay.Size = new System.Drawing.Size(45, 21); - this.nudStereoDelay.TabIndex = 1; - this.nudStereoDelay.Value = new decimal(new int[] { + this.nudStereoDelay.MinimumSize = new System.Drawing.Size(0, 21); + this.nudStereoDelay.Name = "nudStereoDelay"; + this.nudStereoDelay.Size = new System.Drawing.Size(45, 21); + this.nudStereoDelay.TabIndex = 1; + this.nudStereoDelay.Value = new decimal(new int[] { 0, 0, 0, 0}); - // - // nudStereoPanning - // - this.nudStereoPanning.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.nudStereoPanning.DecimalPlaces = 0; - this.nudStereoPanning.Increment = new decimal(new int[] { + // + // nudStereoPanning + // + this.nudStereoPanning.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.nudStereoPanning.DecimalPlaces = 0; + this.nudStereoPanning.Increment = new decimal(new int[] { 1, 0, 0, 0}); - this.nudStereoPanning.Location = new System.Drawing.Point(83, 47); - this.nudStereoPanning.Margin = new System.Windows.Forms.Padding(0); - this.nudStereoPanning.Maximum = new decimal(new int[] { + this.nudStereoPanning.IsHex = false; + this.nudStereoPanning.Location = new System.Drawing.Point(83, 47); + this.nudStereoPanning.Margin = new System.Windows.Forms.Padding(0); + this.nudStereoPanning.Maximum = new decimal(new int[] { 180, 0, 0, 0}); - this.nudStereoPanning.MaximumSize = new System.Drawing.Size(10000, 20); - this.nudStereoPanning.Minimum = new decimal(new int[] { + this.nudStereoPanning.MaximumSize = new System.Drawing.Size(10000, 20); + this.nudStereoPanning.Minimum = new decimal(new int[] { 180, 0, 0, -2147483648}); - this.nudStereoPanning.MinimumSize = new System.Drawing.Size(0, 21); - this.nudStereoPanning.Name = "nudStereoPanning"; - this.nudStereoPanning.Size = new System.Drawing.Size(45, 21); - this.nudStereoPanning.TabIndex = 1; - this.nudStereoPanning.Value = new decimal(new int[] { + this.nudStereoPanning.MinimumSize = new System.Drawing.Size(0, 21); + this.nudStereoPanning.Name = "nudStereoPanning"; + this.nudStereoPanning.Size = new System.Drawing.Size(45, 21); + this.nudStereoPanning.TabIndex = 1; + this.nudStereoPanning.Value = new decimal(new int[] { 0, 0, 0, 0}); - // - // tableLayoutPanel9 - // - this.tableLayoutPanel9.ColumnCount = 7; - this.tlpStereoFilter.SetColumnSpan(this.tableLayoutPanel9, 2); - this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel9.Controls.Add(this.nudStereoCombFilterStrength, 4, 0); - this.tableLayoutPanel9.Controls.Add(this.lblStereoCombFilterMs, 2, 0); - this.tableLayoutPanel9.Controls.Add(this.nudStereoCombFilterDelay, 1, 0); - this.tableLayoutPanel9.Controls.Add(this.lblStereoCombFilterDelay, 0, 0); - this.tableLayoutPanel9.Controls.Add(this.lblStereoCombFilterStrength, 3, 0); - this.tableLayoutPanel9.Controls.Add(this.lblCombFilterPercent, 5, 0); - this.tableLayoutPanel9.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel9.Location = new System.Drawing.Point(83, 69); - this.tableLayoutPanel9.Margin = new System.Windows.Forms.Padding(0); - this.tableLayoutPanel9.Name = "tableLayoutPanel9"; - this.tableLayoutPanel9.RowCount = 1; - this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel9.Size = new System.Drawing.Size(368, 23); - this.tableLayoutPanel9.TabIndex = 5; - // - // nudStereoCombFilterStrength - // - this.nudStereoCombFilterStrength.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.nudStereoCombFilterStrength.DecimalPlaces = 0; - this.nudStereoCombFilterStrength.Increment = new decimal(new int[] { + // + // tableLayoutPanel9 + // + this.tableLayoutPanel9.ColumnCount = 7; + this.tlpStereoFilter.SetColumnSpan(this.tableLayoutPanel9, 2); + this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel9.Controls.Add(this.nudStereoCombFilterStrength, 4, 0); + this.tableLayoutPanel9.Controls.Add(this.lblStereoCombFilterMs, 2, 0); + this.tableLayoutPanel9.Controls.Add(this.nudStereoCombFilterDelay, 1, 0); + this.tableLayoutPanel9.Controls.Add(this.lblStereoCombFilterDelay, 0, 0); + this.tableLayoutPanel9.Controls.Add(this.lblStereoCombFilterStrength, 3, 0); + this.tableLayoutPanel9.Controls.Add(this.lblCombFilterPercent, 5, 0); + this.tableLayoutPanel9.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel9.Location = new System.Drawing.Point(83, 69); + this.tableLayoutPanel9.Margin = new System.Windows.Forms.Padding(0); + this.tableLayoutPanel9.Name = "tableLayoutPanel9"; + this.tableLayoutPanel9.RowCount = 1; + this.tableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel9.Size = new System.Drawing.Size(368, 23); + this.tableLayoutPanel9.TabIndex = 5; + // + // nudStereoCombFilterStrength + // + this.nudStereoCombFilterStrength.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.nudStereoCombFilterStrength.DecimalPlaces = 0; + this.nudStereoCombFilterStrength.Increment = new decimal(new int[] { 1, 0, 0, 0}); - this.nudStereoCombFilterStrength.Location = new System.Drawing.Point(187, 1); - this.nudStereoCombFilterStrength.Margin = new System.Windows.Forms.Padding(0); - this.nudStereoCombFilterStrength.Maximum = new decimal(new int[] { + this.nudStereoCombFilterStrength.IsHex = false; + this.nudStereoCombFilterStrength.Location = new System.Drawing.Point(187, 1); + this.nudStereoCombFilterStrength.Margin = new System.Windows.Forms.Padding(0); + this.nudStereoCombFilterStrength.Maximum = new decimal(new int[] { 200, 0, 0, 0}); - this.nudStereoCombFilterStrength.MaximumSize = new System.Drawing.Size(10000, 20); - this.nudStereoCombFilterStrength.Minimum = new decimal(new int[] { + this.nudStereoCombFilterStrength.MaximumSize = new System.Drawing.Size(10000, 20); + this.nudStereoCombFilterStrength.Minimum = new decimal(new int[] { 1, 0, 0, 0}); - this.nudStereoCombFilterStrength.MinimumSize = new System.Drawing.Size(0, 21); - this.nudStereoCombFilterStrength.Name = "nudStereoCombFilterStrength"; - this.nudStereoCombFilterStrength.Size = new System.Drawing.Size(45, 21); - this.nudStereoCombFilterStrength.TabIndex = 5; - this.nudStereoCombFilterStrength.Value = new decimal(new int[] { + this.nudStereoCombFilterStrength.MinimumSize = new System.Drawing.Size(0, 21); + this.nudStereoCombFilterStrength.Name = "nudStereoCombFilterStrength"; + this.nudStereoCombFilterStrength.Size = new System.Drawing.Size(45, 21); + this.nudStereoCombFilterStrength.TabIndex = 5; + this.nudStereoCombFilterStrength.Value = new decimal(new int[] { 1, 0, 0, 0}); - // - // lblStereoCombFilterMs - // - this.lblStereoCombFilterMs.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.lblStereoCombFilterMs.AutoSize = true; - this.lblStereoCombFilterMs.Location = new System.Drawing.Point(91, 5); - this.lblStereoCombFilterMs.Name = "lblStereoCombFilterMs"; - this.lblStereoCombFilterMs.Size = new System.Drawing.Size(20, 13); - this.lblStereoCombFilterMs.TabIndex = 3; - this.lblStereoCombFilterMs.Text = "ms"; - // - // nudStereoCombFilterDelay - // - this.nudStereoCombFilterDelay.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.nudStereoCombFilterDelay.DecimalPlaces = 0; - this.nudStereoCombFilterDelay.Increment = new decimal(new int[] { + // + // lblStereoCombFilterMs + // + this.lblStereoCombFilterMs.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblStereoCombFilterMs.AutoSize = true; + this.lblStereoCombFilterMs.Location = new System.Drawing.Point(91, 5); + this.lblStereoCombFilterMs.Name = "lblStereoCombFilterMs"; + this.lblStereoCombFilterMs.Size = new System.Drawing.Size(20, 13); + this.lblStereoCombFilterMs.TabIndex = 3; + this.lblStereoCombFilterMs.Text = "ms"; + // + // nudStereoCombFilterDelay + // + this.nudStereoCombFilterDelay.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.nudStereoCombFilterDelay.DecimalPlaces = 0; + this.nudStereoCombFilterDelay.Increment = new decimal(new int[] { 1, 0, 0, 0}); - this.nudStereoCombFilterDelay.Location = new System.Drawing.Point(43, 1); - this.nudStereoCombFilterDelay.Margin = new System.Windows.Forms.Padding(0); - this.nudStereoCombFilterDelay.Maximum = new decimal(new int[] { + this.nudStereoCombFilterDelay.IsHex = false; + this.nudStereoCombFilterDelay.Location = new System.Drawing.Point(43, 1); + this.nudStereoCombFilterDelay.Margin = new System.Windows.Forms.Padding(0); + this.nudStereoCombFilterDelay.Maximum = new decimal(new int[] { 100, 0, 0, 0}); - this.nudStereoCombFilterDelay.MaximumSize = new System.Drawing.Size(10000, 20); - this.nudStereoCombFilterDelay.Minimum = new decimal(new int[] { + this.nudStereoCombFilterDelay.MaximumSize = new System.Drawing.Size(10000, 20); + this.nudStereoCombFilterDelay.Minimum = new decimal(new int[] { 1, 0, 0, 0}); - this.nudStereoCombFilterDelay.MinimumSize = new System.Drawing.Size(0, 21); - this.nudStereoCombFilterDelay.Name = "nudStereoCombFilterDelay"; - this.nudStereoCombFilterDelay.Size = new System.Drawing.Size(45, 21); - this.nudStereoCombFilterDelay.TabIndex = 2; - this.nudStereoCombFilterDelay.Value = new decimal(new int[] { + this.nudStereoCombFilterDelay.MinimumSize = new System.Drawing.Size(0, 21); + this.nudStereoCombFilterDelay.Name = "nudStereoCombFilterDelay"; + this.nudStereoCombFilterDelay.Size = new System.Drawing.Size(45, 21); + this.nudStereoCombFilterDelay.TabIndex = 2; + this.nudStereoCombFilterDelay.Value = new decimal(new int[] { 1, 0, 0, 0}); - // - // lblStereoCombFilterDelay - // - this.lblStereoCombFilterDelay.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.lblStereoCombFilterDelay.AutoSize = true; - this.lblStereoCombFilterDelay.Location = new System.Drawing.Point(3, 5); - this.lblStereoCombFilterDelay.Name = "lblStereoCombFilterDelay"; - this.lblStereoCombFilterDelay.Size = new System.Drawing.Size(37, 13); - this.lblStereoCombFilterDelay.TabIndex = 0; - this.lblStereoCombFilterDelay.Text = "Delay:"; - // - // lblStereoCombFilterStrength - // - this.lblStereoCombFilterStrength.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.lblStereoCombFilterStrength.AutoSize = true; - this.lblStereoCombFilterStrength.Location = new System.Drawing.Point(134, 5); - this.lblStereoCombFilterStrength.Margin = new System.Windows.Forms.Padding(20, 0, 3, 0); - this.lblStereoCombFilterStrength.Name = "lblStereoCombFilterStrength"; - this.lblStereoCombFilterStrength.Size = new System.Drawing.Size(50, 13); - this.lblStereoCombFilterStrength.TabIndex = 4; - this.lblStereoCombFilterStrength.Text = "Strength:"; - // - // lblCombFilterPercent - // - this.lblCombFilterPercent.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.lblCombFilterPercent.AutoSize = true; - this.lblCombFilterPercent.Location = new System.Drawing.Point(235, 5); - this.lblCombFilterPercent.Name = "lblCombFilterPercent"; - this.lblCombFilterPercent.Size = new System.Drawing.Size(15, 13); - this.lblCombFilterPercent.TabIndex = 6; - this.lblCombFilterPercent.Text = "%"; - // - // grpReverb - // - this.grpReverb.Controls.Add(this.tableLayoutPanel5); - this.grpReverb.Dock = System.Windows.Forms.DockStyle.Fill; - this.grpReverb.Location = new System.Drawing.Point(3, 124); - this.grpReverb.Name = "grpReverb"; - this.grpReverb.Size = new System.Drawing.Size(457, 106); - this.grpReverb.TabIndex = 1; - this.grpReverb.TabStop = false; - this.grpReverb.Text = "Reverb"; - // - // tableLayoutPanel5 - // - this.tableLayoutPanel5.ColumnCount = 2; - this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel5.Controls.Add(this.chkReverbEnabled, 0, 0); - this.tableLayoutPanel5.Controls.Add(this.lblReverbStrength, 0, 1); - this.tableLayoutPanel5.Controls.Add(this.lblReverbDelay, 0, 2); - this.tableLayoutPanel5.Controls.Add(this.trkReverbDelay, 1, 2); - this.tableLayoutPanel5.Controls.Add(this.trkReverbStrength, 1, 1); - this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel5.Location = new System.Drawing.Point(3, 16); - this.tableLayoutPanel5.Name = "tableLayoutPanel5"; - this.tableLayoutPanel5.RowCount = 4; - this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); - this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); - this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel5.Size = new System.Drawing.Size(451, 87); - this.tableLayoutPanel5.TabIndex = 0; - // - // chkReverbEnabled - // - this.chkReverbEnabled.AutoSize = true; - this.tableLayoutPanel5.SetColumnSpan(this.chkReverbEnabled, 2); - this.chkReverbEnabled.Location = new System.Drawing.Point(3, 3); - this.chkReverbEnabled.Name = "chkReverbEnabled"; - this.chkReverbEnabled.Size = new System.Drawing.Size(97, 17); - this.chkReverbEnabled.TabIndex = 0; - this.chkReverbEnabled.Text = "Enable Reverb"; - this.chkReverbEnabled.UseVisualStyleBackColor = true; - // - // lblReverbStrength - // - this.lblReverbStrength.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.lblReverbStrength.AutoSize = true; - this.lblReverbStrength.Location = new System.Drawing.Point(3, 32); - this.lblReverbStrength.Name = "lblReverbStrength"; - this.lblReverbStrength.Size = new System.Drawing.Size(50, 13); - this.lblReverbStrength.TabIndex = 2; - this.lblReverbStrength.Text = "Strength:"; - // - // lblReverbDelay - // - this.lblReverbDelay.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.lblReverbDelay.AutoSize = true; - this.lblReverbDelay.Location = new System.Drawing.Point(3, 64); - this.lblReverbDelay.Name = "lblReverbDelay"; - this.lblReverbDelay.Size = new System.Drawing.Size(37, 13); - this.lblReverbDelay.TabIndex = 3; - this.lblReverbDelay.Text = "Delay:"; - // - // trkReverbDelay - // - this.trkReverbDelay.Location = new System.Drawing.Point(59, 58); - this.trkReverbDelay.Maximum = 30; - this.trkReverbDelay.Minimum = 1; - this.trkReverbDelay.Name = "trkReverbDelay"; - this.trkReverbDelay.Size = new System.Drawing.Size(104, 26); - this.trkReverbDelay.TabIndex = 4; - this.trkReverbDelay.TickFrequency = 3; - this.trkReverbDelay.Value = 1; - // - // trkReverbStrength - // - this.trkReverbStrength.Location = new System.Drawing.Point(59, 26); - this.trkReverbStrength.Minimum = 1; - this.trkReverbStrength.Name = "trkReverbStrength"; - this.trkReverbStrength.Size = new System.Drawing.Size(104, 26); - this.trkReverbStrength.TabIndex = 1; - this.trkReverbStrength.Value = 1; - // - // flowLayoutPanel5 - // - this.flowLayoutPanel5.AutoSize = true; - this.flowLayoutPanel5.Controls.Add(this.chkCrossFeedEnabled); - this.flowLayoutPanel5.Controls.Add(this.nudCrossFeedRatio); - this.flowLayoutPanel5.Controls.Add(this.lblCrossFeedRatio); - this.flowLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill; - this.flowLayoutPanel5.Location = new System.Drawing.Point(6, 233); - this.flowLayoutPanel5.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); - this.flowLayoutPanel5.Name = "flowLayoutPanel5"; - this.flowLayoutPanel5.Size = new System.Drawing.Size(457, 25); - this.flowLayoutPanel5.TabIndex = 6; - // - // chkCrossFeedEnabled - // - this.chkCrossFeedEnabled.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.chkCrossFeedEnabled.AutoSize = true; - this.chkCrossFeedEnabled.Location = new System.Drawing.Point(3, 5); - this.chkCrossFeedEnabled.Margin = new System.Windows.Forms.Padding(3, 5, 3, 3); - this.chkCrossFeedEnabled.Name = "chkCrossFeedEnabled"; - this.chkCrossFeedEnabled.Size = new System.Drawing.Size(112, 17); - this.chkCrossFeedEnabled.TabIndex = 1; - this.chkCrossFeedEnabled.Text = "Enable Crossfeed:"; - this.chkCrossFeedEnabled.UseVisualStyleBackColor = true; - // - // nudCrossFeedRatio - // - this.nudCrossFeedRatio.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.nudCrossFeedRatio.DecimalPlaces = 0; - this.nudCrossFeedRatio.Increment = new decimal(new int[] { + // + // lblStereoCombFilterDelay + // + this.lblStereoCombFilterDelay.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblStereoCombFilterDelay.AutoSize = true; + this.lblStereoCombFilterDelay.Location = new System.Drawing.Point(3, 5); + this.lblStereoCombFilterDelay.Name = "lblStereoCombFilterDelay"; + this.lblStereoCombFilterDelay.Size = new System.Drawing.Size(37, 13); + this.lblStereoCombFilterDelay.TabIndex = 0; + this.lblStereoCombFilterDelay.Text = "Delay:"; + // + // lblStereoCombFilterStrength + // + this.lblStereoCombFilterStrength.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblStereoCombFilterStrength.AutoSize = true; + this.lblStereoCombFilterStrength.Location = new System.Drawing.Point(134, 5); + this.lblStereoCombFilterStrength.Margin = new System.Windows.Forms.Padding(20, 0, 3, 0); + this.lblStereoCombFilterStrength.Name = "lblStereoCombFilterStrength"; + this.lblStereoCombFilterStrength.Size = new System.Drawing.Size(50, 13); + this.lblStereoCombFilterStrength.TabIndex = 4; + this.lblStereoCombFilterStrength.Text = "Strength:"; + // + // lblCombFilterPercent + // + this.lblCombFilterPercent.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblCombFilterPercent.AutoSize = true; + this.lblCombFilterPercent.Location = new System.Drawing.Point(235, 5); + this.lblCombFilterPercent.Name = "lblCombFilterPercent"; + this.lblCombFilterPercent.Size = new System.Drawing.Size(15, 13); + this.lblCombFilterPercent.TabIndex = 6; + this.lblCombFilterPercent.Text = "%"; + // + // grpReverb + // + this.grpReverb.Controls.Add(this.tableLayoutPanel5); + this.grpReverb.Dock = System.Windows.Forms.DockStyle.Fill; + this.grpReverb.Location = new System.Drawing.Point(3, 124); + this.grpReverb.Name = "grpReverb"; + this.grpReverb.Size = new System.Drawing.Size(457, 106); + this.grpReverb.TabIndex = 1; + this.grpReverb.TabStop = false; + this.grpReverb.Text = "Reverb"; + // + // tableLayoutPanel5 + // + this.tableLayoutPanel5.ColumnCount = 2; + this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel5.Controls.Add(this.chkReverbEnabled, 0, 0); + this.tableLayoutPanel5.Controls.Add(this.lblReverbStrength, 0, 1); + this.tableLayoutPanel5.Controls.Add(this.lblReverbDelay, 0, 2); + this.tableLayoutPanel5.Controls.Add(this.trkReverbDelay, 1, 2); + this.tableLayoutPanel5.Controls.Add(this.trkReverbStrength, 1, 1); + this.tableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel5.Location = new System.Drawing.Point(3, 16); + this.tableLayoutPanel5.Name = "tableLayoutPanel5"; + this.tableLayoutPanel5.RowCount = 4; + this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); + this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F)); + this.tableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel5.Size = new System.Drawing.Size(451, 87); + this.tableLayoutPanel5.TabIndex = 0; + // + // chkReverbEnabled + // + this.chkReverbEnabled.AutoSize = true; + this.tableLayoutPanel5.SetColumnSpan(this.chkReverbEnabled, 2); + this.chkReverbEnabled.Location = new System.Drawing.Point(3, 3); + this.chkReverbEnabled.Name = "chkReverbEnabled"; + this.chkReverbEnabled.Size = new System.Drawing.Size(97, 17); + this.chkReverbEnabled.TabIndex = 0; + this.chkReverbEnabled.Text = "Enable Reverb"; + this.chkReverbEnabled.UseVisualStyleBackColor = true; + // + // lblReverbStrength + // + this.lblReverbStrength.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblReverbStrength.AutoSize = true; + this.lblReverbStrength.Location = new System.Drawing.Point(3, 32); + this.lblReverbStrength.Name = "lblReverbStrength"; + this.lblReverbStrength.Size = new System.Drawing.Size(50, 13); + this.lblReverbStrength.TabIndex = 2; + this.lblReverbStrength.Text = "Strength:"; + // + // lblReverbDelay + // + this.lblReverbDelay.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblReverbDelay.AutoSize = true; + this.lblReverbDelay.Location = new System.Drawing.Point(3, 64); + this.lblReverbDelay.Name = "lblReverbDelay"; + this.lblReverbDelay.Size = new System.Drawing.Size(37, 13); + this.lblReverbDelay.TabIndex = 3; + this.lblReverbDelay.Text = "Delay:"; + // + // trkReverbDelay + // + this.trkReverbDelay.Location = new System.Drawing.Point(59, 58); + this.trkReverbDelay.Maximum = 30; + this.trkReverbDelay.Minimum = 1; + this.trkReverbDelay.Name = "trkReverbDelay"; + this.trkReverbDelay.Size = new System.Drawing.Size(104, 26); + this.trkReverbDelay.TabIndex = 4; + this.trkReverbDelay.TickFrequency = 3; + this.trkReverbDelay.Value = 1; + // + // trkReverbStrength + // + this.trkReverbStrength.Location = new System.Drawing.Point(59, 26); + this.trkReverbStrength.Minimum = 1; + this.trkReverbStrength.Name = "trkReverbStrength"; + this.trkReverbStrength.Size = new System.Drawing.Size(104, 26); + this.trkReverbStrength.TabIndex = 1; + this.trkReverbStrength.Value = 1; + // + // flowLayoutPanel5 + // + this.flowLayoutPanel5.AutoSize = true; + this.flowLayoutPanel5.Controls.Add(this.chkCrossFeedEnabled); + this.flowLayoutPanel5.Controls.Add(this.nudCrossFeedRatio); + this.flowLayoutPanel5.Controls.Add(this.lblCrossFeedRatio); + this.flowLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel5.Location = new System.Drawing.Point(6, 233); + this.flowLayoutPanel5.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); + this.flowLayoutPanel5.Name = "flowLayoutPanel5"; + this.flowLayoutPanel5.Size = new System.Drawing.Size(457, 25); + this.flowLayoutPanel5.TabIndex = 6; + // + // chkCrossFeedEnabled + // + this.chkCrossFeedEnabled.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.chkCrossFeedEnabled.AutoSize = true; + this.chkCrossFeedEnabled.Location = new System.Drawing.Point(3, 5); + this.chkCrossFeedEnabled.Margin = new System.Windows.Forms.Padding(3, 5, 3, 3); + this.chkCrossFeedEnabled.Name = "chkCrossFeedEnabled"; + this.chkCrossFeedEnabled.Size = new System.Drawing.Size(112, 17); + this.chkCrossFeedEnabled.TabIndex = 1; + this.chkCrossFeedEnabled.Text = "Enable Crossfeed:"; + this.chkCrossFeedEnabled.UseVisualStyleBackColor = true; + // + // nudCrossFeedRatio + // + this.nudCrossFeedRatio.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.nudCrossFeedRatio.DecimalPlaces = 0; + this.nudCrossFeedRatio.Increment = new decimal(new int[] { 1, 0, 0, 0}); - this.nudCrossFeedRatio.Location = new System.Drawing.Point(118, 2); - this.nudCrossFeedRatio.Margin = new System.Windows.Forms.Padding(0); - this.nudCrossFeedRatio.Maximum = new decimal(new int[] { + this.nudCrossFeedRatio.IsHex = false; + this.nudCrossFeedRatio.Location = new System.Drawing.Point(118, 2); + this.nudCrossFeedRatio.Margin = new System.Windows.Forms.Padding(0); + this.nudCrossFeedRatio.Maximum = new decimal(new int[] { 100, 0, 0, 0}); - this.nudCrossFeedRatio.MaximumSize = new System.Drawing.Size(10000, 20); - this.nudCrossFeedRatio.Minimum = new decimal(new int[] { + this.nudCrossFeedRatio.MaximumSize = new System.Drawing.Size(10000, 20); + this.nudCrossFeedRatio.Minimum = new decimal(new int[] { 0, 0, 0, 0}); - this.nudCrossFeedRatio.MinimumSize = new System.Drawing.Size(0, 21); - this.nudCrossFeedRatio.Name = "nudCrossFeedRatio"; - this.nudCrossFeedRatio.Size = new System.Drawing.Size(42, 21); - this.nudCrossFeedRatio.TabIndex = 2; - this.nudCrossFeedRatio.Value = new decimal(new int[] { + this.nudCrossFeedRatio.MinimumSize = new System.Drawing.Size(0, 21); + this.nudCrossFeedRatio.Name = "nudCrossFeedRatio"; + this.nudCrossFeedRatio.Size = new System.Drawing.Size(42, 21); + this.nudCrossFeedRatio.TabIndex = 2; + this.nudCrossFeedRatio.Value = new decimal(new int[] { 0, 0, 0, 0}); - // - // lblCrossFeedRatio - // - this.lblCrossFeedRatio.Anchor = System.Windows.Forms.AnchorStyles.Left; - this.lblCrossFeedRatio.AutoSize = true; - this.lblCrossFeedRatio.Location = new System.Drawing.Point(163, 6); - this.lblCrossFeedRatio.Name = "lblCrossFeedRatio"; - this.lblCrossFeedRatio.Size = new System.Drawing.Size(15, 13); - this.lblCrossFeedRatio.TabIndex = 3; - this.lblCrossFeedRatio.Text = "%"; - // - // tpgAdvanced - // - this.tpgAdvanced.Controls.Add(this.tableLayoutPanel3); - this.tpgAdvanced.Location = new System.Drawing.Point(4, 22); - this.tpgAdvanced.Name = "tpgAdvanced"; - this.tpgAdvanced.Padding = new System.Windows.Forms.Padding(3); - this.tpgAdvanced.Size = new System.Drawing.Size(469, 347); - this.tpgAdvanced.TabIndex = 2; - this.tpgAdvanced.Text = "Advanced"; - this.tpgAdvanced.UseVisualStyleBackColor = true; - // - // tableLayoutPanel3 - // - this.tableLayoutPanel3.ColumnCount = 1; - this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel3.Controls.Add(this.chkDisableDynamicSampleRate, 0, 2); - this.tableLayoutPanel3.Controls.Add(this.chkDisableNoiseModeFlag, 0, 4); - this.tableLayoutPanel3.Controls.Add(this.chkSilenceTriangleHighFreq, 0, 0); - this.tableLayoutPanel3.Controls.Add(this.chkSwapDutyCycles, 0, 3); - this.tableLayoutPanel3.Controls.Add(this.chkReduceDmcPopping, 0, 1); - this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 3); - this.tableLayoutPanel3.Name = "tableLayoutPanel3"; - this.tableLayoutPanel3.RowCount = 6; - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 24F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 24F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 24F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 24F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 24F)); - this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel3.Size = new System.Drawing.Size(463, 341); - this.tableLayoutPanel3.TabIndex = 1; - // - // chkDisableDynamicSampleRate - // - this.chkDisableDynamicSampleRate.Checked = false; - this.chkDisableDynamicSampleRate.Dock = System.Windows.Forms.DockStyle.Fill; - this.chkDisableDynamicSampleRate.Location = new System.Drawing.Point(0, 48); - this.chkDisableDynamicSampleRate.Name = "chkDisableDynamicSampleRate"; - this.chkDisableDynamicSampleRate.Size = new System.Drawing.Size(463, 24); - this.chkDisableDynamicSampleRate.TabIndex = 4; - this.chkDisableDynamicSampleRate.Text = "Disable dynamic sample rate"; - // - // chkDisableNoiseModeFlag - // - this.chkDisableNoiseModeFlag.Checked = false; - this.chkDisableNoiseModeFlag.Dock = System.Windows.Forms.DockStyle.Fill; - this.chkDisableNoiseModeFlag.Location = new System.Drawing.Point(0, 96); - this.chkDisableNoiseModeFlag.Name = "chkDisableNoiseModeFlag"; - this.chkDisableNoiseModeFlag.Size = new System.Drawing.Size(463, 24); - this.chkDisableNoiseModeFlag.TabIndex = 3; - this.chkDisableNoiseModeFlag.Text = "Disable noise channel mode flag"; - // - // chkSilenceTriangleHighFreq - // - this.chkSilenceTriangleHighFreq.AutoSize = true; - this.chkSilenceTriangleHighFreq.Location = new System.Drawing.Point(3, 3); - this.chkSilenceTriangleHighFreq.Name = "chkSilenceTriangleHighFreq"; - this.chkSilenceTriangleHighFreq.Size = new System.Drawing.Size(337, 17); - this.chkSilenceTriangleHighFreq.TabIndex = 1; - this.chkSilenceTriangleHighFreq.Text = "Mute ultrasonic frequencies on triangle channel (reduces popping)"; - // - // chkSwapDutyCycles - // - this.chkSwapDutyCycles.Checked = false; - this.chkSwapDutyCycles.Dock = System.Windows.Forms.DockStyle.Fill; - this.chkSwapDutyCycles.Location = new System.Drawing.Point(0, 72); - this.chkSwapDutyCycles.Name = "chkSwapDutyCycles"; - this.chkSwapDutyCycles.Size = new System.Drawing.Size(463, 24); - this.chkSwapDutyCycles.TabIndex = 0; - this.chkSwapDutyCycles.Text = "Swap square channels duty cycles (Mimics old clones)"; - // - // chkReduceDmcPopping - // - this.chkReduceDmcPopping.AutoSize = true; - this.chkReduceDmcPopping.CheckAlign = System.Drawing.ContentAlignment.TopLeft; - this.chkReduceDmcPopping.Location = new System.Drawing.Point(3, 27); - this.chkReduceDmcPopping.Name = "chkReduceDmcPopping"; - this.chkReduceDmcPopping.Size = new System.Drawing.Size(243, 17); - this.chkReduceDmcPopping.TabIndex = 2; - this.chkReduceDmcPopping.Text = "Reduce popping sounds on the DMC channel"; - this.chkReduceDmcPopping.TextAlign = System.Drawing.ContentAlignment.TopLeft; - this.chkReduceDmcPopping.UseVisualStyleBackColor = true; - // - // frmAudioConfig - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(477, 402); - this.Controls.Add(this.tabMain); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "frmAudioConfig"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Audio Options"; - this.Controls.SetChildIndex(this.baseConfigPanel, 0); - this.Controls.SetChildIndex(this.tabMain, 0); - this.baseConfigPanel.ResumeLayout(false); - this.baseConfigPanel.PerformLayout(); - this.grpVolume.ResumeLayout(false); - this.tableLayoutPanel1.ResumeLayout(false); - this.tableLayoutPanel2.ResumeLayout(false); - this.tableLayoutPanel2.PerformLayout(); - this.tableLayoutPanel7.ResumeLayout(false); - this.tableLayoutPanel7.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.picLatencyWarning)).EndInit(); - this.tableLayoutPanel8.ResumeLayout(false); - this.tableLayoutPanel8.PerformLayout(); - this.tabMain.ResumeLayout(false); - this.tpgGeneral.ResumeLayout(false); - this.tpgVolume.ResumeLayout(false); - this.tpgPanning.ResumeLayout(false); - this.tableLayoutPanel6.ResumeLayout(false); - this.tpgEqualizer.ResumeLayout(false); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - this.tlpEqualizer.ResumeLayout(false); - this.tlpEqualizer.PerformLayout(); - this.flowLayoutPanel6.ResumeLayout(false); - this.flowLayoutPanel6.PerformLayout(); - this.flowLayoutPanel7.ResumeLayout(false); - this.flowLayoutPanel7.PerformLayout(); - this.tpgEffects.ResumeLayout(false); - this.tableLayoutPanel4.ResumeLayout(false); - this.tableLayoutPanel4.PerformLayout(); - this.grpStereo.ResumeLayout(false); - this.tlpStereoFilter.ResumeLayout(false); - this.tlpStereoFilter.PerformLayout(); - this.tableLayoutPanel9.ResumeLayout(false); - this.tableLayoutPanel9.PerformLayout(); - this.grpReverb.ResumeLayout(false); - this.tableLayoutPanel5.ResumeLayout(false); - this.tableLayoutPanel5.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.trkReverbDelay)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.trkReverbStrength)).EndInit(); - this.flowLayoutPanel5.ResumeLayout(false); - this.flowLayoutPanel5.PerformLayout(); - this.tpgAdvanced.ResumeLayout(false); - this.tableLayoutPanel3.ResumeLayout(false); - this.tableLayoutPanel3.PerformLayout(); - this.ResumeLayout(false); + // + // lblCrossFeedRatio + // + this.lblCrossFeedRatio.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblCrossFeedRatio.AutoSize = true; + this.lblCrossFeedRatio.Location = new System.Drawing.Point(163, 6); + this.lblCrossFeedRatio.Name = "lblCrossFeedRatio"; + this.lblCrossFeedRatio.Size = new System.Drawing.Size(15, 13); + this.lblCrossFeedRatio.TabIndex = 3; + this.lblCrossFeedRatio.Text = "%"; + // + // tpgAdvanced + // + this.tpgAdvanced.Controls.Add(this.tableLayoutPanel3); + this.tpgAdvanced.Location = new System.Drawing.Point(4, 22); + this.tpgAdvanced.Name = "tpgAdvanced"; + this.tpgAdvanced.Padding = new System.Windows.Forms.Padding(3); + this.tpgAdvanced.Size = new System.Drawing.Size(469, 363); + this.tpgAdvanced.TabIndex = 2; + this.tpgAdvanced.Text = "Advanced"; + this.tpgAdvanced.UseVisualStyleBackColor = true; + // + // tableLayoutPanel3 + // + this.tableLayoutPanel3.ColumnCount = 1; + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel3.Controls.Add(this.chkDisableDynamicSampleRate, 0, 2); + this.tableLayoutPanel3.Controls.Add(this.chkDisableNoiseModeFlag, 0, 4); + this.tableLayoutPanel3.Controls.Add(this.nudEPSGClockFrequency, 0, 5); + this.tableLayoutPanel3.Controls.Add(this.lblEPSGClockFrequency, 0, 5); + this.tableLayoutPanel3.Controls.Add(this.chkSilenceTriangleHighFreq, 0, 0); + this.tableLayoutPanel3.Controls.Add(this.chkSwapDutyCycles, 0, 3); + this.tableLayoutPanel3.Controls.Add(this.chkReduceDmcPopping, 0, 1); + this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel3.Location = new System.Drawing.Point(3, 3); + this.tableLayoutPanel3.Name = "tableLayoutPanel3"; + this.tableLayoutPanel3.RowCount = 7; + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 24F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 24F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 24F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 24F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 24F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 24F)); + this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel3.Size = new System.Drawing.Size(463, 357); + this.tableLayoutPanel3.TabIndex = 1; + // + // chkDisableDynamicSampleRate + // + this.chkDisableDynamicSampleRate.Checked = false; + this.chkDisableDynamicSampleRate.Dock = System.Windows.Forms.DockStyle.Fill; + this.chkDisableDynamicSampleRate.Location = new System.Drawing.Point(0, 48); + this.chkDisableDynamicSampleRate.Name = "chkDisableDynamicSampleRate"; + this.chkDisableDynamicSampleRate.Size = new System.Drawing.Size(463, 24); + this.chkDisableDynamicSampleRate.TabIndex = 4; + this.chkDisableDynamicSampleRate.Text = "Disable dynamic sample rate"; + // + // chkDisableNoiseModeFlag + // + this.chkDisableNoiseModeFlag.Checked = false; + this.chkDisableNoiseModeFlag.Dock = System.Windows.Forms.DockStyle.Fill; + this.chkDisableNoiseModeFlag.Location = new System.Drawing.Point(0, 96); + this.chkDisableNoiseModeFlag.Name = "chkDisableNoiseModeFlag"; + this.chkDisableNoiseModeFlag.Size = new System.Drawing.Size(463, 24); + this.chkDisableNoiseModeFlag.TabIndex = 3; + this.chkDisableNoiseModeFlag.Text = "Disable noise channel mode flag"; + // + // nudEPSGClockFrequency + // + this.nudEPSGClockFrequency.DecimalPlaces = 0; + this.nudEPSGClockFrequency.Dock = System.Windows.Forms.DockStyle.Fill; + this.nudEPSGClockFrequency.Increment = new decimal(new int[] { + 100000, + 0, + 0, + 0}); + this.nudEPSGClockFrequency.IsHex = false; + this.nudEPSGClockFrequency.Location = new System.Drawing.Point(3, 147); + this.nudEPSGClockFrequency.Maximum = new decimal(new int[] { + 32000000, + 0, + 0, + 0}); + this.nudEPSGClockFrequency.MaximumSize = new System.Drawing.Size(10000, 20); + this.nudEPSGClockFrequency.Minimum = new decimal(new int[] { + 10000, + 0, + 0, + 0}); + this.nudEPSGClockFrequency.MinimumSize = new System.Drawing.Size(200, 21); + this.nudEPSGClockFrequency.Name = "nudEPSGClockFrequency"; + this.nudEPSGClockFrequency.Size = new System.Drawing.Size(457, 21); + this.nudEPSGClockFrequency.TabIndex = 3; + this.nudEPSGClockFrequency.Value = new decimal(new int[] { + 10000, + 0, + 0, + 0}); + // + // lblEPSGClockFrequency + // + this.lblEPSGClockFrequency.Anchor = System.Windows.Forms.AnchorStyles.Left; + this.lblEPSGClockFrequency.AutoSize = true; + this.lblEPSGClockFrequency.Location = new System.Drawing.Point(3, 125); + this.lblEPSGClockFrequency.Name = "lblEPSGClockFrequency"; + this.lblEPSGClockFrequency.Size = new System.Drawing.Size(228, 13); + this.lblEPSGClockFrequency.TabIndex = 3; + this.lblEPSGClockFrequency.Text = "EPSG Clock Frequency (default is 3579545Hz)"; + // + // chkSilenceTriangleHighFreq + // + this.chkSilenceTriangleHighFreq.AutoSize = true; + this.chkSilenceTriangleHighFreq.Location = new System.Drawing.Point(3, 3); + this.chkSilenceTriangleHighFreq.Name = "chkSilenceTriangleHighFreq"; + this.chkSilenceTriangleHighFreq.Size = new System.Drawing.Size(337, 17); + this.chkSilenceTriangleHighFreq.TabIndex = 1; + this.chkSilenceTriangleHighFreq.Text = "Mute ultrasonic frequencies on triangle channel (reduces popping)"; + // + // chkSwapDutyCycles + // + this.chkSwapDutyCycles.Checked = false; + this.chkSwapDutyCycles.Dock = System.Windows.Forms.DockStyle.Fill; + this.chkSwapDutyCycles.Location = new System.Drawing.Point(0, 72); + this.chkSwapDutyCycles.Name = "chkSwapDutyCycles"; + this.chkSwapDutyCycles.Size = new System.Drawing.Size(463, 24); + this.chkSwapDutyCycles.TabIndex = 0; + this.chkSwapDutyCycles.Text = "Swap square channels duty cycles (Mimics old clones)"; + // + // chkReduceDmcPopping + // + this.chkReduceDmcPopping.AutoSize = true; + this.chkReduceDmcPopping.CheckAlign = System.Drawing.ContentAlignment.TopLeft; + this.chkReduceDmcPopping.Location = new System.Drawing.Point(3, 27); + this.chkReduceDmcPopping.Name = "chkReduceDmcPopping"; + this.chkReduceDmcPopping.Size = new System.Drawing.Size(243, 17); + this.chkReduceDmcPopping.TabIndex = 2; + this.chkReduceDmcPopping.Text = "Reduce popping sounds on the DMC channel"; + this.chkReduceDmcPopping.TextAlign = System.Drawing.ContentAlignment.TopLeft; + this.chkReduceDmcPopping.UseVisualStyleBackColor = true; + // + // frmAudioConfig + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(477, 450); + this.Controls.Add(this.tabMain); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "frmAudioConfig"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Audio Options"; + this.Controls.SetChildIndex(this.baseConfigPanel, 0); + this.Controls.SetChildIndex(this.tabMain, 0); + this.baseConfigPanel.ResumeLayout(false); + this.baseConfigPanel.PerformLayout(); + this.grpVolume.ResumeLayout(false); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel2.ResumeLayout(false); + this.tableLayoutPanel2.PerformLayout(); + this.tableLayoutPanel7.ResumeLayout(false); + this.tableLayoutPanel7.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picLatencyWarning)).EndInit(); + this.tableLayoutPanel8.ResumeLayout(false); + this.tableLayoutPanel8.PerformLayout(); + this.tabMain.ResumeLayout(false); + this.tpgGeneral.ResumeLayout(false); + this.tpgVolume.ResumeLayout(false); + this.tpgPanning.ResumeLayout(false); + this.tableLayoutPanel6.ResumeLayout(false); + this.tpgEqualizer.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.tlpEqualizer.ResumeLayout(false); + this.tlpEqualizer.PerformLayout(); + this.flowLayoutPanel6.ResumeLayout(false); + this.flowLayoutPanel6.PerformLayout(); + this.flowLayoutPanel7.ResumeLayout(false); + this.flowLayoutPanel7.PerformLayout(); + this.tpgEffects.ResumeLayout(false); + this.tableLayoutPanel4.ResumeLayout(false); + this.tableLayoutPanel4.PerformLayout(); + this.grpStereo.ResumeLayout(false); + this.tlpStereoFilter.ResumeLayout(false); + this.tlpStereoFilter.PerformLayout(); + this.tableLayoutPanel9.ResumeLayout(false); + this.tableLayoutPanel9.PerformLayout(); + this.grpReverb.ResumeLayout(false); + this.tableLayoutPanel5.ResumeLayout(false); + this.tableLayoutPanel5.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.trkReverbDelay)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.trkReverbStrength)).EndInit(); + this.flowLayoutPanel5.ResumeLayout(false); + this.flowLayoutPanel5.PerformLayout(); + this.tpgAdvanced.ResumeLayout(false); + this.tableLayoutPanel3.ResumeLayout(false); + this.tableLayoutPanel3.PerformLayout(); + this.ResumeLayout(false); } @@ -2030,6 +2166,7 @@ namespace Mesen.GUI.Forms.Config private System.Windows.Forms.GroupBox grpVolume; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; private System.Windows.Forms.CheckBox chkEnableAudio; + private System.Windows.Forms.CheckBox chkEnableEPSG; private System.Windows.Forms.Label lblAudioLatency; private MesenNumericUpDown nudLatency; private System.Windows.Forms.Label lblLatencyMs; @@ -2051,7 +2188,9 @@ namespace Mesen.GUI.Forms.Config private Controls.ctrlTrackbar trkVrc7Vol; private Controls.ctrlTrackbar trkNamco163Vol; private Controls.ctrlTrackbar trkSunsoft5b; - private System.Windows.Forms.TabControl tabMain; + private Controls.ctrlTrackbar trkEPSGVol_L; + private Controls.ctrlTrackbar trkEPSGVol_R; + private System.Windows.Forms.TabControl tabMain; private System.Windows.Forms.TabPage tpgGeneral; private System.Windows.Forms.TabPage tpgVolume; private System.Windows.Forms.CheckBox chkReduceSoundInBackground; @@ -2091,6 +2230,8 @@ namespace Mesen.GUI.Forms.Config private Controls.ctrlHorizontalTrackbar trkVrc7Pan; private Controls.ctrlHorizontalTrackbar trkNamcoPan; private Controls.ctrlHorizontalTrackbar trkSunsoftPan; + private Controls.ctrlHorizontalTrackbar trkEPSGPan_L; + private Controls.ctrlHorizontalTrackbar trkEPSGPan_R; private Controls.ctrlHorizontalTrackbar trkSquare1Pan; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel5; private System.Windows.Forms.CheckBox chkCrossFeedEnabled; @@ -2098,6 +2239,8 @@ namespace Mesen.GUI.Forms.Config private System.Windows.Forms.Label lblCrossFeedRatio; private Controls.ctrlHorizontalTrackbar trkTrianglePan; private ctrlRiskyOption chkDisableNoiseModeFlag; + private MesenNumericUpDown nudEPSGClockFrequency; + private System.Windows.Forms.Label lblEPSGClockFrequency; private System.Windows.Forms.TabPage tpgEqualizer; private System.Windows.Forms.TableLayoutPanel tlpEqualizer; private ctrlTrackbar trkBand6Gain; diff --git a/GUI.NET/Forms/Config/frmAudioConfig.cs b/GUI.NET/Forms/Config/frmAudioConfig.cs index 7045cc97..2f8fb3f6 100644 --- a/GUI.NET/Forms/Config/frmAudioConfig.cs +++ b/GUI.NET/Forms/Config/frmAudioConfig.cs @@ -31,6 +31,7 @@ namespace Mesen.GUI.Forms.Config cboAudioDevice.Items.AddRange(InteropEmu.GetAudioDevices().ToArray()); AddBinding("EnableAudio", chkEnableAudio); + AddBinding("EnableEPSG", chkEnableEPSG); AddBinding("MasterVolume", trkMaster); AddBinding("Square1Volume", trkSquare1Vol); AddBinding("Square2Volume", trkSquare2Vol); @@ -43,6 +44,8 @@ namespace Mesen.GUI.Forms.Config AddBinding("Vrc7Volume", trkVrc7Vol); AddBinding("Namco163Volume", trkNamco163Vol); AddBinding("Sunsoft5bVolume", trkSunsoft5b); + AddBinding("EPSGVolume_L", trkEPSGVol_L); + AddBinding("EPSGVolume_R", trkEPSGVol_R); AddBinding("Square1Panning", trkSquare1Pan); AddBinding("Square2Panning", trkSquare2Pan); @@ -55,6 +58,10 @@ namespace Mesen.GUI.Forms.Config AddBinding("Vrc7Panning", trkVrc7Pan); AddBinding("Namco163Panning", trkNamcoPan); AddBinding("Sunsoft5bPanning", trkSunsoftPan); + AddBinding("EPSGPanning_L", trkEPSGPan_L); + AddBinding("EPSGPanning_R", trkEPSGPan_R); + + AddBinding("EPSGClockFrequency", nudEPSGClockFrequency); AddBinding("AudioLatency", nudLatency); AddBinding("SampleRate", cboSampleRate); diff --git a/GUI.NET/InteropEmu.cs b/GUI.NET/InteropEmu.cs index af75b552..d5492cc4 100644 --- a/GUI.NET/InteropEmu.cs +++ b/GUI.NET/InteropEmu.cs @@ -208,6 +208,7 @@ namespace Mesen.GUI [DllImport(DLLPath)] public static extern void SetBandGain(int band, double gain); [DllImport(DLLPath)] public static extern void SetSampleRate(UInt32 sampleRate); [DllImport(DLLPath)] public static extern void SetAudioLatency(UInt32 msLatency); + [DllImport(DLLPath)] public static extern void SetEPSGClockFrequency(UInt32 clockFrequency); [DllImport(DLLPath)] public static extern void SetAudioFilterSettings(AudioFilterSettings settings); [DllImport(DLLPath)] public static extern void SetRunAheadFrames(UInt32 frameCount); @@ -2298,8 +2299,10 @@ namespace Mesen.GUI VRC6 = 7, VRC7 = 8, Namco163 = 9, - Sunsoft5B = 10 - } + Sunsoft5B = 10, + EPSG_L = 11, + EPSG_R= 12 + } public enum EqualizerFilterType { diff --git a/InteropDLL/ConsoleWrapper.cpp b/InteropDLL/ConsoleWrapper.cpp index 324a65b3..f1bc536c 100644 --- a/InteropDLL/ConsoleWrapper.cpp +++ b/InteropDLL/ConsoleWrapper.cpp @@ -633,6 +633,7 @@ namespace InteropEmu { DllExport void __stdcall SetMasterVolume(double volume, double volumeReduction, ConsoleId consoleId) { GetConsoleById(consoleId)->GetSettings()->SetMasterVolume(volume, volumeReduction); } DllExport void __stdcall SetSampleRate(uint32_t sampleRate) { _settings->SetSampleRate(sampleRate); } DllExport void __stdcall SetAudioLatency(uint32_t msLatency) { _settings->SetAudioLatency(msLatency); } + DllExport void __stdcall SetEPSGClockFrequency(uint32_t clockFrequency) { _settings->SetEPSGClockFrequency(clockFrequency); } DllExport void __stdcall SetAudioFilterSettings(AudioFilterSettings settings) { _settings->SetAudioFilterSettings(settings); } DllExport void __stdcall SetRunAheadFrames(uint32_t frameCount) { _settings->SetRunAheadFrames(frameCount); }