diff --git a/src/engine/platform/nds.cpp b/src/engine/platform/nds.cpp index 31a94448d..b39e99993 100644 --- a/src/engine/platform/nds.cpp +++ b/src/engine/platform/nds.cpp @@ -307,6 +307,13 @@ int DivPlatformNDS::dispatch(DivCommand c) { chan[c.chan].ins=c.value; } break; + case DIV_CMD_ADPCMA_GLOBAL_VOLUME: { + if (globalVolume!=(c.value&0x7f)) { + globalVolume=c.value&0x7f; + rWrite32(0x100,0x8000|globalVolume); + } + break; + } case DIV_CMD_VOLUME: if (chan[c.chan].vol!=c.value) { chan[c.chan].vol=c.value; @@ -435,7 +442,8 @@ DivDispatchOscBuffer* DivPlatformNDS::getOscBuffer(int ch) { void DivPlatformNDS::reset() { memset(regPool,0,288); nds.reset(); - rWrite32(0x100,0x807f); // enable keyon + globalVolume=0x7f; + rWrite32(0x100,0x8000|globalVolume); // enable keyon rWrite32(0x104,0x200); // initialize bias for (int i=0; i<16; i++) { chan[i]=DivPlatformNDS::Channel(); diff --git a/src/engine/platform/nds.h b/src/engine/platform/nds.h index cf846d847..5e2850618 100644 --- a/src/engine/platform/nds.h +++ b/src/engine/platform/nds.h @@ -47,6 +47,7 @@ class DivPlatformNDS: public DivDispatch, public nds_sound_intf { DivDispatchOscBuffer* oscBuf[16]; bool isMuted[16]; bool isDSi; + int globalVolume; unsigned int sampleOff[256]; bool sampleLoaded[256]; diff --git a/src/engine/sysDef.cpp b/src/engine/sysDef.cpp index 3cc1796f2..45d08a687 100644 --- a/src/engine/sysDef.cpp +++ b/src/engine/sysDef.cpp @@ -2031,6 +2031,7 @@ void DivEngine::registerSystems() { {DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA, DIV_INS_AMIGA}, { {0x12, {DIV_CMD_STD_NOISE_MODE, "12xx: Set duty cycle (pulse: 0 to 7)"}}, + {0x1f, {DIV_CMD_ADPCMA_GLOBAL_VOLUME, "1Fxx: Set global volume (0 to 7F)"}}, } );