add tSU filter cutoff & duty slide effects

This commit is contained in:
LTVA1 2024-08-19 15:22:08 +03:00
parent f6878d100a
commit a2326182f6
25 changed files with 5446 additions and 5082 deletions

524
po/de.po

File diff suppressed because it is too large Load diff

524
po/es.po

File diff suppressed because it is too large Load diff

524
po/fi.po

File diff suppressed because it is too large Load diff

524
po/fr.po

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

524
po/hy.po

File diff suppressed because it is too large Load diff

524
po/id.po

File diff suppressed because it is too large Load diff

524
po/ja.po

File diff suppressed because it is too large Load diff

524
po/ko.po

File diff suppressed because it is too large Load diff

Binary file not shown.

Binary file not shown.

524
po/nl.po

File diff suppressed because it is too large Load diff

524
po/pl.po

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

524
po/ru.po

File diff suppressed because it is too large Load diff

524
po/sk.po

File diff suppressed because it is too large Load diff

524
po/sv.po

File diff suppressed because it is too large Load diff

524
po/th.po

File diff suppressed because it is too large Load diff

524
po/tr.po

File diff suppressed because it is too large Load diff

524
po/uk.po

File diff suppressed because it is too large Load diff

524
po/zh.po

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -67,6 +67,25 @@ void DivPlatformSoundUnit::writeControlUpper(int ch) {
void DivPlatformSoundUnit::tick(bool sysTick) { void DivPlatformSoundUnit::tick(bool sysTick) {
for (int i=0; i<8; i++) { for (int i=0; i<8; i++) {
chan[i].std.next(); chan[i].std.next();
if(sysTick)
{
if(chan[i].pw_slide != 0)
{
chan[i].virtual_duty -= chan[i].pw_slide;
chan[i].virtual_duty = CLAMP(chan[i].virtual_duty, 0, 0xfff);
chan[i].duty = chan[i].virtual_duty >> 5;
chWrite(i,0x08,chan[i].duty);
}
if(chan[i].cutoff_slide != 0)
{
chan[i].cutoff += chan[i].cutoff_slide * 4;
chan[i].cutoff = CLAMP(chan[i].cutoff, 0, 0x3fff);
chWrite(i,0x06,chan[i].cutoff&0xff);
chWrite(i,0x07,chan[i].cutoff>>8);
}
}
if (chan[i].std.vol.had) { if (chan[i].std.vol.had) {
DivInstrument* ins=parent->getIns(chan[i].ins,DIV_INS_SU); DivInstrument* ins=parent->getIns(chan[i].ins,DIV_INS_SU);
if (ins->type==DIV_INS_AMIGA) { if (ins->type==DIV_INS_AMIGA) {
@ -86,6 +105,7 @@ void DivPlatformSoundUnit::tick(bool sysTick) {
} }
if (chan[i].std.duty.had) { if (chan[i].std.duty.had) {
chan[i].duty=chan[i].std.duty.val; chan[i].duty=chan[i].std.duty.val;
chan[i].virtual_duty = (unsigned short)chan[i].duty << 5;
chWrite(i,0x08,chan[i].duty); chWrite(i,0x08,chan[i].duty);
} }
if (chan[i].std.wave.had) { if (chan[i].std.wave.had) {
@ -351,6 +371,7 @@ int DivPlatformSoundUnit::dispatch(DivCommand c) {
break; break;
case DIV_CMD_STD_NOISE_MODE: case DIV_CMD_STD_NOISE_MODE:
chan[c.chan].duty=c.value&127; chan[c.chan].duty=c.value&127;
chan[c.chan].virtual_duty = (unsigned short)chan[c.chan].duty << 5;
chWrite(c.chan,0x08,chan[c.chan].duty); chWrite(c.chan,0x08,chan[c.chan].duty);
break; break;
case DIV_CMD_C64_RESONANCE: case DIV_CMD_C64_RESONANCE:
@ -498,6 +519,12 @@ int DivPlatformSoundUnit::dispatch(DivCommand c) {
if (!chan[c.chan].inPorta && c.value && !parent->song.brokenPortaArp && chan[c.chan].std.arp.will && !NEW_ARP_STRAT) chan[c.chan].baseFreq=NOTE_SU(c.chan,chan[c.chan].note); if (!chan[c.chan].inPorta && c.value && !parent->song.brokenPortaArp && chan[c.chan].std.arp.will && !NEW_ARP_STRAT) chan[c.chan].baseFreq=NOTE_SU(c.chan,chan[c.chan].note);
chan[c.chan].inPorta=c.value; chan[c.chan].inPorta=c.value;
break; break;
case DIV_CMD_C64_PW_SLIDE:
chan[c.chan].pw_slide = c.value * c.value2;
break;
case DIV_CMD_C64_CUTOFF_SLIDE:
chan[c.chan].cutoff_slide = c.value * c.value2;
break;
case DIV_CMD_GET_VOLMAX: case DIV_CMD_GET_VOLMAX:
return 127; return 127;
break; break;
@ -564,6 +591,11 @@ void DivPlatformSoundUnit::reset() {
for (int i=0; i<8; i++) { for (int i=0; i<8; i++) {
chan[i]=DivPlatformSoundUnit::Channel(); chan[i]=DivPlatformSoundUnit::Channel();
chan[i].std.setEngine(parent); chan[i].std.setEngine(parent);
chan[i].cutoff_slide = 0;
chan[i].pw_slide = 0;
chan[i].virtual_duty = 0x800; //for some reason duty by default is 50%
} }
if (dumpWrites) { if (dumpWrites) {
addWrite(0xffffffff,0); addWrite(0xffffffff,0);

View file

@ -38,6 +38,9 @@ class DivPlatformSoundUnit: public DivDispatch {
signed short wave; signed short wave;
unsigned short hwSeqPos; unsigned short hwSeqPos;
short hwSeqDelay; short hwSeqDelay;
short cutoff_slide;
short pw_slide;
short virtual_duty;
Channel(): Channel():
SharedChannel<signed char>(127), SharedChannel<signed char>(127),
cutoff(16383), cutoff(16383),
@ -71,7 +74,10 @@ class DivPlatformSoundUnit: public DivDispatch {
syncTimer(0), syncTimer(0),
wave(0), wave(0),
hwSeqPos(0), hwSeqPos(0),
hwSeqDelay(0) {} hwSeqDelay(0),
cutoff_slide(0),
pw_slide(0),
virtual_duty(0) {}
}; };
Channel chan[8]; Channel chan[8];
DivDispatchOscBuffer* oscBuf[8]; DivDispatchOscBuffer* oscBuf[8];

View file

@ -1822,6 +1822,12 @@ void DivEngine::registerSystems() {
{0x20, {DIV_CMD_SU_SWEEP_ENABLE, _("20xx: Toggle frequency sweep (bit 0-6: speed; bit 7: direction is up)"), constVal<0>, effectVal}}, {0x20, {DIV_CMD_SU_SWEEP_ENABLE, _("20xx: Toggle frequency sweep (bit 0-6: speed; bit 7: direction is up)"), constVal<0>, effectVal}},
{0x21, {DIV_CMD_SU_SWEEP_ENABLE, _("21xx: Toggle volume sweep (bit 0-4: speed; bit 5: direction is up; bit 6: loop; bit 7: alternate)"), constVal<1>, effectVal}}, {0x21, {DIV_CMD_SU_SWEEP_ENABLE, _("21xx: Toggle volume sweep (bit 0-4: speed; bit 5: direction is up; bit 6: loop; bit 7: alternate)"), constVal<1>, effectVal}},
{0x22, {DIV_CMD_SU_SWEEP_ENABLE, _("22xx: Toggle cutoff sweep (bit 0-6: speed; bit 7: direction is up)"), constVal<2>, effectVal}}, {0x22, {DIV_CMD_SU_SWEEP_ENABLE, _("22xx: Toggle cutoff sweep (bit 0-6: speed; bit 7: direction is up)"), constVal<2>, effectVal}},
{0x23, {DIV_CMD_C64_PW_SLIDE, _("23xx: Pulse width slide up"), effectVal, constVal<1>}},
{0x24, {DIV_CMD_C64_PW_SLIDE, _("24xx: Pulse width slide down"), effectVal, constVal<-1>}},
{0x25, {DIV_CMD_C64_CUTOFF_SLIDE, _("25xx: Filter cutoff slide up"), effectVal, constVal<1>}},
{0x26, {DIV_CMD_C64_CUTOFF_SLIDE, _("26xx: Filter cutoff slide down"), effectVal, constVal<-1>}},
}; };
const EffectHandler suCutoffHandler(DIV_CMD_C64_FINE_CUTOFF, _("4xxx: Set cutoff (0 to FFF)"), effectValLong<12>); const EffectHandler suCutoffHandler(DIV_CMD_C64_FINE_CUTOFF, _("4xxx: Set cutoff (0 to FFF)"), effectValLong<12>);
for (int i=0; i<16; i++) { for (int i=0; i<16; i++) {