Merge pull request #13 from NovaSquirrel/master

Perkka2's updates
This commit is contained in:
mkwong98 2021-08-07 00:04:21 +08:00 committed by GitHub
commit dd7d58732a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 1356 additions and 1203 deletions

View file

@ -14,7 +14,7 @@
#include "CPU.h"
void BaseMapper::WriteRegister(uint16_t addr, uint8_t value) { }
void BaseMapper::WriteEPSG(uint16_t addr, uint8_t value) { _epsgaudio->WriteRegister(addr, value); }
void BaseMapper::WriteEPSM(uint16_t addr, uint8_t value) { _epsmaudio->WriteRegister(addr, value); }
uint8_t BaseMapper::ReadRegister(uint16_t addr) { return 0; }
void BaseMapper::InitMapper(RomData &romData) { }
void BaseMapper::Reset(bool softReset) { }
@ -510,9 +510,9 @@ void BaseMapper::StreamState(bool saving)
ArrayInfo<ChrMemoryType> chrMemoryType = { _chrMemoryType, 0x40 };
ArrayInfo<MemoryAccessType> prgMemoryAccess = { _prgMemoryAccess, 0x100 };
ArrayInfo<MemoryAccessType> chrMemoryAccess = { _chrMemoryAccess, 0x40 };
SnapshotInfo epsgaudio{ _epsgaudio.get() };
SnapshotInfo epsmaudio{ _epsmaudio.get() };
Stream(_mirroringType, chrRam, workRam, saveRam, nametableRam, prgMemoryOffset, chrMemoryOffset, prgMemoryType, chrMemoryType, prgMemoryAccess, chrMemoryAccess, epsgaudio);
Stream(_mirroringType, chrRam, workRam, saveRam, nametableRam, prgMemoryOffset, chrMemoryOffset, prgMemoryType, chrMemoryType, prgMemoryAccess, chrMemoryAccess, epsmaudio);
if(!saving) {
RestorePrgChrState();
@ -639,7 +639,7 @@ void BaseMapper::Initialize(RomData &romData)
InitMapper();
InitMapper(romData);
_epsgaudio.reset(new EPSGAudio(_console));
_epsmaudio.reset(new EPSMAudio(_console));
//Load battery data if present
LoadBattery();
@ -782,7 +782,8 @@ uint8_t BaseMapper::DebugReadRAM(uint16_t addr)
void BaseMapper::WriteRAM(uint16_t addr, uint8_t value)
{
if((addr == 0x4016) & (_console->GetCpu()->GetCycleCount() % 2 == 1)){ WriteEPSG(addr, value); }
if((addr == 0x4016) & (_console->GetCpu()->GetCycleCount() % 2 == 1)){ WriteEPSM(addr, value); }
if ((addr >= 0x401c && addr <= 0x401f)) { WriteEPSM(addr, value); }
if(_isWriteRegisterAddr[addr]) {
if(_hasBusConflicts) {
uint8_t prgValue = _prgPages[addr >> 8][(uint8_t)addr];

View file

@ -10,7 +10,7 @@
#include "RomData.h"
#include "Console.h"
#include "CPU.h"
#include "EPSGAudio.h"
#include "EPSMAudio.h"
class BaseControlDevice;
@ -106,7 +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 void WriteEPSM(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);
@ -158,7 +158,7 @@ protected:
public:
static constexpr uint32_t NametableCount = 0x10;
static constexpr uint32_t NametableSize = 0x400;
unique_ptr<EPSGAudio> _epsgaudio;
unique_ptr<EPSMAudio> _epsmaudio;
void Initialize(RomData &romData);
virtual ~BaseMapper();
@ -168,7 +168,7 @@ public:
virtual void SetNesModel(NesModel model) { }
virtual void ProcessCpuClock() { }
virtual void ProcessEPSGClock() { _epsgaudio->Clock(); }
virtual void ProcessEPSMClock() { _epsmaudio->Clock(); }
virtual void NotifyVRAMAddressChange(uint16_t addr);
virtual void GetMemoryRanges(MemoryRanges &ranges) override;

View file

@ -465,7 +465,7 @@ bool Console::Initialize(VirtualFile &romFile, VirtualFile &patchFile, bool forP
void Console::ProcessCpuClock()
{
_mapper->ProcessEPSGClock();
_mapper->ProcessEPSMClock();
_mapper->ProcessCpuClock();
_apu->ProcessCpuClock();
}

View file

@ -559,7 +559,7 @@
<ClInclude Include="Eeprom24C01.h" />
<ClInclude Include="Eeprom24C02.h" />
<ClInclude Include="emu2149.h" />
<ClInclude Include="EPSGAudio.h" />
<ClInclude Include="EPSMAudio.h" />
<ClInclude Include="EventManager.h" />
<ClInclude Include="FaridSlrom.h" />
<ClInclude Include="FaridUnrom.h" />

View file

@ -1508,9 +1508,6 @@
<ClInclude Include="ym3438.h">
<Filter>Nes\Mappers\EPSG</Filter>
</ClInclude>
<ClInclude Include="EPSGAudio.h">
<Filter>Nes\Mappers\EPSG</Filter>
</ClInclude>
<ClInclude Include="SSGAudio.h">
<Filter>Nes\Mappers</Filter>
</ClInclude>
@ -1520,6 +1517,9 @@
<ClInclude Include="emu2149.h">
<Filter>Nes\Mappers\EPSG</Filter>
</ClInclude>
<ClInclude Include="EPSMAudio.h">
<Filter>Nes\Mappers\EPSG</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">

View file

@ -9,9 +9,9 @@
#include <array>
#include "ym3438.h"
using EPSGSSGAudio = SSGAudio<AudioChannel::EPSG_L, AudioChannel::EPSG_R>;
using EPSMSSGAudio = SSGAudio<AudioChannel::EPSM_L, AudioChannel::EPSM_R>;
class EPSGAudio : public EPSGSSGAudio
class EPSMAudio : public EPSMSSGAudio
{
private:
ym3438_t _chip;
@ -42,7 +42,7 @@ private:
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]);
_console->GetApu()->AddExpansionAudioDelta(x == 0 ? AudioChannel::EPSM_L : AudioChannel::EPSM_R, _currentOutputs[x] - _lastOutputs[x]);
_lastOutputs[x] = _currentOutputs[x];
}
}
@ -58,7 +58,7 @@ private:
if (_inputBuffer[cycle].wrote)
{
std::cout << "EPSG CHIP DOUBLE WRITE" << std::endl;
std::cout << "EPSM CHIP DOUBLE WRITE" << std::endl;
}
_inputBuffer[cycle] = {
@ -71,13 +71,13 @@ private:
uint32_t getClockFrequency()
{
return _console->GetSettings()->GetEPSGClockFrequency() / 6;
return _console->GetSettings()->GetEPSMClockFrequency() / 6;
}
protected:
void StreamState(bool saving) override
{
EPSGSSGAudio::StreamState(saving);
EPSMSSGAudio::StreamState(saving);
ArrayInfo<int16_t> lastOutputs{ _lastOutputs, 2 };
ArrayInfo<int16_t> currentOutputs{ _currentOutputs, 2 };
@ -89,7 +89,7 @@ protected:
void ClockAudio() override
{
EPSGSSGAudio::ClockAudio();
EPSMSSGAudio::ClockAudio();
_clock += getClockFrequency() / (double)_console->GetCpu()->GetClockRate(_console->GetModel());
@ -132,11 +132,11 @@ protected:
virtual uint32_t GetSSGClockFrequency()
{
return EPSGSSGAudio::GetSSGClockFrequency() * (_console->GetSettings()->GetEPSGClockFrequency() / 3579545.0 );
return EPSMSSGAudio::GetSSGClockFrequency() * (_console->GetSettings()->GetEPSMClockFrequency() / 3579545.0 );
}
public:
EPSGAudio(shared_ptr<Console> console) : EPSGSSGAudio(console)
EPSMAudio(shared_ptr<Console> console) : EPSMSSGAudio(console)
{
memset(_lastOutputs, 0, sizeof(_lastOutputs));
memset(_currentOutputs, 0, sizeof(_currentOutputs));
@ -173,10 +173,14 @@ public:
const uint8_t a04016 = (writeAddr & 0xF000) == 0xE000;
const uint8_t a14016 = !!(writeAddr & 0xF);
EPSGSSGAudio::WriteRegister(writeAddr, writeValue);
EPSMSSGAudio::WriteRegister(writeAddr, writeValue);
WriteToChip(a04016 | (a14016 << 1), writeValue);
}
}
if (addr == 0x401c) { addr = 0xC000; }
if (addr == 0x401d) { addr = 0xE000; }
if (addr == 0x401e) { addr = 0xC002; }
if (addr == 0x401f) { addr = 0xE002; }
switch(addr) {
case 0xC000:
@ -186,7 +190,7 @@ public:
const uint8_t a0 = (addr & 0xF000) == 0xE000;
const uint8_t a1 = !!(addr & 0xF);
EPSGSSGAudio::WriteRegister(addr, value);
EPSMSSGAudio::WriteRegister(addr, value);
WriteToChip(a0 | (a1 << 1), value);
break;

View file

@ -117,8 +117,8 @@ enum class AudioChannel
VRC7 = 8,
Namco163 = 9,
Sunsoft5B = 10,
EPSG_L = 11,
EPSG_R = 12,
EPSM_L = 11,
EPSM_R = 12,
};
enum class EqualizerFilterType
@ -659,7 +659,7 @@ private:
bool _audioSettingsChanged = false;
uint32_t _audioLatency = 50;
uint32_t _EPSGClockFrequency = 3579545;
uint32_t _EPSMClockFrequency = 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;
@ -991,9 +991,9 @@ public:
_audioSettingsChanged = true;
}
void SetEPSGClockFrequency(uint32_t clockFrequency)
void SetEPSMClockFrequency(uint32_t clockFrequency)
{
_EPSGClockFrequency = clockFrequency;
_EPSMClockFrequency = clockFrequency;
_audioSettingsChanged = true;
}
@ -1168,9 +1168,9 @@ public:
return _audioLatency;
}
uint32_t GetEPSGClockFrequency()
uint32_t GetEPSMClockFrequency()
{
return _EPSGClockFrequency;
return _EPSMClockFrequency;
}
void SetVideoFilterType(VideoFilterType videoFilterType)

View file

@ -133,7 +133,7 @@ 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) {
if ((addr == 0x4016) | (addr >= 0x401c && addr <= 0x401f)) {
_ramWriteHandlers[0xE000]->WriteRAM(addr, value);
}
}

View file

@ -91,7 +91,10 @@ void NsfLoader::InitializeFromHeader(RomData &romData)
chips.push_back("Sunsoft 5B");
}
if (header.SoundChips & 0x40) {
chips.push_back("EPSG");
chips.push_back("VT02");
}
if (header.SoundChips & 0x80) {
chips.push_back("EPSM");
}
if(chips.empty()) {
chips.push_back("<none>");

View file

@ -27,7 +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));
_epsmAudio.reset(new EPSMAudio(_console));
SetCpuMemoryMapping(0x3F00, 0x3FFF, PrgMemoryType::WorkRam, 0x2000, MemoryAccessType::Read);
memcpy(GetWorkRam() + 0x2000, _nsfBios, 0x100);
@ -109,8 +109,9 @@ void NsfMapper::InitMapper(RomData& romData)
AddRegisterRange(0x4040, 0x4092, MemoryOperation::Any);
}
if(_nsfHeader.SoundChips & NsfSoundChips::EPSG) {
if(_nsfHeader.SoundChips & NsfSoundChips::EPSM) {
AddRegisterRange(0x4016, 0x4016, MemoryOperation::Write);
AddRegisterRange(0x401c, 0x401f, MemoryOperation::Write);
}
}
@ -277,8 +278,8 @@ void NsfMapper::ProcessCpuClock()
if(_nsfHeader.SoundChips & NsfSoundChips::FDS) {
_fdsAudio->Clock();
}
if (_nsfHeader.SoundChips & NsfSoundChips::EPSG) {
_epsgAudio->Clock();
if (_nsfHeader.SoundChips & NsfSoundChips::EPSM) {
_epsmAudio->Clock();
}
}
@ -358,7 +359,11 @@ void NsfMapper::WriteRegister(uint16_t addr, uint8_t value)
}*/
} else if((_nsfHeader.SoundChips & NsfSoundChips::Sunsoft) && addr >= 0xC000 && addr <= 0xFFFF) {
_sunsoftAudio->WriteRegister(addr, value);
} else {
}
else if ((_nsfHeader.SoundChips & NsfSoundChips::EPSM) && addr >= 0x401C && addr <= 0x401F) {
_epsmAudio->WriteRegister(addr, value);
}
else {
switch(addr) {
case 0x3E10: _irqReloadValue = (_irqReloadValue & 0xFF00) | value; break;
case 0x3E11: _irqReloadValue = (_irqReloadValue & 0xFF) | (value << 8); break;
@ -409,7 +414,7 @@ void NsfMapper::WriteRegister(uint16_t addr, uint8_t value)
break;
case 0x4016:
_epsgAudio->WriteRegister(addr, value);
_epsmAudio->WriteRegister(addr, value);
break;
}
@ -490,7 +495,7 @@ void NsfMapper::StreamState(bool saving)
SnapshotInfo fdsAudio { _fdsAudio.get() };
SnapshotInfo namcoAudio { _namcoAudio.get() };
SnapshotInfo sunsoftAudio { _sunsoftAudio.get() };
SnapshotInfo epsgAudio{ _epsgAudio.get() };
SnapshotInfo epsgAudio{ _epsmAudio.get() };
Stream(
_model, _needInit, _irqEnabled, _irqReloadValue, _irqCounter, _irqStatus, _debugIrqStatus, _mmc5MultiplierValues[0], _mmc5MultiplierValues[1],

View file

@ -6,7 +6,7 @@
#include "FdsAudio.h"
#include "Namco163Audio.h"
#include "Sunsoft5bAudio.h"
#include "EPSGAudio.h"
#include "EPSMAudio.h"
enum class NsfIrqType
{
@ -27,7 +27,8 @@ private:
MMC5 = 0x08,
Namco = 0x10,
Sunsoft = 0x20,
EPSG = 0x40
VT02 = 0x40,
EPSM = 0x80
};
NesModel _model;
@ -39,7 +40,7 @@ private:
unique_ptr<FdsAudio> _fdsAudio;
unique_ptr<Namco163Audio> _namcoAudio;
unique_ptr<Sunsoft5bAudio> _sunsoftAudio;
unique_ptr<EPSGAudio> _epsgAudio;
unique_ptr<EPSMAudio> _epsmAudio;
bool _needInit = false;
bool _irqEnabled = false;

View file

@ -4,8 +4,89 @@
#include "APU.h"
#include "BaseExpansionAudio.h"
#include "Console.h"
#include "emu2149.h"
//#define SSG_USE_OLD_EMU
#ifndef SSG_USE_OLD_EMU
#define SSG_USE_EMU2149
#endif
#ifdef SSG_USE_EMU2149
template<AudioChannel...channels>
class SSGAudio : public BaseExpansionAudio
{
private:
std::unique_ptr<PSG, void(*)(PSG*)> _psg;
uint8_t _currentRegister;
int16_t _lastOutput;
int16_t _currentOutput;
double _clock;
bool _processTick;
static constexpr uint8_t cycleCount = 1;
void UpdateOutputLevel()
{
(_console->GetApu()->AddExpansionAudioDelta(channels, _currentOutput - _lastOutput), ...);
_lastOutput = _currentOutput;
}
protected:
void StreamState(bool saving) override
{
BaseExpansionAudio::StreamState(saving);
ValueInfo<PSG> psg{ _psg.get() };
Stream( _currentRegister, _lastOutput, _clock, psg);
}
void ClockAudio() override
{
_clock += GetSSGClockFrequency() / (double)_console->GetCpu()->GetClockRate(_console->GetModel());
while (_clock >= cycleCount)
{
_currentOutput = 0;
for (uint8_t cycle = 0; cycle < cycleCount; cycle++)
{
_clock--;
_currentOutput = PSG_calc(_psg.get());
}
_currentOutput /= 26;
UpdateOutputLevel();
}
}
virtual uint32_t GetSSGClockFrequency()
{
return _console->GetCpu()->GetClockRate(_console->GetModel()) / 2;
}
public:
SSGAudio(shared_ptr<Console> console) : BaseExpansionAudio(console), _psg{ PSG_new(1 , 1), &PSG_delete }
{
_currentRegister = 0;
_lastOutput = 0;
_clock = 0;
PSG_reset(_psg.get());
}
void WriteRegister(uint16_t addr, uint8_t value)
{
switch (addr) {
case 0xC000:
_currentRegister = value;
break;
case 0xE000:
if (_currentRegister <= 0xF)
PSG_writeReg(_psg.get(), _currentRegister, value);
break;
}
}
};
#else
template<AudioChannel...channels>
class SSGAudio : public BaseExpansionAudio
{
@ -142,4 +223,5 @@ public:
break;
}
}
};
};
#endif

