GUI: channel status, part 4

This commit is contained in:
tildearrow 2023-10-27 18:08:37 -05:00
parent 429119a186
commit d8daeb1169
7 changed files with 126 additions and 3 deletions

View file

@ -710,6 +710,63 @@ DivChannelPair DivPlatformSNES::getPaired(int ch) {
return DivChannelPair();
}
DivChannelModeHints DivPlatformSNES::getModeHints(int ch) {
DivChannelModeHints ret;
ret.count=1;
ret.hint[0]="-";
ret.type[0]=0;
const SPC_DSP::voice_t* v=dsp.get_voice(ch);
if (v!=NULL) {
if (v->regs[5]&128) {
switch (v->env_mode) {
case SPC_DSP::env_attack:
ret.hint[0]="A";
ret.type[0]=12;
break;
case SPC_DSP::env_decay:
ret.hint[0]="D";
ret.type[0]=13;
break;
case SPC_DSP::env_sustain:
ret.hint[0]="S";
ret.type[0]=14;
break;
case SPC_DSP::env_release:
ret.hint[0]="R";
ret.type[0]=15;
break;
}
} else {
if (v->regs[7]&128) {
switch (v->regs[7]&0x60) {
case 0:
ret.hint[0]="d";
ret.type[0]=16;
break;
case 32:
ret.hint[0]="X";
ret.type[0]=17;
break;
case 64:
ret.hint[0]="I";
ret.type[0]=18;
break;
case 96:
ret.hint[0]="B";
ret.type[0]=19;
break;
}
} else {
ret.hint[0]="V";
ret.type[0]=20;
}
}
}
return ret;
}
DivSamplePos DivPlatformSNES::getSamplePos(int ch) {
if (ch>=8) return DivSamplePos();
if (!chan[ch].active) return DivSamplePos();