Merge branch 'macro-retrigger-effect-tildearow-version'

with rewritten retrigger- erm... RESTART function
This commit is contained in:
tildearrow 2024-01-17 14:48:47 -05:00
commit b452641186
68 changed files with 271 additions and 1 deletions

View file

@ -93,7 +93,9 @@ not all chips support these effects.
- this effect is currently incomplete.
- `F5xx`: **Disable macro.**
- `F6xx`: **Enable macro.**
- `F7xx`: **Retrigger macro.**
- see macro table at the end of this document for possible values.
- `F7xx` resets LFO macro phase to the phase that is set in instrument macro settings.
additionally, [each chip has its own effects](../7-systems/README.md).

View file

@ -233,6 +233,7 @@ bool DivCSPlayer::tick() {
case DIV_CMD_AMIGA_PM:
case DIV_CMD_MACRO_OFF:
case DIV_CMD_MACRO_ON:
case DIV_CMD_MACRO_RESTART:
arg0=(unsigned char)stream.readC();
break;
case DIV_CMD_FM_TL:

View file

@ -153,6 +153,7 @@ void writePackedCommandValues(SafeWriter* w, const DivCommand& c) {
case DIV_CMD_AMIGA_PM:
case DIV_CMD_MACRO_OFF:
case DIV_CMD_MACRO_ON:
case DIV_CMD_MACRO_RESTART:
case DIV_CMD_HINT_ARP_TIME:
w->writeC(1); // length
w->writeC(c.value);

View file

@ -248,6 +248,8 @@ enum DivDispatchCmds {
DIV_CMD_ESFM_MODIN, // (op, value)
DIV_CMD_ESFM_ENV_DELAY, // (op, value)
DIV_CMD_MACRO_RESTART, // (which)
DIV_CMD_MAX
};

View file

@ -129,6 +129,8 @@ const char* DivEngine::getEffectDesc(unsigned char effect, int chan, bool notNul
return "F5xx: Disable macro (see manual)";
case 0xf6:
return "F6xx: Enable macro (see manual)";
case 0xf7:
return "F7xx: Restart macro (see manual)";
case 0xf8:
return "F8xx: Single tick volume slide up";
case 0xf9:

View file

@ -245,6 +245,81 @@ void DivMacroInt::mask(unsigned char id, bool enabled) {
#undef CONSIDER_OP
#undef CONSIDER
#define CONSIDER(x,y,z) \
case z: \
macroState=&x; \
macro=&ins->std.y; \
break;
#define CONSIDER_OP(oi,o) \
CONSIDER(op[oi].am,opMacros[oi].amMacro,0+o) \
CONSIDER(op[oi].ar,opMacros[oi].arMacro,1+o) \
CONSIDER(op[oi].dr,opMacros[oi].drMacro,2+o) \
CONSIDER(op[oi].mult,opMacros[oi].multMacro,3+o) \
CONSIDER(op[oi].rr,opMacros[oi].rrMacro,4+o) \
CONSIDER(op[oi].sl,opMacros[oi].slMacro,5+o) \
CONSIDER(op[oi].tl,opMacros[oi].tlMacro,6+o) \
CONSIDER(op[oi].dt2,opMacros[oi].dt2Macro,7+o) \
CONSIDER(op[oi].rs,opMacros[oi].rsMacro,8+o) \
CONSIDER(op[oi].dt,opMacros[oi].dtMacro,9+o) \
CONSIDER(op[oi].d2r,opMacros[oi].d2rMacro,10+o) \
CONSIDER(op[oi].ssg,opMacros[oi].ssgMacro,11+o) \
CONSIDER(op[oi].dam,opMacros[oi].damMacro,12+o) \
CONSIDER(op[oi].dvb,opMacros[oi].dvbMacro,13+o) \
CONSIDER(op[oi].egt,opMacros[oi].egtMacro,14+o) \
CONSIDER(op[oi].ksl,opMacros[oi].kslMacro,15+o) \
CONSIDER(op[oi].sus,opMacros[oi].susMacro,16+o) \
CONSIDER(op[oi].vib,opMacros[oi].vibMacro,17+o) \
CONSIDER(op[oi].ws,opMacros[oi].wsMacro,18+o) \
CONSIDER(op[oi].ksr,opMacros[oi].ksrMacro,19+o)
void DivMacroInt::restart(unsigned char id) {
DivMacroStruct* macroState=NULL;
DivInstrumentMacro* macro=NULL;
if (e==NULL) return;
if (ins==NULL) return;
switch (id) {
CONSIDER(vol,volMacro,0)
CONSIDER(arp,arpMacro,1)
CONSIDER(duty,dutyMacro,2)
CONSIDER(wave,waveMacro,3)
CONSIDER(pitch,pitchMacro,4)
CONSIDER(ex1,ex1Macro,5)
CONSIDER(ex2,ex2Macro,6)
CONSIDER(ex3,ex3Macro,7)
CONSIDER(alg,algMacro,8)
CONSIDER(fb,fbMacro,9)
CONSIDER(fms,fmsMacro,10)
CONSIDER(ams,amsMacro,11)
CONSIDER(panL,panLMacro,12)
CONSIDER(panR,panRMacro,13)
CONSIDER(phaseReset,phaseResetMacro,14)
CONSIDER(ex4,ex4Macro,15)
CONSIDER(ex5,ex5Macro,16)
CONSIDER(ex6,ex6Macro,17)
CONSIDER(ex7,ex7Macro,18)
CONSIDER(ex8,ex8Macro,19)
CONSIDER_OP(0,0x20)
CONSIDER_OP(2,0x40)
CONSIDER_OP(1,0x60)
CONSIDER_OP(3,0x80)
}
if (macroState==NULL || macro==NULL) return;
if (macro->len<=0) return;
if (macroState->masked) return;
macroState->init();
macroState->prepare(*macro,e);
}
#undef CONSIDER_OP
#undef CONSIDER
void DivMacroInt::release() {
released=true;
}

View file

@ -119,6 +119,11 @@ class DivMacroInt {
*/
void release();
/**
* restart macro.
*/
void restart(unsigned char id);
/**
* trigger next macro tick.
*/

View file

@ -721,6 +721,9 @@ int DivPlatformAmiga::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -783,6 +783,9 @@ int DivPlatformArcade::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
case DIV_CMD_GET_VOLMAX:
return 127;
break;

View file

@ -651,6 +651,9 @@ int DivPlatformAY8910::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
case DIV_CMD_GET_VOLMAX:
return 15;
break;

View file

@ -653,6 +653,9 @@ int DivPlatformAY8930::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
case DIV_CMD_GET_VOLMAX:
return 31;
break;

View file

@ -246,6 +246,9 @@ int DivPlatformBubSysWSG::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -441,6 +441,9 @@ int DivPlatformC140::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -536,6 +536,9 @@ int DivPlatformC64::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -1022,6 +1022,9 @@ int DivPlatformES5506::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -920,6 +920,9 @@ int DivPlatformESFM::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
case DIV_CMD_GET_VOLMAX:
return 63;
break;

View file

@ -387,6 +387,9 @@ int DivPlatformFDS::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -311,6 +311,9 @@ int DivPlatformGA20::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -553,6 +553,9 @@ int DivPlatformGB::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -1183,6 +1183,9 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
case DIV_CMD_GET_VOLMAX:
return 127;
break;

View file

@ -395,6 +395,9 @@ int DivPlatformK007232::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -345,6 +345,9 @@ int DivPlatformK053260::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -353,6 +353,9 @@ int DivPlatformLynx::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -327,6 +327,9 @@ int DivPlatformMMC5::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -297,6 +297,9 @@ int DivPlatformMSM5232::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -268,6 +268,9 @@ int DivPlatformMSM6258::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
case DIV_CMD_GET_VOLMAX:
return 8;
break;

View file

@ -226,6 +226,9 @@ int DivPlatformMSM6295::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
case DIV_CMD_GET_VOLMAX:
return 8;
break;

View file

@ -452,6 +452,9 @@ int DivPlatformN163::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -445,6 +445,9 @@ int DivPlatformNamcoWSG::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -659,6 +659,9 @@ int DivPlatformNES::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -1970,6 +1970,9 @@ int DivPlatformOPL::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
case DIV_CMD_GET_VOLMAX:
if (c.chan==adpcmChan) return 255;
if (pretendYMU) return 127;

View file

@ -853,6 +853,9 @@ int DivPlatformOPLL::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
case DIV_CMD_GET_VOLMAX:
return 15;
break;

View file

@ -474,6 +474,9 @@ int DivPlatformPCE::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -452,6 +452,9 @@ int DivPlatformPCMDAC::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -476,6 +476,9 @@ int DivPlatformPCSpeaker::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -239,6 +239,9 @@ int DivPlatformPET::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -253,6 +253,9 @@ int DivPlatformPokeMini::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -374,6 +374,9 @@ int DivPlatformPOKEY::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -180,6 +180,9 @@ int DivPlatformPong::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -188,6 +188,9 @@ int DivPlatformPV1000::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -587,6 +587,9 @@ int DivPlatformQSound::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -291,6 +291,9 @@ int DivPlatformRF5C68::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -316,6 +316,9 @@ int DivPlatformSAA1099::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
case DIV_CMD_GET_VOLMAX:
return 15;
break;

View file

@ -261,6 +261,9 @@ int DivPlatformSCC::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -339,6 +339,9 @@ int DivPlatformSegaPCM::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
case DIV_CMD_GET_VOLMAX:
return 127;
break;

View file

@ -277,6 +277,9 @@ int DivPlatformSM8521::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -420,6 +420,9 @@ int DivPlatformSMS::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -587,6 +587,9 @@ int DivPlatformSNES::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -502,6 +502,9 @@ int DivPlatformSoundUnit::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -446,6 +446,9 @@ int DivPlatformSwan::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -271,6 +271,9 @@ int DivPlatformT6W28::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -236,6 +236,9 @@ int DivPlatformTED::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -258,6 +258,9 @@ int DivPlatformTIA::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
case DIV_CMD_GET_VOLMAX:
return 15;
break;

View file

@ -880,6 +880,9 @@ int DivPlatformTX81Z::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
case DIV_CMD_GET_VOLMAX:
return 127;
break;

View file

@ -395,6 +395,9 @@ int DivPlatformVB::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -434,6 +434,9 @@ int DivPlatformVERA::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
case DIV_CMD_EXTERNAL:
rWriteZSMSync(c.value);
break;

View file

@ -252,6 +252,9 @@ int DivPlatformVIC20::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -412,6 +412,9 @@ int DivPlatformVRC6::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -832,6 +832,9 @@ int DivPlatformX1_010::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -861,6 +861,9 @@ int DivPlatformYM2203::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
case DIV_CMD_GET_VOLMAX:
if (c.chan>2) return 15;
return 127;

View file

@ -1352,6 +1352,9 @@ int DivPlatformYM2608::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
case DIV_CMD_GET_VOLMAX:
if (c.chan>14) return 255;
if (c.chan>8) return 31;

View file

@ -1324,6 +1324,9 @@ int DivPlatformYM2610::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
case DIV_CMD_GET_VOLMAX:
if (c.chan>=adpcmBChanOffs) return 255;
if (c.chan>=adpcmAChanOffs) return 31;

View file

@ -1391,6 +1391,9 @@ int DivPlatformYM2610B::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
case DIV_CMD_GET_VOLMAX:
if (c.chan>=adpcmBChanOffs) return 255;
if (c.chan>=adpcmAChanOffs) return 31;

View file

@ -321,6 +321,9 @@ int DivPlatformYMZ280B::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -218,6 +218,9 @@ int DivPlatformZXBeeper::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -288,6 +288,9 @@ int DivPlatformZXBeeperQuadTone::dispatch(DivCommand c) {
case DIV_CMD_MACRO_ON:
chan[c.chan].std.mask(c.value,false);
break;
case DIV_CMD_MACRO_RESTART:
chan[c.chan].std.restart(c.value);
break;
default:
break;
}

View file

@ -246,6 +246,8 @@ const char* cmdName[]={
"ESFM_OUTLVL",
"ESFM_MODIN",
"ESFM_ENV_DELAY",
"MACRO_RESTART",
};
static_assert((sizeof(cmdName)/sizeof(void*))==DIV_CMD_MAX,"update cmdName!");
@ -1006,6 +1008,9 @@ void DivEngine::processRow(int i, bool afterDelay) {
case 0xf6: // enable macro
dispatchCmd(DivCommand(DIV_CMD_MACRO_ON,i,effectVal&0xff));
break;
case 0xf7: // restart macro
dispatchCmd(DivCommand(DIV_CMD_MACRO_RESTART,i,effectVal&0xff));
break;
case 0xf8: // single volume ramp up
chan[i].volume=MIN(chan[i].volume+effectVal*256,chan[i].volMax);
dispatchCmd(DivCommand(DIV_CMD_VOLUME,i,chan[i].volume>>8));

View file

@ -516,7 +516,7 @@ const FurnaceGUIColors fxColors[256]={
GUI_COLOR_PATTERN_EFFECT_VOLUME, // F4
GUI_COLOR_PATTERN_EFFECT_MISC, // F5
GUI_COLOR_PATTERN_EFFECT_MISC, // F6
GUI_COLOR_PATTERN_EFFECT_INVALID, // F7
GUI_COLOR_PATTERN_EFFECT_MISC, // F7
GUI_COLOR_PATTERN_EFFECT_VOLUME, // F8
GUI_COLOR_PATTERN_EFFECT_VOLUME, // F9
GUI_COLOR_PATTERN_EFFECT_VOLUME, // FA