View file

@ -275,8 +275,8 @@ int16_t SoundMixer::GetOutputVolume(bool forRightChannel)
#else
GetChannelOutput(AudioChannel::VRC7, forRightChannel) +
#endif
GetChannelOutput(AudioChannel::EPSG_L, forRightChannel) * 4 +
GetChannelOutput(AudioChannel::EPSG_R, forRightChannel) * 4
GetChannelOutput(AudioChannel::EPSM_L, forRightChannel) * 4 +
GetChannelOutput(AudioChannel::EPSM_R, forRightChannel) * 4
);
}

View file

@ -8,18 +8,18 @@
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.
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
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 <stdio.h>
@ -29,347 +29,354 @@
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}
0x0B, 0x0D, 0x0F, 0x12,
0x16, 0x1A, 0x1F, 0x25, 0x2D, 0x35, 0x3F, 0x4C, 0x5A, 0x6A, 0x7F, 0x97,
0xB4, 0xD6, 0xFF, 0xFF},
{0x00, 0x00, 0x03, 0x03, 0x04, 0x04, 0x06, 0x06, 0x09, 0x09, 0x0D, 0x0D,
0x12, 0x12, 0x1D, 0x1D,
0x22, 0x22, 0x37, 0x37, 0x4D, 0x4D, 0x62, 0x62, 0x82, 0x82, 0xA6, 0xA6,
0xD0, 0xD0, 0xFF, 0xFF}
};
static uint8_t regmsk[16] = {
0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0x1f, 0x3f,
0x1f, 0x1f, 0x1f, 0xff, 0xff, 0x0f, 0xff, 0xff
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)
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));
}
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 / 8));
psg->psgtime = 0;
}
else
{
psg->base_incr =
(uint32_t)((double)psg->clk * (1 << GETA_BITS) / (8 * psg->rate));
}
}
void
PSG_set_rate (PSG * psg, uint32_t r)
PSG_set_clock(PSG* psg, uint32_t c)
{
psg->rate = r ? r : 44100;
internal_refresh (psg);
psg->clk = c;
internal_refresh(psg);
}
void
PSG_set_quality (PSG * psg, uint32_t q)
PSG_set_rate(PSG* psg, uint32_t r)
{
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;
psg->rate = r ? r : 44100;
internal_refresh(psg);
}
void
PSG_setVolumeMode (PSG * psg, int type)
PSG_set_quality(PSG* psg, uint32_t q)
{
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;
}
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)
PSG_setMask(PSG* psg, uint32_t mask)
{
uint32_t ret = 0;
if(psg)
{
ret = psg->mask;
psg->mask = mask;
}
return ret;
uint32_t ret = 0;
if (psg)
{
ret = psg->mask;
psg->mask = mask;
}
return ret;
}
uint32_t
PSG_toggleMask (PSG *psg, uint32_t mask)
PSG_toggleMask(PSG* psg, uint32_t mask)
{
uint32_t ret = 0;
if(psg)
{
ret = psg->mask;
psg->mask ^= mask;
}
return ret;
uint32_t ret = 0;
if (psg)
{
ret = psg->mask;
psg->mask ^= mask;
}
return ret;
}
void
PSG_reset (PSG * psg)
PSG_reset(PSG* psg)
{
int i;
int i;
psg->base_count = 0;
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;
}
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;
psg->mask = 0;
for (i = 0; i < 16; i++)
psg->reg[i] = 0;
psg->adr = 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->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->env_volume = 0;
psg->env_ptr = 0;
psg->env_freq = 0;
psg->env_count = 0;
psg->env_pause = 1;
psg->out = 0;
psg->out = 0;
}
void
PSG_delete (PSG * psg)
PSG_delete(PSG* psg)
{
free (psg);
free(psg);
}
uint8_t
PSG_readIO (PSG * psg)
PSG_readIO(PSG* psg)
{
return (uint8_t) (psg->reg[psg->adr]);
return (uint8_t)(psg->reg[psg->adr]);
}
uint8_t
PSG_readReg (PSG * psg, uint32_t reg)
PSG_readReg(PSG* psg, uint32_t reg)
{
return (uint8_t) (psg->reg[reg & 0x1f]);
return (uint8_t)(psg->reg[reg & 0x1f]);
}
void
PSG_writeIO (PSG * psg, uint32_t adr, uint32_t val)
PSG_writeIO(PSG* psg, uint32_t adr, uint32_t val)
{
if (adr & 1)
PSG_writeReg (psg, psg->adr, val);
else
psg->adr = val & 0x1f;
if (adr & 1)
PSG_writeReg(psg, psg->adr, val);
else
psg->adr = val & 0x1f;
}
static inline void
update_output (PSG * psg)
update_output(PSG* psg)
{
int i, noise;
uint32_t incr;
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;
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;
}
/* 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;
}
}
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;
}
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;
/* 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;
}
}
/* 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->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);
}
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;
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]);
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)
PSG_calc(PSG* psg)
{
if (!psg->quality) {
update_output(psg);
return mix_output(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;
/* 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);
return mix_output(psg);
}
void
PSG_writeReg (PSG * psg, uint32_t reg, uint32_t val)
PSG_writeReg(PSG* psg, uint32_t reg, uint32_t val)
{
int c;
int c;
if (reg > 15) return;
if (reg > 15) return;
val &= regmsk[reg];
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;
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 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 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 8:
case 9:
case 10:
psg->volume[reg - 8] = val << 1;
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 11:
case 12:
psg->env_freq = (psg->reg[12] << 8) + psg->reg[11];
break;
case 14:
case 15:
default:
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;
return;
case 14:
case 15:
default:
break;
}
return;
}

View file

@ -15,74 +15,75 @@ extern "C"
{
#endif
typedef struct __PSG
{
typedef struct __PSG
{
/* Volume Table */
uint32_t *voltbl;
/* Volume Table */
uint32_t* voltbl;
uint8_t reg[0x20];
int32_t out;
uint8_t reg[0x20];
int32_t out;
uint32_t clk, rate, base_incr, quality;
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 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 base_count;
uint32_t env_volume;
uint32_t env_ptr;
uint32_t env_face;
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_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 env_freq;
uint32_t env_count;
uint32_t noise_seed;
uint32_t noise_count;
uint32_t noise_freq;
uint32_t noise_seed;
uint32_t noise_count;
uint32_t noise_freq;
/* rate converter */
uint32_t realstep;
uint32_t psgtime;
uint32_t psgstep;
/* rate converter */
uint32_t realstep;
uint32_t psgtime;
uint32_t psgstep;
/* I/O Ctrl */
uint32_t adr;
/* I/O Ctrl */
uint32_t adr;
/* output of channels */
int16_t ch_out[3];
/* output of channels */
int16_t ch_out[3];
} PSG;
} PSG;
void PSG_set_quality(PSG* psg, uint32_t q);
void PSG_set_clock(PSG* psg, uint32_t c);
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);
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
#endif

