From d9143e93979e9531d64f9b5067f7e3fed5f78d0e Mon Sep 17 00:00:00 2001 From: Teuthida255 <33849310+Teuthida255@users.noreply.github.com> Date: Fri, 21 Jun 2019 14:45:06 -0700 Subject: [PATCH 1/2] Fixed 5B Instrument Recording --- Source/InstrumentRecorder.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/InstrumentRecorder.cpp b/Source/InstrumentRecorder.cpp index 10ab9c1f..54cd4766 100644 --- a/Source/InstrumentRecorder.cpp +++ b/Source/InstrumentRecorder.cpp @@ -216,7 +216,8 @@ void CInstrumentRecorder::RecordInstrument(const unsigned Tick, CView *pView) / } break; case SNDCHIP_S5B: - Val = 0x1F & REG(0x06) | (0x10 & REG(0x08 + ID)) << 1 + //0x1F accounts for inverted noise period value + Val = 0x1F & (0x1F - REG(0x06)) | (0x10 & REG(0x08 + ID)) << 1 | (0x01 << ID & ~REG(0x07)) << (6 - ID) | (0x08 << ID & ~REG(0x07)) << (4 - ID); break; } break; @@ -404,4 +405,4 @@ void CInstrumentRecorder::FinalizeRecordInstrument() N163Inst->SetSample(0, j, 0); break; } -} \ No newline at end of file +} From bd238581a74dcee8ca39e75cda721148136c5ac8 Mon Sep 17 00:00:00 2001 From: jimbo1qaz Date: Thu, 27 Jun 2019 21:08:13 -0700 Subject: [PATCH 2/2] Fix math? --- Source/InstrumentRecorder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/InstrumentRecorder.cpp b/Source/InstrumentRecorder.cpp index 54cd4766..6faa2170 100644 --- a/Source/InstrumentRecorder.cpp +++ b/Source/InstrumentRecorder.cpp @@ -217,7 +217,7 @@ void CInstrumentRecorder::RecordInstrument(const unsigned Tick, CView *pView) / break; case SNDCHIP_S5B: //0x1F accounts for inverted noise period value - Val = 0x1F & (0x1F - REG(0x06)) | (0x10 & REG(0x08 + ID)) << 1 + Val = 0x1F - (0x1F & REG(0x06)) | (0x10 & REG(0x08 + ID)) << 1 | (0x01 << ID & ~REG(0x07)) << (6 - ID) | (0x08 << ID & ~REG(0x07)) << (4 - ID); break; } break;