MOAR EFFECTS!!

This commit is contained in:
LTVA1 2024-08-12 12:59:34 +03:00
parent 6417da27e9
commit e0df55749a
5 changed files with 71 additions and 4 deletions

View file

@ -272,6 +272,12 @@ enum DivDispatchCmds {
DIV_CMD_SID3_WAVE_MIX, DIV_CMD_SID3_WAVE_MIX,
DIV_CMD_SID3_LFSR_FEEDBACK_BITS, DIV_CMD_SID3_LFSR_FEEDBACK_BITS,
DIV_CMD_SID3_1_BIT_NOISE, DIV_CMD_SID3_1_BIT_NOISE,
DIV_CMD_SID3_FILTER_DISTORTION,
DIV_CMD_SID3_FILTER_OUTPUT_VOLUME,
DIV_CMD_SID3_CHANNEL_INVERSION,
DIV_CMD_SID3_FILTER_CONNECTION,
DIV_CMD_SID3_FILTER_MATRIX,
DIV_CMD_SID3_FILTER_ENABLE,
DIV_CMD_MAX DIV_CMD_MAX
}; };

View file

@ -954,6 +954,14 @@ int DivPlatformSID3::dispatch(DivCommand c) {
chan[c.chan].duty = (c.value & 0xfff) << 4; chan[c.chan].duty = (c.value & 0xfff) << 4;
updateDuty(c.chan); updateDuty(c.chan);
break; break;
case DIV_CMD_FM_FB:
chan[c.chan].feedback = c.value & 0xff;
rWrite(SID3_REGISTER_FEEDBACK + c.chan * SID3_REGISTERS_PER_CHANNEL, chan[c.chan].feedback);
break;
case DIV_CMD_SID3_CHANNEL_INVERSION:
chan[c.chan].phaseInv = c.value & 3;
rWrite(SID3_REGISTER_PHASE_INVERSION + c.chan * SID3_REGISTERS_PER_CHANNEL, chan[c.chan].phaseInv);
break;
case DIV_CMD_C64_FINE_CUTOFF: case DIV_CMD_C64_FINE_CUTOFF:
chan[c.chan].filt[c.value2].cutoff = (c.value & 0xfff) << 4; chan[c.chan].filt[c.value2].cutoff = (c.value & 0xfff) << 4;
updateFilter(c.chan, c.value2); updateFilter(c.chan, c.value2);
@ -962,6 +970,35 @@ int DivPlatformSID3::dispatch(DivCommand c) {
chan[c.chan].filt[c.value2].resonance = c.value & 0xff; chan[c.chan].filt[c.value2].resonance = c.value & 0xff;
updateFilter(c.chan, c.value2); updateFilter(c.chan, c.value2);
break; break;
case DIV_CMD_SID3_FILTER_OUTPUT_VOLUME:
chan[c.chan].filt[c.value2].output_volume = c.value & 0xff;
updateFilter(c.chan, c.value2);
break;
case DIV_CMD_SID3_FILTER_DISTORTION:
chan[c.chan].filt[c.value2].distortion_level = c.value & 0xff;
updateFilter(c.chan, c.value2);
break;
case DIV_CMD_C64_FILTER_MODE:
chan[c.chan].filt[(c.value >> 4) & 3].mode &= ~(SID3_FILTER_LP | SID3_FILTER_HP | SID3_FILTER_BP);
if(c.value & 1) chan[c.chan].filt[(c.value >> 4) & 3].mode |= SID3_FILTER_LP;
if(c.value & 2) chan[c.chan].filt[(c.value >> 4) & 3].mode |= SID3_FILTER_BP;
if(c.value & 4) chan[c.chan].filt[(c.value >> 4) & 3].mode |= SID3_FILTER_HP;
updateFilter(c.chan, (c.value >> 4) & 3);
break;
case DIV_CMD_SID3_FILTER_CONNECTION:
chan[c.chan].filt[(c.value >> 4) & 3].mode &= ~(SID3_FILTER_CHANNEL_INPUT | SID3_FILTER_OUTPUT);
if(c.value & 1) chan[c.chan].filt[(c.value >> 4) & 3].mode |= SID3_FILTER_CHANNEL_INPUT;
if(c.value & 2) chan[c.chan].filt[(c.value >> 4) & 3].mode |= SID3_FILTER_OUTPUT;
updateFilter(c.chan, (c.value >> 4) & 3);
break;
case DIV_CMD_SID3_FILTER_MATRIX:
chan[c.chan].filt[(c.value >> 4) & 3].filter_matrix = c.value & 0xf;
updateFilter(c.chan, (c.value >> 4) & 3);
break;
case DIV_CMD_SID3_FILTER_ENABLE:
chan[c.chan].filt[(c.value >> 4) & 3].enabled = c.value & 1;
updateFilter(c.chan, (c.value >> 4) & 3);
break;
case DIV_CMD_SAMPLE_POS: case DIV_CMD_SAMPLE_POS:
chan[c.chan].dacPos=c.value; chan[c.chan].dacPos=c.value;
break; break;

View file

@ -272,6 +272,12 @@ const char* cmdName[]={
"SID3_WAVE_MIX", "SID3_WAVE_MIX",
"SID3_LFSR_FEEDBACK_BITS", "SID3_LFSR_FEEDBACK_BITS",
"SID3_1_BIT_NOISE", "SID3_1_BIT_NOISE",
"SID3_FILTER_DISTORTION",
"SID3_FILTER_OUTPUT_VOLUME",
"SID3_CHANNEL_INVERSION",
"SID3_FILTER_CONNECTION",
"SID3_FILTER_MATRIX",
"SID3_FILTER_ENABLE",
}; };
static_assert((sizeof(cmdName)/sizeof(void*))==DIV_CMD_MAX,"update cmdName!"); static_assert((sizeof(cmdName)/sizeof(void*))==DIV_CMD_MAX,"update cmdName!");

View file

@ -719,6 +719,24 @@ void DivEngine::registerSystems() {
{0x74, {DIV_CMD_C64_RESONANCE, _("74xx: Set filter 4 resonance"), effectVal, constVal<3>}}, {0x74, {DIV_CMD_C64_RESONANCE, _("74xx: Set filter 4 resonance"), effectVal, constVal<3>}},
{0x75, {DIV_CMD_SID3_1_BIT_NOISE, _("75xx: Set noise mode (0: usual noise, 1: 1-bit noise (PCM mode on wave channel))")}}, {0x75, {DIV_CMD_SID3_1_BIT_NOISE, _("75xx: Set noise mode (0: usual noise, 1: 1-bit noise (PCM mode on wave channel))")}},
{0x76, {DIV_CMD_SID3_FILTER_OUTPUT_VOLUME, _("76xx: Set filter 1 output volume"), effectVal, constVal<0>}},
{0x77, {DIV_CMD_SID3_FILTER_OUTPUT_VOLUME, _("77xx: Set filter 2 output volume"), effectVal, constVal<1>}},
{0x78, {DIV_CMD_SID3_FILTER_OUTPUT_VOLUME, _("78xx: Set filter 3 output volume"), effectVal, constVal<2>}},
{0x79, {DIV_CMD_SID3_FILTER_OUTPUT_VOLUME, _("79xx: Set filter 4 output volume"), effectVal, constVal<3>}},
{0x7A, {DIV_CMD_SID3_FILTER_DISTORTION, _("7Axx: Set filter 1 distortion"), effectVal, constVal<0>}},
{0x7B, {DIV_CMD_SID3_FILTER_DISTORTION, _("7Bxx: Set filter 2 distortion"), effectVal, constVal<1>}},
{0x7C, {DIV_CMD_SID3_FILTER_DISTORTION, _("7Cxx: Set filter 3 distortion"), effectVal, constVal<2>}},
{0x7D, {DIV_CMD_SID3_FILTER_DISTORTION, _("7Dxx: Set filter 4 distortion"), effectVal, constVal<3>}},
{0x7E, {DIV_CMD_FM_FB, _("7Exx: Set feedback")}},
{0x7F, {DIV_CMD_SID3_CHANNEL_INVERSION, _("7Fxx: Set channel signal inversion (bit 0: right channel, bit 1: left channel)")}},
{0xA0, {DIV_CMD_C64_FILTER_MODE, _("A0xy: Set filter mode (x: filter (0-3); y: bit 0: low pass; bit 1: band pass; bit 2: high pass)")}},
{0xA1, {DIV_CMD_SID3_FILTER_CONNECTION, _("A1xy: Set filter connection (x: filter (0-3); y: bit 0: connect to channel input; bit 1: connect to channel output)")}},
{0xA2, {DIV_CMD_SID3_FILTER_MATRIX, _("A2xy: Set filter connection matrix (x: filter (0-3); y: bits 0-3: add filter 1-4 output to filter's input)")}},
{0xA3, {DIV_CMD_SID3_FILTER_ENABLE, _("A3xy: Enable filter (x: filter (0-3); y: enable)")}},
}; };
const EffectHandler SID3FineDutyHandler(DIV_CMD_C64_FINE_DUTY, _("5xxx: Set pulse width (0 to FFF)"), effectValLong<12>); const EffectHandler SID3FineDutyHandler(DIV_CMD_C64_FINE_DUTY, _("5xxx: Set pulse width (0 to FFF)"), effectValLong<12>);

View file

@ -417,10 +417,10 @@ const FurnaceGUIColors fxColors[256]={
GUI_COLOR_PATTERN_EFFECT_MISC, GUI_COLOR_PATTERN_EFFECT_MISC,
// A0-AF // A0-AF
GUI_COLOR_PATTERN_EFFECT_INVALID, GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_INVALID, GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_INVALID, GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_INVALID, GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
GUI_COLOR_PATTERN_EFFECT_INVALID, GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID, GUI_COLOR_PATTERN_EFFECT_INVALID,
GUI_COLOR_PATTERN_EFFECT_INVALID, GUI_COLOR_PATTERN_EFFECT_INVALID,