View file

@ -6,7 +6,7 @@ namespace Mesen.GUI.Config
{
public string AudioDevice = "";
public bool EnableAudio = true;
public bool EnableEPSG = true;
public bool EnableEPSM = true;
public bool DisableDynamicSampleRate = false;
@ -24,10 +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(0, 100)] public UInt32 EPSMVolume_L = 50;
[MinMax(0, 100)] public UInt32 EPSMVolume_R = 50;
[MinMax(10000, 32000000)] public UInt32 EPSGClockFrequency = 3579545;
[MinMax(10000, 32000000)] public UInt32 EPSMClockFrequency = 3579545;
[MinMax(-100, 100)] public Int32 Square1Panning = 0;
[MinMax(-100, 100)] public Int32 Square2Panning = 0;
@ -40,8 +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;
[MinMax(-100, 100)] public Int32 EPSMPanning_L = -100;
[MinMax(-100, 100)] public Int32 EPSMPanning_R = 100;
[ValidValues(11025, 22050, 44100, 48000, 96000)] public UInt32 SampleRate = 48000;
public bool ReduceSoundInBackground = true;
@ -121,10 +121,10 @@ 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.SetChannelVolume(AudioChannel.EPSG_L, audioInfo.EnableEPSG ? AudioInfo.ConvertVolume(audioInfo.EPSGVolume_L) : 0);
InteropEmu.SetChannelVolume(AudioChannel.EPSG_R, audioInfo.EnableEPSG ? AudioInfo.ConvertVolume(audioInfo.EPSGVolume_R) : 0);
InteropEmu.SetChannelVolume(AudioChannel.EPSM_L, ConvertVolume(audioInfo.EPSMVolume_L));
InteropEmu.SetChannelVolume(AudioChannel.EPSM_R, ConvertVolume(audioInfo.EPSMVolume_R));
InteropEmu.SetChannelVolume(AudioChannel.EPSM_L, audioInfo.EnableEPSM ? AudioInfo.ConvertVolume(audioInfo.EPSMVolume_L) : 0);
InteropEmu.SetChannelVolume(AudioChannel.EPSM_R, audioInfo.EnableEPSM ? AudioInfo.ConvertVolume(audioInfo.EPSMVolume_R) : 0);
InteropEmu.SetChannelPanning(AudioChannel.Square1, ConvertPanning(audioInfo.Square1Panning));
InteropEmu.SetChannelPanning(AudioChannel.Square2, ConvertPanning(audioInfo.Square2Panning));
@ -137,10 +137,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.SetChannelPanning(AudioChannel.EPSM_L, ConvertPanning(audioInfo.EPSMPanning_L));
InteropEmu.SetChannelPanning(AudioChannel.EPSM_R, ConvertPanning(audioInfo.EPSMPanning_R));
InteropEmu.SetEPSGClockFrequency(audioInfo.EPSGClockFrequency);
InteropEmu.SetEPSMClockFrequency(audioInfo.EPSMClockFrequency);
InteropEmu.SetEqualizerFilterType(audioInfo.EnableEqualizer ? audioInfo.EqualizerFilterType : EqualizerFilterType.None);

