keyOffAffectsArp is now per-channel

This commit is contained in:
tildearrow 2021-12-08 00:33:00 -05:00
parent 5fbaf71105
commit 65ab3a2b5d
13 changed files with 19 additions and 9 deletions

View file

@ -99,7 +99,7 @@ class DivDispatch {
virtual void tick();
virtual bool isStereo();
virtual bool keyOffAffectsArp();
virtual bool keyOffAffectsArp(int ch);
/**
* initialize this DivDispatch.

View file

@ -14,7 +14,7 @@ bool DivDispatch::isStereo() {
return false;
}
bool DivDispatch::keyOffAffectsArp() {
bool DivDispatch::keyOffAffectsArp(int ch) {
return false;
}

View file

@ -344,6 +344,10 @@ bool DivPlatformGenesis::isStereo() {
return true;
}
bool DivPlatformGenesis::keyOffAffectsArp(int ch) {
return (ch>5);
}
int DivPlatformGenesis::init(DivEngine* p, int channels, int sugRate) {
parent=p;
rate=213068;

View file

@ -52,6 +52,7 @@ class DivPlatformGenesis: public DivDispatch {
int dispatch(DivCommand c);
void tick();
bool isStereo();
bool keyOffAffectsArp(int ch);
int init(DivEngine* parent, int channels, int sugRate);
};
#endif

View file

@ -254,6 +254,10 @@ void DivPlatformGenesisExt::tick() {
}
}
bool DivPlatformGenesisExt::keyOffAffectsArp(int ch) {
return (ch>8);
}
int DivPlatformGenesisExt::init(DivEngine* parent, int channels, int sugRate) {
DivPlatformGenesis::init(parent,channels,sugRate);

View file

@ -17,5 +17,6 @@ class DivPlatformGenesisExt: public DivPlatformGenesis {
public:
int dispatch(DivCommand c);
void tick();
bool keyOffAffectsArp(int ch);
int init(DivEngine* parent, int channels, int sugRate);
};

View file

@ -270,7 +270,7 @@ int DivPlatformNES::dispatch(DivCommand c) {
return 1;
}
bool DivPlatformNES::keyOffAffectsArp() {
bool DivPlatformNES::keyOffAffectsArp(int ch) {
return true;
}

View file

@ -39,7 +39,7 @@ class DivPlatformNES: public DivDispatch {
void acquire(short* bufL, short* bufR, size_t start, size_t len);
int dispatch(DivCommand c);
void tick();
bool keyOffAffectsArp();
bool keyOffAffectsArp(int ch);
int init(DivEngine* parent, int channels, int sugRate);
};

View file

@ -259,7 +259,7 @@ bool DivPlatformPCE::isStereo() {
return true;
}
bool DivPlatformPCE::keyOffAffectsArp() {
bool DivPlatformPCE::keyOffAffectsArp(int ch) {
return true;
}

View file

@ -54,7 +54,7 @@ class DivPlatformPCE: public DivDispatch {
int dispatch(DivCommand c);
void tick();
bool isStereo();
bool keyOffAffectsArp();
bool keyOffAffectsArp(int ch);
int init(DivEngine* parent, int channels, int sugRate);
};

View file

@ -159,7 +159,7 @@ int DivPlatformSMS::dispatch(DivCommand c) {
return 1;
}
bool DivPlatformSMS::keyOffAffectsArp() {
bool DivPlatformSMS::keyOffAffectsArp(int ch) {
return true;
}

View file

@ -34,7 +34,7 @@ class DivPlatformSMS: public DivDispatch {
void acquire(short* bufL, short* bufR, size_t start, size_t len);
int dispatch(DivCommand c);
void tick();
bool keyOffAffectsArp();
bool keyOffAffectsArp(int ch);
int init(DivEngine* parent, int channels, int sugRate);
};

View file

@ -300,7 +300,7 @@ void DivEngine::processRow(int i, bool afterDelay) {
} else if (!(pat->data[whatRow][0]==0 && pat->data[whatRow][1]==0)) {
chan[i].note=pat->data[whatRow][0]+pat->data[whatRow][1]*12;
if (!chan[i].keyOn) {
if (dispatch->keyOffAffectsArp()) {
if (dispatch->keyOffAffectsArp(i)) {
chan[i].arp=0;
}
}