Merge branch 'master' into feature/Moar-patch-bank-support-part3

This commit is contained in:
James Alan Nguyen 2022-05-16 20:01:53 +10:00
commit 9e28fe81f1
9 changed files with 19 additions and 25 deletions

View file

@ -1,5 +1,6 @@
# to-do for 0.6pre1
- fix an OPLL/OPL fixed drum freq regression caused by full linear pitch
- piano/input pad
- note input via piano
- input pad

View file

@ -2669,16 +2669,19 @@ SafeWriter* DivEngine::saveFur(bool notPrimary) {
if (song.ins.size()>256) {
logE("maximum number of instruments is 256!");
lastError="maximum number of instruments is 256";
saveLock.unlock();
return NULL;
}
if (song.wave.size()>256) {
logE("maximum number of wavetables is 256!");
lastError="maximum number of wavetables is 256";
saveLock.unlock();
return NULL;
}
if (song.sample.size()>256) {
logE("maximum number of samples is 256!");
lastError="maximum number of samples is 256";
saveLock.unlock();
return NULL;
}

View file

@ -357,7 +357,9 @@ void DivPlatformN163::tick(bool sysTick) {
chan[i].waveUpdated=false;
}
if (chan[i].freqChanged || chan[i].keyOn || chan[i].keyOff) {
chan[i].freq=parent->calcFreq((((chan[i].baseFreq*chan[i].waveLen)*(chanMax+1))/16),chan[i].pitch,false,0,chan[i].pitch2,chipClock,CHIP_FREQBASE);
// TODO: what is this mess?
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,false,0,chan[i].pitch2,chipClock,CHIP_FREQBASE);
chan[i].freq=(((chan[i].freq*chan[i].waveLen)*(chanMax+1))/16);
if (chan[i].freq<0) chan[i].freq=0;
if (chan[i].freq>0x3ffff) chan[i].freq=0x3ffff;
if (chan[i].keyOn) {

View file

@ -1057,19 +1057,19 @@ void DivPlatformYM2203::setSkipRegisterWrites(bool value) {
}
void DivPlatformYM2203::setFlags(unsigned int flags) {
unsigned char ayFlags=32;
unsigned char ayFlags=16;
if (flags==3) {
chipClock=3000000.0;
ayFlags=36;
ayFlags=20;
} else if (flags==2) {
chipClock=4000000.0;
ayFlags=35;
ayFlags=19;
} else if (flags==1) {
chipClock=COLOR_PAL*4.0/5.0;
ayFlags=33;
ayFlags=17;
} else {
chipClock=COLOR_NTSC;
ayFlags=32;
ayFlags=16;
}
ay->setFlags(ayFlags);
rate=fm->sample_rate(chipClock);
@ -1090,7 +1090,7 @@ int DivPlatformYM2203::init(DivEngine* p, int channels, int sugRate, unsigned in
fm->set_fidelity(ymfm::OPN_FIDELITY_MIN);
// YM2149, 2MHz
ay=new DivPlatformAY8910;
ay->init(p,3,sugRate,35);
ay->init(p,3,sugRate,19);
ay->toggleRegisterDump(true);
setFlags(flags);

View file

@ -21,7 +21,7 @@
#include "../engine.h"
#include <math.h>
#include "ym2610shared.h"
#include "ym2203shared.h"
#include "fmshared_OPN.h"
int DivPlatformYM2203Ext::dispatch(DivCommand c) {
@ -489,9 +489,6 @@ void DivPlatformYM2203Ext::forceIns() {
chan[i].freqChanged=true;
}
}
for (int i=3; i<6; i++) {
chan[i].insChanged=true;
}
ay->forceIns();
ay->flushWrites();

View file

@ -1459,7 +1459,7 @@ int DivPlatformYM2608::init(DivEngine* p, int channels, int sugRate, unsigned in
}
// YM2149, 2MHz
ay=new DivPlatformAY8910;
ay->init(p,3,sugRate,35);
ay->init(p,3,sugRate,19);
ay->toggleRegisterDump(true);
reset();
return 16;

View file

@ -1454,7 +1454,7 @@ int DivPlatformYM2610::init(DivEngine* p, int channels, int sugRate, unsigned in
fm=new ymfm::ym2610(iface);
// YM2149, 2MHz
ay=new DivPlatformAY8910;
ay->init(p,3,sugRate,35);
ay->init(p,3,sugRate,19);
ay->toggleRegisterDump(true);
reset();
return 14;

View file

@ -1432,7 +1432,7 @@ int DivPlatformYM2610B::init(DivEngine* p, int channels, int sugRate, unsigned i
fm=new ymfm::ym2610b(iface);
// YM2149, 2MHz
ay=new DivPlatformAY8910;
ay->init(p,3,sugRate,35);
ay->init(p,3,sugRate,19);
ay->toggleRegisterDump(true);
reset();
return 16;

View file

@ -29,20 +29,11 @@ const char** DivPlatformZXBeeper::getRegisterSheet() {
const char* DivPlatformZXBeeper::getEffectName(unsigned char effect) {
switch (effect) {
case 0x10:
return "10xx: Change waveform";
break;
case 0x11:
return "11xx: Toggle noise mode";
break;
case 0x12:
return "12xx: Setup LFO (0: disabled; 1: 1x depth; 2: 16x depth; 3: 256x depth)";
break;
case 0x13:
return "13xx: Set LFO speed";
return "12xx: Set pulse width";
break;
case 0x17:
return "17xx: Toggle PCM mode";
return "17xx: Trigger overlay drum";
break;
}
return NULL;