View file

@ -46,7 +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.lblEpsm = 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();
@ -268,7 +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.Controls.Add(this.lblEpsm, 6, 0);
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel3.Location = new System.Drawing.Point(101, 66);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
@ -357,18 +357,18 @@
this.lblVrc7.TabIndex = 3;
this.lblVrc7.Text = "VRC7";
//
// lblEpsg
// lblEpsm
//
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";
this.lblEpsm.AutoSize = true;
this.lblEpsm.BackColor = System.Drawing.Color.Transparent;
this.lblEpsm.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblEpsm.ForeColor = System.Drawing.Color.White;
this.lblEpsm.Location = new System.Drawing.Point(220, 0);
this.lblEpsm.Margin = new System.Windows.Forms.Padding(0);
this.lblEpsm.Name = "lblEpsm";
this.lblEpsm.Size = new System.Drawing.Size(35, 13);
this.lblEpsm.TabIndex = 3;
this.lblEpsm.Text = "EPSM";
//
// lblSoundChips
//
@ -743,7 +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 lblEpsm;
private System.Windows.Forms.Label lblMmc5;
private System.Windows.Forms.Label lblNamco;
private System.Windows.Forms.Label lblFds;

View file

@ -274,7 +274,7 @@ 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;
lblEpsm.ForeColor = (header.SoundChips & 0x80) == 0x80 ? Color.White : Color.Gray;
if (InteropEmu.IsPaused()) {
btnPause.Image = Properties.Resources.Play;

View file

@ -41,7 +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.chkEPSM = 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();
@ -119,7 +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.chkEPSM, 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);
@ -273,19 +273,19 @@
this.chkSunsoft.UseVisualStyleBackColor = true;
this.chkSunsoft.CheckedChanged += new System.EventHandler(this.chkSoundChannel_CheckedChanged);
//
// chkEPSG
// chkEPSM
//
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);
this.chkEPSM.AutoSize = true;
this.chkEPSM.Checked = true;
this.chkEPSM.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkEPSM.Location = new System.Drawing.Point(99, 80);
this.chkEPSM.Margin = new System.Windows.Forms.Padding(3, 0, 3, 3);
this.chkEPSM.Name = "chkEPSM";
this.chkEPSM.Size = new System.Drawing.Size(78, 17);
this.chkEPSM.TabIndex = 10;
this.chkEPSM.Text = "EPSM";
this.chkEPSM.UseVisualStyleBackColor = true;
this.chkEPSM.CheckedChanged += new System.EventHandler(this.chkSoundChannel_CheckedChanged);
//
// chkVrc6
//
@ -475,6 +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;
private System.Windows.Forms.CheckBox chkEPSM;
}
}

