possibly implement envelope release points

no way to set them yet tho other than the MML string
This commit is contained in:
tildearrow 2022-02-08 13:11:04 -05:00
parent 480ae960e4
commit bf537881ce
13 changed files with 80 additions and 0 deletions

View file

@ -180,6 +180,10 @@ int DivPlatformAmiga::dispatch(DivCommand c) {
chan[c.chan].keyOff=true;
chan[c.chan].std.init(NULL);
break;
case DIV_CMD_NOTE_OFF_ENV:
case DIV_CMD_ENV_RELEASE:
chan[c.chan].std.release();
break;
case DIV_CMD_INSTRUMENT:
if (chan[c.chan].ins!=c.value || c.value2==1) {
chan[c.chan].ins=c.value;

View file

@ -532,6 +532,14 @@ int DivPlatformArcade::dispatch(DivCommand c) {
chan[c.chan].keyOff=true;
chan[c.chan].active=false;
break;
case DIV_CMD_NOTE_OFF_ENV:
chan[c.chan].keyOff=true;
chan[c.chan].active=false;
chan[c.chan].std.release();
break;
case DIV_CMD_ENV_RELEASE:
chan[c.chan].std.release();
break;
case DIV_CMD_VOLUME: {
chan[c.chan].vol=c.value;
if (!chan[c.chan].std.hasVol) {

View file

@ -202,6 +202,10 @@ int DivPlatformAY8910::dispatch(DivCommand c) {
chan[c.chan].active=false;
chan[c.chan].std.init(NULL);
break;
case DIV_CMD_NOTE_OFF_ENV:
case DIV_CMD_ENV_RELEASE:
chan[c.chan].std.release();
break;
case DIV_CMD_VOLUME: {
chan[c.chan].vol=c.value;
if (!chan[c.chan].std.hasVol) {

View file

@ -243,6 +243,10 @@ int DivPlatformAY8930::dispatch(DivCommand c) {
chan[c.chan].active=false;
chan[c.chan].std.init(NULL);
break;
case DIV_CMD_NOTE_OFF_ENV:
case DIV_CMD_ENV_RELEASE:
chan[c.chan].std.release();
break;
case DIV_CMD_VOLUME: {
chan[c.chan].vol=c.value;
if (!chan[c.chan].std.hasVol) {

View file

@ -195,6 +195,14 @@ int DivPlatformC64::dispatch(DivCommand c) {
chan[c.chan].keyOff=true;
//chan[c.chan].std.init(NULL);
break;
case DIV_CMD_NOTE_OFF_ENV:
chan[c.chan].active=false;
chan[c.chan].keyOff=true;
chan[c.chan].std.release();
break;
case DIV_CMD_ENV_RELEASE:
chan[c.chan].std.release();
break;
case DIV_CMD_INSTRUMENT:
if (chan[c.chan].ins!=c.value || c.value2==1) {
chan[c.chan].insChanged=true;

View file

@ -237,6 +237,10 @@ int DivPlatformGB::dispatch(DivCommand c) {
chan[c.chan].keyOff=true;
chan[c.chan].std.init(NULL);
break;
case DIV_CMD_NOTE_OFF_ENV:
case DIV_CMD_ENV_RELEASE:
chan[c.chan].std.release();
break;
case DIV_CMD_INSTRUMENT:
if (chan[c.chan].ins!=c.value || c.value2==1) {
chan[c.chan].ins=c.value;

View file

@ -495,6 +495,18 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
chan[c.chan].keyOff=true;
chan[c.chan].active=false;
break;
case DIV_CMD_NOTE_OFF_ENV:
if (c.chan==5) {
dacSample=-1;
if (dumpWrites) addWrite(0xffff0002,0);
}
chan[c.chan].keyOff=true;
chan[c.chan].active=false;
chan[c.chan].std.release();
break;
case DIV_CMD_ENV_RELEASE:
chan[c.chan].std.release();
break;
case DIV_CMD_VOLUME: {
chan[c.chan].vol=c.value;
if (!chan[c.chan].std.hasVol) {

View file

@ -289,6 +289,10 @@ int DivPlatformNES::dispatch(DivCommand c) {
chan[c.chan].keyOff=true;
chan[c.chan].std.init(NULL);
break;
case DIV_CMD_NOTE_OFF_ENV:
case DIV_CMD_ENV_RELEASE:
chan[c.chan].std.release();
break;
case DIV_CMD_INSTRUMENT:
if (chan[c.chan].ins!=c.value || c.value2==1) {
chan[c.chan].ins=c.value;

View file

@ -272,6 +272,10 @@ int DivPlatformPCE::dispatch(DivCommand c) {
chan[c.chan].keyOff=true;
chan[c.chan].std.init(NULL);
break;
case DIV_CMD_NOTE_OFF_ENV:
case DIV_CMD_ENV_RELEASE:
chan[c.chan].std.release();
break;
case DIV_CMD_INSTRUMENT:
if (chan[c.chan].ins!=c.value || c.value2==1) {
chan[c.chan].ins=c.value;

View file

@ -177,6 +177,10 @@ int DivPlatformSAA1099::dispatch(DivCommand c) {
chan[c.chan].active=false;
chan[c.chan].std.init(NULL);
break;
case DIV_CMD_NOTE_OFF_ENV:
case DIV_CMD_ENV_RELEASE:
chan[c.chan].std.release();
break;
case DIV_CMD_VOLUME: {
chan[c.chan].vol=c.value;
if (!chan[c.chan].std.hasVol) {

View file

@ -127,6 +127,10 @@ int DivPlatformSMS::dispatch(DivCommand c) {
rWrite(0x9f|c.chan<<5);
chan[c.chan].std.init(NULL);
break;
case DIV_CMD_NOTE_OFF_ENV:
case DIV_CMD_ENV_RELEASE:
chan[c.chan].std.release();
break;
case DIV_CMD_INSTRUMENT:
chan[c.chan].ins=c.value;
//chan[c.chan].std.init(parent->getIns(chan[c.chan].ins));

View file

@ -144,6 +144,10 @@ int DivPlatformTIA::dispatch(DivCommand c) {
chan[c.chan].active=false;
chan[c.chan].std.init(NULL);
break;
case DIV_CMD_NOTE_OFF_ENV:
case DIV_CMD_ENV_RELEASE:
chan[c.chan].std.release();
break;
case DIV_CMD_VOLUME: {
chan[c.chan].vol=c.value;
if (!chan[c.chan].std.hasVol) {

View file

@ -416,6 +416,22 @@ int DivPlatformYM2610::dispatch(DivCommand c) {
chan[c.chan].active=false;
chan[c.chan].std.init(NULL);
break;
case DIV_CMD_NOTE_OFF_ENV:
if (c.chan>6) {
immWrite(0x100,0x80|(1<<(c.chan-7)));
break;
}
if (c.chan>3) {
chan[c.chan].std.release();
break;
}
chan[c.chan].keyOff=true;
chan[c.chan].active=false;
chan[c.chan].std.release();
break;
case DIV_CMD_ENV_RELEASE:
chan[c.chan].std.release();
break;
case DIV_CMD_VOLUME: {
chan[c.chan].vol=c.value;
if (!chan[c.chan].std.hasVol) {