Add global volume command
This commit is contained in:
parent
9d19a1735a
commit
153ceea3bd
|
@ -307,6 +307,13 @@ int DivPlatformNDS::dispatch(DivCommand c) {
|
||||||
chan[c.chan].ins=c.value;
|
chan[c.chan].ins=c.value;
|
||||||
}
|
}
|
||||||
break;
|
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:
|
case DIV_CMD_VOLUME:
|
||||||
if (chan[c.chan].vol!=c.value) {
|
if (chan[c.chan].vol!=c.value) {
|
||||||
chan[c.chan].vol=c.value;
|
chan[c.chan].vol=c.value;
|
||||||
|
@ -435,7 +442,8 @@ DivDispatchOscBuffer* DivPlatformNDS::getOscBuffer(int ch) {
|
||||||
void DivPlatformNDS::reset() {
|
void DivPlatformNDS::reset() {
|
||||||
memset(regPool,0,288);
|
memset(regPool,0,288);
|
||||||
nds.reset();
|
nds.reset();
|
||||||
rWrite32(0x100,0x807f); // enable keyon
|
globalVolume=0x7f;
|
||||||
|
rWrite32(0x100,0x8000|globalVolume); // enable keyon
|
||||||
rWrite32(0x104,0x200); // initialize bias
|
rWrite32(0x104,0x200); // initialize bias
|
||||||
for (int i=0; i<16; i++) {
|
for (int i=0; i<16; i++) {
|
||||||
chan[i]=DivPlatformNDS::Channel();
|
chan[i]=DivPlatformNDS::Channel();
|
||||||
|
|
|
@ -47,6 +47,7 @@ class DivPlatformNDS: public DivDispatch, public nds_sound_intf {
|
||||||
DivDispatchOscBuffer* oscBuf[16];
|
DivDispatchOscBuffer* oscBuf[16];
|
||||||
bool isMuted[16];
|
bool isMuted[16];
|
||||||
bool isDSi;
|
bool isDSi;
|
||||||
|
int globalVolume;
|
||||||
unsigned int sampleOff[256];
|
unsigned int sampleOff[256];
|
||||||
bool sampleLoaded[256];
|
bool sampleLoaded[256];
|
||||||
|
|
||||||
|
|
|
@ -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},
|
{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)"}},
|
{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)"}},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue