From 84437bf0e3a8b52ed2a7ed2495a667c68b910fa6 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Wed, 24 Apr 2024 00:34:15 -0500 Subject: [PATCH] the chips that still do not have sample offset - Lynx - MMC5 - NES - PCE - QSound - SegaPCM - Swan - VERA - VRC6 - X1-010 --- src/engine/platform/lynx.h | 3 ++- src/engine/platform/mmc5.h | 5 +++-- src/engine/platform/nes.h | 5 +++-- src/engine/platform/pce.h | 3 ++- src/engine/platform/qsound.h | 5 +++-- src/engine/platform/segapcm.h | 3 ++- src/engine/platform/swan.cpp | 1 + src/engine/platform/swan.h | 2 +- src/engine/platform/vera.h | 4 ++-- src/engine/platform/vrc6.h | 5 +++-- src/engine/platform/x1_010.h | 5 +++-- 11 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/engine/platform/lynx.h b/src/engine/platform/lynx.h index c796126fc..e7dbfc8be 100644 --- a/src/engine/platform/lynx.h +++ b/src/engine/platform/lynx.h @@ -45,7 +45,7 @@ class DivPlatformLynx: public DivDispatch { MikeyDuty duty; int actualNote, lfsr, sample, samplePos, sampleAccum, sampleBaseFreq, sampleFreq; unsigned char pan; - bool pcm; + bool pcm, setPos; int macroVolMul; Channel(): SharedChannel(127), @@ -60,6 +60,7 @@ class DivPlatformLynx: public DivDispatch { sampleFreq(0), pan(0xff), pcm(false), + setPos(false), macroVolMul(127) {} }; Channel chan[4]; diff --git a/src/engine/platform/mmc5.h b/src/engine/platform/mmc5.h index 1f95d6161..fc90f0150 100644 --- a/src/engine/platform/mmc5.h +++ b/src/engine/platform/mmc5.h @@ -26,14 +26,15 @@ class DivPlatformMMC5: public DivDispatch { struct Channel: public SharedChannel { int prevFreq; unsigned char duty, sweep; - bool sweepChanged, furnaceDac; + bool sweepChanged, furnaceDac, setPos; Channel(): SharedChannel(15), prevFreq(65535), duty(0), sweep(8), sweepChanged(false), - furnaceDac(false) {} + furnaceDac(false), + setPos(false) {} }; Channel chan[5]; DivDispatchOscBuffer* oscBuf[3]; diff --git a/src/engine/platform/nes.h b/src/engine/platform/nes.h index 470ab7719..d3b47f02c 100644 --- a/src/engine/platform/nes.h +++ b/src/engine/platform/nes.h @@ -29,7 +29,7 @@ class DivPlatformNES: public DivDispatch { struct Channel: public SharedChannel { int prevFreq; unsigned char duty, sweep, envMode, len; - bool sweepChanged, furnaceDac; + bool sweepChanged, furnaceDac, setPos; Channel(): SharedChannel(15), prevFreq(65535), @@ -38,7 +38,8 @@ class DivPlatformNES: public DivDispatch { envMode(3), len(0x1f), sweepChanged(false), - furnaceDac(false) {} + furnaceDac(false), + setPos(false) {} }; Channel chan[5]; DivDispatchOscBuffer* oscBuf[5]; diff --git a/src/engine/platform/pce.h b/src/engine/platform/pce.h index 61bffddaf..18ce23331 100644 --- a/src/engine/platform/pce.h +++ b/src/engine/platform/pce.h @@ -32,7 +32,7 @@ class DivPlatformPCE: public DivDispatch { unsigned int dacPos; int dacSample; unsigned char pan; - bool noise, pcm, furnaceDac, deferredWaveUpdate; + bool noise, pcm, furnaceDac, deferredWaveUpdate, setPos; signed short wave; int macroVolMul, noiseSeek; DivWaveSynth ws; @@ -50,6 +50,7 @@ class DivPlatformPCE: public DivDispatch { pcm(false), furnaceDac(false), deferredWaveUpdate(false), + setPos(false), wave(-1), macroVolMul(31), noiseSeek(0) {} diff --git a/src/engine/platform/qsound.h b/src/engine/platform/qsound.h index 3d817606a..be797bf77 100644 --- a/src/engine/platform/qsound.h +++ b/src/engine/platform/qsound.h @@ -29,7 +29,7 @@ class DivPlatformQSound: public DivDispatch { int sample, wave; int panning; int echo; - bool useWave, surround, isNewQSound; + bool useWave, surround, isNewQSound, setPos; Channel(): SharedChannel(255), resVol(4095), @@ -39,7 +39,8 @@ class DivPlatformQSound: public DivDispatch { echo(0), useWave(false), surround(true), - isNewQSound(false) {} + isNewQSound(false), + setPos(false) {} }; Channel chan[19]; DivDispatchOscBuffer* oscBuf[19]; diff --git a/src/engine/platform/segapcm.h b/src/engine/platform/segapcm.h index 1c117c266..2e67ad945 100644 --- a/src/engine/platform/segapcm.h +++ b/src/engine/platform/segapcm.h @@ -28,7 +28,7 @@ class DivPlatformSegaPCM: public DivDispatch { protected: struct Channel: public SharedChannel { - bool furnacePCM, isNewSegaPCM; + bool furnacePCM, isNewSegaPCM, setPos; unsigned char chVolL, chVolR; unsigned char chPanL, chPanR; int macroVolMul; @@ -44,6 +44,7 @@ class DivPlatformSegaPCM: public DivDispatch { SharedChannel(127), furnacePCM(false), isNewSegaPCM(false), + setPos(false), chVolL(127), chVolR(127), chPanL(127), diff --git a/src/engine/platform/swan.cpp b/src/engine/platform/swan.cpp index 33d769d63..39089ae32 100644 --- a/src/engine/platform/swan.cpp +++ b/src/engine/platform/swan.cpp @@ -556,6 +556,7 @@ void DivPlatformSwan::reset() { pcm=false; sweep=false; furnaceDac=false; + setPos=false; noise=0; dacPeriod=0; dacRate=0; diff --git a/src/engine/platform/swan.h b/src/engine/platform/swan.h index 10235231b..cf9c9eb7e 100644 --- a/src/engine/platform/swan.h +++ b/src/engine/platform/swan.h @@ -38,7 +38,7 @@ class DivPlatformSwan: public DivDispatch { Channel chan[4]; DivDispatchOscBuffer* oscBuf[4]; bool isMuted[4]; - bool pcm, sweep, furnaceDac; + bool pcm, sweep, furnaceDac, setPos; unsigned char sampleBank, noise; int dacPeriod, dacRate; unsigned int dacPos; diff --git a/src/engine/platform/vera.h b/src/engine/platform/vera.h index db2005bd7..07ca9b3a0 100644 --- a/src/engine/platform/vera.h +++ b/src/engine/platform/vera.h @@ -38,8 +38,8 @@ class DivPlatformVERA: public DivDispatch { unsigned int pos; unsigned int len; unsigned char freq; - bool depth16; - PCMChannel(): sample(-1), pos(0), len(0), freq(0), depth16(false) {} + bool depth16, setPos; + PCMChannel(): sample(-1), pos(0), len(0), freq(0), depth16(false), setPos(false) {} } pcm; Channel(): SharedChannel(0), diff --git a/src/engine/platform/vrc6.h b/src/engine/platform/vrc6.h index 5a02a350a..8d04a4836 100644 --- a/src/engine/platform/vrc6.h +++ b/src/engine/platform/vrc6.h @@ -31,7 +31,7 @@ class DivPlatformVRC6: public DivDispatch, public vrcvi_intf { unsigned int dacPos; int dacSample; unsigned char duty; - bool pcm, furnaceDac; + bool pcm, furnaceDac, setPos; Channel(): SharedChannel(15), dacPeriod(0), @@ -41,7 +41,8 @@ class DivPlatformVRC6: public DivDispatch, public vrcvi_intf { dacSample(-1), duty(0), pcm(false), - furnaceDac(false) {} + furnaceDac(false), + setPos(false) {} }; Channel chan[3]; DivDispatchOscBuffer* oscBuf[3]; diff --git a/src/engine/platform/x1_010.h b/src/engine/platform/x1_010.h index 413aba3e8..2ce6105df 100644 --- a/src/engine/platform/x1_010.h +++ b/src/engine/platform/x1_010.h @@ -70,7 +70,7 @@ class DivPlatformX1_010: public DivDispatch, public vgsound_emu_mem_intf { int fixedFreq; int wave, sample; unsigned char pan, autoEnvNum, autoEnvDen; - bool envChanged, furnacePCM, pcm; + bool envChanged, furnacePCM, pcm, setPos; int lvol, rvol; int macroVolMul; unsigned char waveBank; @@ -84,7 +84,7 @@ class DivPlatformX1_010: public DivDispatch, public vgsound_emu_mem_intf { autoEnvNum=autoEnvDen=0; active=false; insChanged=envChanged=freqChanged=true; - keyOn=keyOff=inPorta=furnacePCM=pcm=false; + keyOn=keyOff=inPorta=furnacePCM=pcm=setPos=false; vol=outVol=lvol=rvol=15; waveBank=0; } @@ -99,6 +99,7 @@ class DivPlatformX1_010: public DivDispatch, public vgsound_emu_mem_intf { envChanged(true), furnacePCM(false), pcm(false), + setPos(false), lvol(15), rvol(15), macroVolMul(15),