From a7dfe6534d0930ba0f014ad1bff243ce06939d23 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 28 Nov 2022 01:27:58 -0500 Subject: [PATCH] SN: address easy noise feedback, part 1 --- src/engine/platform/sms.cpp | 5 +++-- src/engine/platform/sms.h | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/engine/platform/sms.cpp b/src/engine/platform/sms.cpp index d3085c19..7a9d53bc 100644 --- a/src/engine/platform/sms.cpp +++ b/src/engine/platform/sms.cpp @@ -126,14 +126,14 @@ double DivPlatformSMS::NOTE_SN(int ch, int note) { return NOTE_PERIODIC(note); } if (note>easyThreshold) { - return MAX(0,8-easyThreshold); + return MAX(0,easyStartingPeriod-easyThreshold); } return NOTE_PERIODIC(note); } int DivPlatformSMS::snCalcFreq(int ch) { if (parent->song.linearPitch==2 && easyNoise && chan[ch].baseFreq+chan[ch].pitch+chan[ch].pitch2>(easyThreshold<<7)) { - int ret=(0x440-(chan[ch].baseFreq+chan[ch].pitch+chan[ch].pitch2-(easyThreshold<<7)))>>7; + int ret=(((easyStartingPeriod<<7)+0x40)-(chan[ch].baseFreq+chan[ch].pitch+chan[ch].pitch2-(easyThreshold<<7)))>>7; if (ret<0) ret=0; return ret; } @@ -489,6 +489,7 @@ void DivPlatformSMS::setFlags(const DivConfig& flags) { default: chipClock=COLOR_NTSC; easyThreshold=92; + easyStartingPeriod=8; break; } resetPhase=!flags.getBool("noPhaseReset",false); diff --git a/src/engine/platform/sms.h b/src/engine/platform/sms.h index 32c18193..ce3ee5e7 100644 --- a/src/engine/platform/sms.h +++ b/src/engine/platform/sms.h @@ -66,6 +66,7 @@ class DivPlatformSMS: public DivDispatch { double toneDivider=64.0; double noiseDivider=64.0; int easyThreshold; + int easyStartingPeriod; bool updateSNMode; bool resetPhase; bool isRealSN;