View file

@ -68,8 +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);
InteropEmu.SetChannelVolume(AudioChannel.EPSM_L, chkEPSM.Checked ? AudioInfo.ConvertVolume(audioInfo.EPSMVolume_L) : 0);
InteropEmu.SetChannelVolume(AudioChannel.EPSM_R, chkEPSM.Checked ? AudioInfo.ConvertVolume(audioInfo.EPSMVolume_R) : 0);
}
}
}

View file

@ -43,12 +43,12 @@ namespace Mesen.GUI.Forms.Config
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.trkEPSMVol_L = new Mesen.GUI.Controls.ctrlTrackbar();
this.trkEPSMVol_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.chkEnableEPSM = 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();
@ -81,8 +81,8 @@ namespace Mesen.GUI.Forms.Config
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.trkEPSMPan_L = new Mesen.GUI.Controls.ctrlHorizontalTrackbar();
this.trkEPSMPan_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();
@ -147,8 +147,8 @@ namespace Mesen.GUI.Forms.Config
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.nudEPSMClockFrequency = new Mesen.GUI.Controls.MesenNumericUpDown();
this.lblEPSMClockFrequency = 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();
@ -223,8 +223,8 @@ namespace Mesen.GUI.Forms.Config
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.Controls.Add(this.trkEPSMVol_L, 5, 1);
this.tableLayoutPanel1.Controls.Add(this.trkEPSMVol_R, 6, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 16);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
@ -415,35 +415,35 @@ namespace Mesen.GUI.Forms.Config
this.trkSunsoft5b.Text = "Sunsoft";
this.trkSunsoft5b.Value = 50;
//
// trkEPSGVol_L
// trkEPSMVol_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;
this.trkEPSMVol_L.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.trkEPSMVol_L.Location = new System.Drawing.Point(364, 160);
this.trkEPSMVol_L.Margin = new System.Windows.Forms.Padding(0);
this.trkEPSMVol_L.Maximum = 100;
this.trkEPSMVol_L.MaximumSize = new System.Drawing.Size(63, 160);
this.trkEPSMVol_L.Minimum = 0;
this.trkEPSMVol_L.MinimumSize = new System.Drawing.Size(63, 160);
this.trkEPSMVol_L.Name = "trkEPSMVol_L";
this.trkEPSMVol_L.Size = new System.Drawing.Size(63, 160);
this.trkEPSMVol_L.TabIndex = 22;
this.trkEPSMVol_L.Text = "EPSM Left";
this.trkEPSMVol_L.Value = 100;
//
// trkEPSGVol_R
// trkEPSMVol_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;
this.trkEPSMVol_R.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.trkEPSMVol_R.Location = new System.Drawing.Point(432, 160);
this.trkEPSMVol_R.Margin = new System.Windows.Forms.Padding(0);
this.trkEPSMVol_R.Maximum = 100;
this.trkEPSMVol_R.MaximumSize = new System.Drawing.Size(63, 160);
this.trkEPSMVol_R.Minimum = 0;
this.trkEPSMVol_R.MinimumSize = new System.Drawing.Size(63, 160);
this.trkEPSMVol_R.Name = "trkEPSMVol_R";
this.trkEPSMVol_R.Size = new System.Drawing.Size(63, 160);
this.trkEPSMVol_R.TabIndex = 22;
this.trkEPSMVol_R.Text = "EPSM Right";
this.trkEPSMVol_R.Value = 100;
//
// tableLayoutPanel2
//
@ -451,7 +451,7 @@ namespace Mesen.GUI.Forms.Config
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.chkEnableEPSM, 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);
@ -502,17 +502,17 @@ namespace Mesen.GUI.Forms.Config
this.chkEnableAudio.Text = "Enable Audio";
this.chkEnableAudio.UseVisualStyleBackColor = true;
//
// chkEnableEPSG
// chkEnableEPSM
//
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;
this.chkEnableEPSM.AutoSize = true;
this.tableLayoutPanel2.SetColumnSpan(this.chkEnableEPSM, 2);
this.chkEnableEPSM.Location = new System.Drawing.Point(6, 6);
this.chkEnableEPSM.Margin = new System.Windows.Forms.Padding(6, 6, 6, 3);
this.chkEnableEPSM.Name = "chkEnableEPSM";
this.chkEnableEPSM.Size = new System.Drawing.Size(91, 17);
this.chkEnableEPSM.TabIndex = 3;
this.chkEnableEPSM.Text = "Enable EPSM";
this.chkEnableEPSM.UseVisualStyleBackColor = true;
//
// lblSampleRate
//
@ -802,8 +802,8 @@ namespace Mesen.GUI.Forms.Config
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.Controls.Add(this.trkEPSMPan_L, 0, 5);
this.tableLayoutPanel6.Controls.Add(this.trkEPSMPan_R, 1, 5);
this.tableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel6.Location = new System.Drawing.Point(3, 3);
this.tableLayoutPanel6.Name = "tableLayoutPanel6";
@ -984,35 +984,35 @@ namespace Mesen.GUI.Forms.Config
this.trkSunsoftPan.Text = "Sunsoft";
this.trkSunsoftPan.Value = 0;
//
// trkEPSGPan_L
// trkEPSMPan_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;
this.trkEPSMPan_L.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.trkEPSMPan_L.Location = new System.Drawing.Point(12, 275);
this.trkEPSMPan_L.Margin = new System.Windows.Forms.Padding(0);
this.trkEPSMPan_L.Maximum = 100;
this.trkEPSMPan_L.MaximumSize = new System.Drawing.Size(63, 160);
this.trkEPSMPan_L.Minimum = -100;
this.trkEPSMPan_L.MinimumSize = new System.Drawing.Size(206, 55);
this.trkEPSMPan_L.Name = "trkEPSMPan_L";
this.trkEPSMPan_L.Size = new System.Drawing.Size(206, 55);
this.trkEPSMPan_L.TabIndex = 22;
this.trkEPSMPan_L.Text = "EPSM Left";
this.trkEPSMPan_L.Value = -100;
//
// trkEPSGPan_R
// trkEPSMPan_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;
this.trkEPSMPan_R.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.trkEPSMPan_R.Location = new System.Drawing.Point(244, 275);
this.trkEPSMPan_R.Margin = new System.Windows.Forms.Padding(0);
this.trkEPSMPan_R.Maximum = 100;
this.trkEPSMPan_R.MaximumSize = new System.Drawing.Size(63, 160);
this.trkEPSMPan_R.Minimum = -100;
this.trkEPSMPan_R.MinimumSize = new System.Drawing.Size(206, 55);
this.trkEPSMPan_R.Name = "trkEPSMPan_R";
this.trkEPSMPan_R.Size = new System.Drawing.Size(206, 55);
this.trkEPSMPan_R.TabIndex = 22;
this.trkEPSMPan_R.Text = "EPSM Right";
this.trkEPSMPan_R.Value = 100;
//
// tpgEqualizer
//
@ -1988,8 +1988,8 @@ namespace Mesen.GUI.Forms.Config
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.nudEPSMClockFrequency, 0, 5);
this.tableLayoutPanel3.Controls.Add(this.lblEPSMClockFrequency, 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);
@ -2027,47 +2027,47 @@ namespace Mesen.GUI.Forms.Config
this.chkDisableNoiseModeFlag.TabIndex = 3;
this.chkDisableNoiseModeFlag.Text = "Disable noise channel mode flag";
//
// nudEPSGClockFrequency
// nudEPSMClockFrequency
//
this.nudEPSGClockFrequency.DecimalPlaces = 0;
this.nudEPSGClockFrequency.Dock = System.Windows.Forms.DockStyle.Fill;
this.nudEPSGClockFrequency.Increment = new decimal(new int[] {
this.nudEPSMClockFrequency.DecimalPlaces = 0;
this.nudEPSMClockFrequency.Dock = System.Windows.Forms.DockStyle.Fill;
this.nudEPSMClockFrequency.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[] {
this.nudEPSMClockFrequency.IsHex = false;
this.nudEPSMClockFrequency.Location = new System.Drawing.Point(3, 147);
this.nudEPSMClockFrequency.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[] {
this.nudEPSMClockFrequency.MaximumSize = new System.Drawing.Size(10000, 20);
this.nudEPSMClockFrequency.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[] {
this.nudEPSMClockFrequency.MinimumSize = new System.Drawing.Size(200, 21);
this.nudEPSMClockFrequency.Name = "nudEPSMClockFrequency";
this.nudEPSMClockFrequency.Size = new System.Drawing.Size(457, 21);
this.nudEPSMClockFrequency.TabIndex = 3;
this.nudEPSMClockFrequency.Value = new decimal(new int[] {
10000,
0,
0,
0});
//
// lblEPSGClockFrequency
// lblEPSMClockFrequency
//
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)";
this.lblEPSMClockFrequency.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.lblEPSMClockFrequency.AutoSize = true;
this.lblEPSMClockFrequency.Location = new System.Drawing.Point(3, 125);
this.lblEPSMClockFrequency.Name = "lblEPSMClockFrequency";
this.lblEPSMClockFrequency.Size = new System.Drawing.Size(228, 13);
this.lblEPSMClockFrequency.TabIndex = 3;
this.lblEPSMClockFrequency.Text = "EPSM Clock Frequency (default is 3579545Hz)";
//
// chkSilenceTriangleHighFreq
//
@ -2166,7 +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.CheckBox chkEnableEPSM;
private System.Windows.Forms.Label lblAudioLatency;
private MesenNumericUpDown nudLatency;
private System.Windows.Forms.Label lblLatencyMs;
@ -2188,8 +2188,8 @@ namespace Mesen.GUI.Forms.Config
private Controls.ctrlTrackbar trkVrc7Vol;
private Controls.ctrlTrackbar trkNamco163Vol;
private Controls.ctrlTrackbar trkSunsoft5b;
private Controls.ctrlTrackbar trkEPSGVol_L;
private Controls.ctrlTrackbar trkEPSGVol_R;
private Controls.ctrlTrackbar trkEPSMVol_L;
private Controls.ctrlTrackbar trkEPSMVol_R;
private System.Windows.Forms.TabControl tabMain;
private System.Windows.Forms.TabPage tpgGeneral;
private System.Windows.Forms.TabPage tpgVolume;
@ -2230,8 +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 trkEPSMPan_L;
private Controls.ctrlHorizontalTrackbar trkEPSMPan_R;
private Controls.ctrlHorizontalTrackbar trkSquare1Pan;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel5;
private System.Windows.Forms.CheckBox chkCrossFeedEnabled;
@ -2239,8 +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 MesenNumericUpDown nudEPSMClockFrequency;
private System.Windows.Forms.Label lblEPSMClockFrequency;
private System.Windows.Forms.TabPage tpgEqualizer;
private System.Windows.Forms.TableLayoutPanel tlpEqualizer;
private ctrlTrackbar trkBand6Gain;

View file

@ -31,7 +31,7 @@ namespace Mesen.GUI.Forms.Config
cboAudioDevice.Items.AddRange(InteropEmu.GetAudioDevices().ToArray());
AddBinding("EnableAudio", chkEnableAudio);
AddBinding("EnableEPSG", chkEnableEPSG);
AddBinding("EnableEPSM", chkEnableEPSM);
AddBinding("MasterVolume", trkMaster);
AddBinding("Square1Volume", trkSquare1Vol);
AddBinding("Square2Volume", trkSquare2Vol);
@ -44,8 +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("EPSMVolume_L", trkEPSMVol_L);
AddBinding("EPSMVolume_R", trkEPSMVol_R);
AddBinding("Square1Panning", trkSquare1Pan);
AddBinding("Square2Panning", trkSquare2Pan);
@ -58,10 +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("EPSMPanning_L", trkEPSMPan_L);
AddBinding("EPSMPanning_R", trkEPSMPan_R);
AddBinding("EPSGClockFrequency", nudEPSGClockFrequency);
AddBinding("EPSMClockFrequency", nudEPSMClockFrequency);
AddBinding("AudioLatency", nudLatency);
AddBinding("SampleRate", cboSampleRate);

File diff suppressed because it is too large Load diff

View file

@ -208,7 +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 SetEPSMClockFrequency(UInt32 clockFrequency);
[DllImport(DLLPath)] public static extern void SetAudioFilterSettings(AudioFilterSettings settings);
[DllImport(DLLPath)] public static extern void SetRunAheadFrames(UInt32 frameCount);
@ -2302,8 +2302,8 @@ namespace Mesen.GUI
VRC7 = 8,
Namco163 = 9,
Sunsoft5B = 10,
EPSG_L = 11,
EPSG_R= 12
EPSM_L = 11,
EPSM_R= 12
}
public enum EqualizerFilterType

View file

@ -633,7 +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 SetEPSMClockFrequency(uint32_t clockFrequency) { _settings->SetEPSMClockFrequency(clockFrequency); }
DllExport void __stdcall SetAudioFilterSettings(AudioFilterSettings settings) { _settings->SetAudioFilterSettings(settings); }
DllExport void __stdcall SetRunAheadFrames(uint32_t frameCount) { _settings->SetRunAheadFrames(frameCount); }