mirror of
https://github.com/tildearrow/furnace.git
synced 2024-12-28 10:31:25 +00:00
Add 3xxx effect to set echo delay buffer length. Add documentation
This commit is contained in:
parent
b3908216f8
commit
e32ef2d881
4 changed files with 30 additions and 1 deletions
18
papers/doc/7-systems/qsound.md
Normal file
18
papers/doc/7-systems/qsound.md
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# Capcom QSound (DL-1425)
|
||||||
|
|
||||||
|
This chip was used in Capcom's CP System Dash, CP System II and ZN arcade PCBs.
|
||||||
|
|
||||||
|
It supports 16 PCM channels and uses the patented (now expired) QSound stereo expansion algorithm, as the name implies.
|
||||||
|
|
||||||
|
Because the chip lacks sample interpolation, it's recommended that you try to play samples at around 24038 Hz to avoid aliasing. This is especially important for e.g. cymbals.
|
||||||
|
|
||||||
|
The QSound chip also has a small echo buffer, somewhat similar to the SNES, although with a very basic (and non-adjustable) filter. It is however possible to adjust the feedback and length of the echo buffer. The initial values can be set in the "Configure system" dialog.
|
||||||
|
|
||||||
|
There are also 3 ADPCM channels, however they cannot be used in Furnace yet. They have been reserved in case this feature is added later. ADPCM samples are limited to 8012 Hz.
|
||||||
|
|
||||||
|
# effects
|
||||||
|
|
||||||
|
- `08xx`: Set panning. Valid range is 00-20. 00 for full left, 10 for center and 20 for full right. It is also possible to bypass the QSound algorithm by using the range 30-50.
|
||||||
|
- `10xx`: Set echo feedback level. This effect will apply to all channels.
|
||||||
|
- `11xx`: Set echo level.
|
||||||
|
- `3xxx`: Set the length of the echo delay buffer.
|
|
@ -98,6 +98,7 @@ enum DivDispatchCmds {
|
||||||
DIV_CMD_SAA_ENVELOPE,
|
DIV_CMD_SAA_ENVELOPE,
|
||||||
|
|
||||||
DIV_CMD_QSOUND_ECHO_FEEDBACK,
|
DIV_CMD_QSOUND_ECHO_FEEDBACK,
|
||||||
|
DIV_CMD_QSOUND_ECHO_DELAY,
|
||||||
DIV_CMD_QSOUND_ECHO_LEVEL,
|
DIV_CMD_QSOUND_ECHO_LEVEL,
|
||||||
|
|
||||||
DIV_ALWAYS_SET_VOLUME,
|
DIV_ALWAYS_SET_VOLUME,
|
||||||
|
|
|
@ -257,6 +257,9 @@ const char* DivPlatformQSound::getEffectName(unsigned char effect) {
|
||||||
case 0x11:
|
case 0x11:
|
||||||
return "11xx: Set channel echo level (00 to FF)";
|
return "11xx: Set channel echo level (00 to FF)";
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
if((effect & 0xf0) == 0x30)
|
||||||
|
return "3xxx: Set echo delay buffer length (000 to AA5)";
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -433,6 +436,9 @@ int DivPlatformQSound::dispatch(DivCommand c) {
|
||||||
case DIV_CMD_QSOUND_ECHO_FEEDBACK:
|
case DIV_CMD_QSOUND_ECHO_FEEDBACK:
|
||||||
immWrite(Q1_ECHO_FEEDBACK, c.value << 6);
|
immWrite(Q1_ECHO_FEEDBACK, c.value << 6);
|
||||||
break;
|
break;
|
||||||
|
case DIV_CMD_QSOUND_ECHO_DELAY:
|
||||||
|
immWrite(Q1_ECHO_LENGTH, (c.value > 2725 ? 0xfff : 0xfff - (2725 - c.value)));
|
||||||
|
break;
|
||||||
case DIV_CMD_PITCH:
|
case DIV_CMD_PITCH:
|
||||||
chan[c.chan].pitch=c.value;
|
chan[c.chan].pitch=c.value;
|
||||||
chan[c.chan].freqChanged=true;
|
chan[c.chan].freqChanged=true;
|
||||||
|
|
|
@ -110,6 +110,7 @@ const char* cmdName[DIV_CMD_MAX]={
|
||||||
"SAA_ENVELOPE",
|
"SAA_ENVELOPE",
|
||||||
|
|
||||||
"QSOUND_ECHO_FEEDBACK",
|
"QSOUND_ECHO_FEEDBACK",
|
||||||
|
"QSOUND_ECHO_DELAY",
|
||||||
"QSOUND_ECHO_LEVEL",
|
"QSOUND_ECHO_LEVEL",
|
||||||
|
|
||||||
"ALWAYS_SET_VOLUME"
|
"ALWAYS_SET_VOLUME"
|
||||||
|
@ -230,7 +231,10 @@ bool DivEngine::perSystemEffect(int ch, unsigned char effect, unsigned char effe
|
||||||
dispatchCmd(DivCommand(DIV_CMD_QSOUND_ECHO_LEVEL,ch,effectVal));
|
dispatchCmd(DivCommand(DIV_CMD_QSOUND_ECHO_LEVEL,ch,effectVal));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return false;
|
if((effect & 0xf0) == 0x30)
|
||||||
|
dispatchCmd(DivCommand(DIV_CMD_QSOUND_ECHO_DELAY,ch,((effect & 0x0f) << 8) | effectVal));
|
||||||
|
else
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue