From 9bea4c87ee7503f325ac430e951c2d422063f19e Mon Sep 17 00:00:00 2001 From: Perkka2 <36314461+Perkka2@users.noreply.github.com> Date: Thu, 18 Mar 2021 14:39:29 +0100 Subject: [PATCH 1/3] Adjusted volume levels for EPSG FM/SSG --- Core/EPSGAudio.h | 2 +- Core/SoundMixer.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/EPSGAudio.h b/Core/EPSGAudio.h index 6955a077..f263de39 100644 --- a/Core/EPSGAudio.h +++ b/Core/EPSGAudio.h @@ -123,7 +123,7 @@ protected: for (uint8_t x = 0; x < 2; x++) { - _currentOutputs[x] /= 12; + _currentOutputs[x] /= 5; } UpdateOutputLevel(); diff --git a/Core/SoundMixer.cpp b/Core/SoundMixer.cpp index 95313274..d59e0054 100644 --- a/Core/SoundMixer.cpp +++ b/Core/SoundMixer.cpp @@ -275,8 +275,8 @@ int16_t SoundMixer::GetOutputVolume(bool forRightChannel) #else GetChannelOutput(AudioChannel::VRC7, forRightChannel) + #endif - GetChannelOutput(AudioChannel::EPSG_L, forRightChannel) * 15 + - GetChannelOutput(AudioChannel::EPSG_R, forRightChannel) * 15 + GetChannelOutput(AudioChannel::EPSG_L, forRightChannel) * 4 + + GetChannelOutput(AudioChannel::EPSG_R, forRightChannel) * 4 ); } From 2833b0ab4bc942f9a7001449709d94ffc939cb70 Mon Sep 17 00:00:00 2001 From: Perkka2 <36314461+Perkka2@users.noreply.github.com> Date: Thu, 18 Mar 2021 20:09:54 +0100 Subject: [PATCH 2/3] Made "Enable EPSG" checkbox to actually enable/disable EPSG Audio --- GUI.NET/Config/AudioInfo.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GUI.NET/Config/AudioInfo.cs b/GUI.NET/Config/AudioInfo.cs index 1f650814..5a01f31f 100644 --- a/GUI.NET/Config/AudioInfo.cs +++ b/GUI.NET/Config/AudioInfo.cs @@ -123,6 +123,8 @@ namespace Mesen.GUI.Config 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.SetChannelPanning(AudioChannel.Square1, ConvertPanning(audioInfo.Square1Panning)); InteropEmu.SetChannelPanning(AudioChannel.Square2, ConvertPanning(audioInfo.Square2Panning)); From 0fb4d34c3f910734c9ecc9b14bcafde95ea6c9b0 Mon Sep 17 00:00:00 2001 From: Perkka2 <36314461+Perkka2@users.noreply.github.com> Date: Fri, 19 Mar 2021 15:16:36 +0100 Subject: [PATCH 3/3] EPSG $4016 addressing now only writes on odd CPU cycles --- Core/BaseMapper.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/BaseMapper.cpp b/Core/BaseMapper.cpp index 125394e9..7c70505d 100644 --- a/Core/BaseMapper.cpp +++ b/Core/BaseMapper.cpp @@ -11,6 +11,7 @@ #include "BatteryManager.h" #include "MessageManager.h" #include "EmulationSettings.h" +#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); } @@ -781,7 +782,7 @@ uint8_t BaseMapper::DebugReadRAM(uint16_t addr) void BaseMapper::WriteRAM(uint16_t addr, uint8_t value) { - if(addr == 0x4016){ WriteEPSG(addr, value); } + if((addr == 0x4016) & (_console->GetCpu()->GetCycleCount() % 2 == 1)){ WriteEPSG(addr, value); } if(_isWriteRegisterAddr[addr]) { if(_hasBusConflicts) { uint8_t prgValue = _prgPages[addr >> 8][(uint8_t)addr];