implement more effects

- C64: set fine duty and filter
- Neo Geo: slide SSG envelope
This commit is contained in:
tildearrow 2022-01-11 18:38:26 -05:00
parent 69b56e6d4c
commit 651db5784e
7 changed files with 67 additions and 0 deletions

View file

@ -195,6 +195,11 @@ int DivPlatformC64::dispatch(DivCommand c) {
rWrite(c.chan*7+2,chan[c.chan].duty&0xff);
rWrite(c.chan*7+3,chan[c.chan].duty>>8);
break;
case DIV_CMD_C64_FINE_DUTY:
chan[c.chan].duty=c.value;
rWrite(c.chan*7+2,chan[c.chan].duty&0xff);
rWrite(c.chan*7+3,chan[c.chan].duty>>8);
break;
case DIV_CMD_WAVE:
chan[c.chan].wave=c.value;
rWrite(c.chan*7+4,(chan[c.chan].wave<<4)|(chan[c.chan].ring<<2)|(chan[c.chan].sync<<1)|chan[c.chan].active);
@ -220,6 +225,10 @@ int DivPlatformC64::dispatch(DivCommand c) {
filtCut=c.value*2047/100;
updateFilter();
break;
case DIV_CMD_C64_FINE_CUTOFF:
filtCut=c.value;
updateFilter();
break;
case DIV_CMD_C64_RESONANCE:
if (c.value>15) c.value=15;
filtRes=c.value;

View file

@ -99,6 +99,26 @@ void DivPlatformYM2610::tick() {
((chan[4].psgMode&2)<<2)|
((chan[5].psgMode&2)<<3)|
((chan[6].psgMode&2)<<4)));
if (ayEnvSlide!=0) {
ayEnvSlideLow+=ayEnvSlide;
while (ayEnvSlideLow>7) {
ayEnvSlideLow-=8;
if (ayEnvPeriod<0xffff) {
ayEnvPeriod++;
immWrite(0x0b,ayEnvPeriod);
immWrite(0x0c,ayEnvPeriod>>8);
}
}
while (ayEnvSlideLow<-7) {
ayEnvSlideLow+=8;
if (ayEnvPeriod>0) {
ayEnvPeriod--;
immWrite(0x0b,ayEnvPeriod);
immWrite(0x0c,ayEnvPeriod>>8);
}
}
}
// FM
for (int i=0; i<4; i++) {
@ -462,6 +482,10 @@ int DivPlatformYM2610::dispatch(DivCommand c) {
immWrite(0x0b,ayEnvPeriod);
immWrite(0x0c,ayEnvPeriod>>8);
break;
case DIV_CMD_AY_ENVELOPE_SLIDE:
if (c.chan<4 || c.chan>6) break;
ayEnvSlide=c.value;
break;
case DIV_ALWAYS_SET_VOLUME:
return 0;
break;
@ -543,6 +567,8 @@ void DivPlatformYM2610::reset() {
sampleBank=0;
ayEnvPeriod=0;
ayEnvMode=0;
ayEnvSlide=0;
ayEnvSlideLow=0;
delay=0;

View file

@ -56,6 +56,8 @@ class DivPlatformYM2610: public DivDispatch {
short pendingWrites[512];
unsigned char ayEnvMode;
unsigned short ayEnvPeriod;
short ayEnvSlideLow;
short ayEnvSlide;
int octave(int freq);
int toFreq(int freq);