SNES: fix possible sample corruption

when toggling echo
This commit is contained in:
tildearrow 2023-07-29 17:12:46 -05:00
parent 423f2f5069
commit 1325664d25
3 changed files with 15 additions and 3 deletions

View File

@ -392,6 +392,15 @@ void DivPlatformOPLL::commitState(int ch, DivInstrument* ins) {
}
}
void DivPlatformOPLL::switchMode(bool mode) {
if (mode==properDrums) return;
if (mode) {
} else {
}
}
int DivPlatformOPLL::dispatch(DivCommand c) {
switch (c.cmd) {
case DIV_CMD_NOTE_ON: {

View File

@ -75,6 +75,7 @@ class DivPlatformOPLL: public DivDispatch {
int octave(int freq);
int toFreq(int freq);
void commitState(int ch, DivInstrument* ins);
void switchMode(bool mode);
friend void putDispatchChip(void*,int);
friend void putDispatchChan(void*,int,int);

View File

@ -733,6 +733,7 @@ int DivPlatformSNES::getRegisterPoolSize() {
void DivPlatformSNES::initEcho() {
unsigned char esa=0xf8-(echoDelay<<3);
unsigned char control=(noiseFreq&0x1f)|(echoOn?0:0x20);
if (echoOn) {
rWrite(0x6d,esa);
rWrite(0x7d,echoDelay);
@ -742,13 +743,14 @@ void DivPlatformSNES::initEcho() {
for (int i=0; i<8; i++) {
rWrite(0x0f+(i<<4),echoFIR[i]);
}
rWrite(0x6c,control);
} else {
rWrite(0x6d,0);
rWrite(0x7d,0);
rWrite(0x2c,0);
rWrite(0x3c,0);
rWrite(0x6c,control);
rWrite(0x7d,0);
rWrite(0x6d,0xff);
}
writeControl=true;
}
void DivPlatformSNES::reset() {