T6W28: separate instrument type
This commit is contained in:
parent
ea0b573402
commit
a3fdf171f3
9 changed files with 24 additions and 12 deletions
|
|
@ -71,6 +71,7 @@ enum DivInstrumentType: unsigned short {
|
|||
DIV_INS_YMZ280B=41,
|
||||
DIV_INS_RF5C68=42,
|
||||
DIV_INS_MSM5232=43,
|
||||
DIV_INS_T6W28=44,
|
||||
DIV_INS_MAX,
|
||||
DIV_INS_NULL
|
||||
};
|
||||
|
|
|
|||
|
|
@ -72,8 +72,10 @@ void DivPlatformT6W28::acquire(short* bufL, short* bufR, size_t start, size_t le
|
|||
}
|
||||
|
||||
void DivPlatformT6W28::writeOutVol(int ch) {
|
||||
rWrite(1,0x90|(ch<<5)|(isMuted[ch]?15:(15-(chan[ch].outVol&15))));
|
||||
rWrite(0,0x90|(ch<<5)|(isMuted[ch]?15:(15-(chan[ch].outVol&15))));
|
||||
int left=15-CLAMP(chan[ch].outVol+chan[ch].panL-15,0,15);
|
||||
int right=15-CLAMP(chan[ch].outVol+chan[ch].panR-15,0,15);
|
||||
rWrite(0,0x90|(ch<<5)|(isMuted[ch]?15:left));
|
||||
rWrite(1,0x90|(ch<<5)|(isMuted[ch]?15:right));
|
||||
}
|
||||
|
||||
void DivPlatformT6W28::tick(bool sysTick) {
|
||||
|
|
@ -90,12 +92,10 @@ void DivPlatformT6W28::tick(bool sysTick) {
|
|||
chan[i].freqChanged=true;
|
||||
}
|
||||
if (chan[i].std.panL.had) {
|
||||
chan[i].pan&=0x0f;
|
||||
chan[i].pan|=(chan[i].std.panL.val&15)<<4;
|
||||
chan[i].panL=chan[i].std.panL.val&15;
|
||||
}
|
||||
if (chan[i].std.panR.had) {
|
||||
chan[i].pan&=0xf0;
|
||||
chan[i].pan|=chan[i].std.panR.val&15;
|
||||
chan[i].panR=chan[i].std.panR.val&15;
|
||||
}
|
||||
if (chan[i].std.vol.had || chan[i].std.panL.had || chan[i].std.panR.had) {
|
||||
writeOutVol(i);
|
||||
|
|
@ -208,7 +208,9 @@ int DivPlatformT6W28::dispatch(DivCommand c) {
|
|||
chan[c.chan].noise=c.value;
|
||||
break;
|
||||
case DIV_CMD_PANNING: {
|
||||
chan[c.chan].pan=(c.value&0xf0)|(c.value2>>4);
|
||||
chan[c.chan].panL=c.value>>4;
|
||||
chan[c.chan].panR=c.value2>>4;
|
||||
writeOutVol(c.chan);
|
||||
break;
|
||||
}
|
||||
case DIV_CMD_LEGATO:
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ class DivPlatformT6W28: public DivDispatch {
|
|||
struct Channel {
|
||||
int freq, baseFreq, pitch, pitch2, note;
|
||||
int ins;
|
||||
unsigned char pan;
|
||||
unsigned char panL, panR;
|
||||
bool active, insChanged, freqChanged, keyOn, keyOff, inPorta, noise;
|
||||
signed char vol, outVol;
|
||||
DivMacroInt std;
|
||||
|
|
@ -44,7 +44,8 @@ class DivPlatformT6W28: public DivDispatch {
|
|||
pitch2(0),
|
||||
note(0),
|
||||
ins(-1),
|
||||
pan(255),
|
||||
panL(15),
|
||||
panR(15),
|
||||
active(false),
|
||||
insChanged(true),
|
||||
freqChanged(false),
|
||||
|
|
|
|||
|
|
@ -1660,7 +1660,7 @@ void DivEngine::registerSystems() {
|
|||
{"Square 1", "Square 2", "Square 3", "Noise"},
|
||||
{"S1", "S2", "S3", "NO"},
|
||||
{DIV_CH_PULSE, DIV_CH_PULSE, DIV_CH_PULSE, DIV_CH_NOISE},
|
||||
{DIV_INS_STD, DIV_INS_STD, DIV_INS_STD, DIV_INS_STD},
|
||||
{DIV_INS_T6W28, DIV_INS_T6W28, DIV_INS_T6W28, DIV_INS_T6W28},
|
||||
{},
|
||||
{
|
||||
{0x20, {DIV_CMD_STD_NOISE_MODE, "20xy: Set noise mode (x: preset/variable; y: thin pulse/noise)"}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue