NES: add DMC write effect
This commit is contained in:
parent
abd42cbb03
commit
8500fa4c4c
|
@ -6,6 +6,9 @@ also known as Famicom. It is a five-channel PSG: first two channels play pulse w
|
||||||
|
|
||||||
# effects
|
# effects
|
||||||
|
|
||||||
|
- `11xx`: write to delta modulation counter.
|
||||||
|
- this may be used to attenuate the triangle and noise channels.
|
||||||
|
- will not work if a sample is playing.
|
||||||
- `12xx`: set duty cycle or noise mode of channel.
|
- `12xx`: set duty cycle or noise mode of channel.
|
||||||
- may be 0-3 for the pulse channels and 0-1 for the noise channel.
|
- may be 0-3 for the pulse channels and 0-1 for the noise channel.
|
||||||
- `13xy`: setup sweep up.
|
- `13xy`: setup sweep up.
|
||||||
|
|
|
@ -86,6 +86,7 @@ enum DivDispatchCmds {
|
||||||
DIV_CMD_PCE_LFO_SPEED, // (speed)
|
DIV_CMD_PCE_LFO_SPEED, // (speed)
|
||||||
|
|
||||||
DIV_CMD_NES_SWEEP, // (direction, value)
|
DIV_CMD_NES_SWEEP, // (direction, value)
|
||||||
|
DIV_CMD_NES_DMC, // (value)
|
||||||
|
|
||||||
DIV_CMD_C64_CUTOFF, // (value)
|
DIV_CMD_C64_CUTOFF, // (value)
|
||||||
DIV_CMD_C64_RESONANCE, // (value)
|
DIV_CMD_C64_RESONANCE, // (value)
|
||||||
|
|
|
@ -59,6 +59,9 @@ const char** DivPlatformNES::getRegisterSheet() {
|
||||||
|
|
||||||
const char* DivPlatformNES::getEffectName(unsigned char effect) {
|
const char* DivPlatformNES::getEffectName(unsigned char effect) {
|
||||||
switch (effect) {
|
switch (effect) {
|
||||||
|
case 0x11:
|
||||||
|
return "Write to delta modulation counter (0 to 7F)";
|
||||||
|
break;
|
||||||
case 0x12:
|
case 0x12:
|
||||||
return "12xx: Set duty cycle/noise mode (pulse: 0 to 3; noise: 0 or 1)";
|
return "12xx: Set duty cycle/noise mode (pulse: 0 to 3; noise: 0 or 1)";
|
||||||
break;
|
break;
|
||||||
|
@ -420,6 +423,9 @@ int DivPlatformNES::dispatch(DivCommand c) {
|
||||||
}
|
}
|
||||||
rWrite(0x4001+(c.chan*4),chan[c.chan].sweep);
|
rWrite(0x4001+(c.chan*4),chan[c.chan].sweep);
|
||||||
break;
|
break;
|
||||||
|
case DIV_CMD_NES_DMC:
|
||||||
|
rWrite(0x4011,c.value&0x7f);
|
||||||
|
break;
|
||||||
case DIV_CMD_SAMPLE_BANK:
|
case DIV_CMD_SAMPLE_BANK:
|
||||||
sampleBank=c.value;
|
sampleBank=c.value;
|
||||||
if (sampleBank>(parent->song.sample.size()/12)) {
|
if (sampleBank>(parent->song.sample.size()/12)) {
|
||||||
|
|
|
@ -88,6 +88,7 @@ const char* cmdName[]={
|
||||||
"PCE_LFO_SPEED",
|
"PCE_LFO_SPEED",
|
||||||
|
|
||||||
"NES_SWEEP",
|
"NES_SWEEP",
|
||||||
|
"NES_DMC",
|
||||||
|
|
||||||
"C64_CUTOFF",
|
"C64_CUTOFF",
|
||||||
"C64_RESONANCE",
|
"C64_RESONANCE",
|
||||||
|
@ -317,6 +318,9 @@ bool DivEngine::perSystemEffect(int ch, unsigned char effect, unsigned char effe
|
||||||
case DIV_SYSTEM_NES:
|
case DIV_SYSTEM_NES:
|
||||||
case DIV_SYSTEM_MMC5:
|
case DIV_SYSTEM_MMC5:
|
||||||
switch (effect) {
|
switch (effect) {
|
||||||
|
case 0x11: // DMC write
|
||||||
|
dispatchCmd(DivCommand(DIV_CMD_NES_DMC,ch,effectVal));
|
||||||
|
break;
|
||||||
case 0x12: // duty or noise mode
|
case 0x12: // duty or noise mode
|
||||||
dispatchCmd(DivCommand(DIV_CMD_STD_NOISE_MODE,ch,effectVal));
|
dispatchCmd(DivCommand(DIV_CMD_STD_NOISE_MODE,ch,effectVal));
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue