dev108 - add SN period range compat flag
there's room for possible improvement
This commit is contained in:
parent
5fe3a3c35a
commit
c74d7fab37
6 changed files with 32 additions and 8 deletions
|
|
@ -46,8 +46,8 @@
|
|||
#define BUSY_BEGIN_SOFT softLocked=true; isBusy.lock();
|
||||
#define BUSY_END isBusy.unlock(); softLocked=false;
|
||||
|
||||
#define DIV_VERSION "dev107"
|
||||
#define DIV_ENGINE_VERSION 107
|
||||
#define DIV_VERSION "dev108"
|
||||
#define DIV_ENGINE_VERSION 108
|
||||
|
||||
// for imports
|
||||
#define DIV_VERSION_MOD 0xff01
|
||||
|
|
|
|||
|
|
@ -175,6 +175,7 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
|
|||
ds.brokenOutVol=true; // ???
|
||||
ds.e1e2StopOnSameNote=true;
|
||||
ds.brokenPortaArp=false;
|
||||
ds.snNoLowPeriods=true;
|
||||
|
||||
// 1.1 compat flags
|
||||
if (ds.version>24) {
|
||||
|
|
@ -1063,6 +1064,9 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
|
|||
if (ds.version<101) {
|
||||
ds.brokenPortaArp=true;
|
||||
}
|
||||
if (ds.version<108) {
|
||||
ds.snNoLowPeriods=true;
|
||||
}
|
||||
ds.isDMF=false;
|
||||
|
||||
reader.readS(); // reserved
|
||||
|
|
@ -1475,7 +1479,12 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
|
|||
} else {
|
||||
reader.readC();
|
||||
}
|
||||
for (int i=0; i<7; i++) {
|
||||
if (ds.version>=108) {
|
||||
ds.snNoLowPeriods=reader.readC();
|
||||
} else {
|
||||
reader.readC();
|
||||
}
|
||||
for (int i=0; i<6; i++) {
|
||||
reader.readC();
|
||||
}
|
||||
}
|
||||
|
|
@ -3719,7 +3728,8 @@ SafeWriter* DivEngine::saveFur(bool notPrimary) {
|
|||
w->writeC(song.brokenOutVol);
|
||||
w->writeC(song.e1e2StopOnSameNote);
|
||||
w->writeC(song.brokenPortaArp);
|
||||
for (int i=0; i<7; i++) {
|
||||
w->writeC(song.snNoLowPeriods);
|
||||
for (int i=0; i<6; i++) {
|
||||
w->writeC(0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -188,7 +188,11 @@ void DivPlatformSMS::tick(bool sysTick) {
|
|||
if (chan[i].freqChanged) {
|
||||
chan[i].freq=parent->calcFreq(chan[i].baseFreq,chan[i].pitch,true,0,chan[i].pitch2,chipClock,toneDivider);
|
||||
if (chan[i].freq>1023) chan[i].freq=1023;
|
||||
if (chan[i].freq<8) chan[i].freq=1;
|
||||
if (parent->song.snNoLowPeriods) {
|
||||
if (chan[i].freq<8) chan[i].freq=1;
|
||||
} else {
|
||||
if (chan[i].freq<0) chan[i].freq=0;
|
||||
}
|
||||
//if (chan[i].actualNote>0x5d) chan[i].freq=0x01;
|
||||
rWrite(0,0x80|i<<5|(chan[i].freq&15));
|
||||
rWrite(0,chan[i].freq>>4);
|
||||
|
|
@ -203,7 +207,9 @@ void DivPlatformSMS::tick(bool sysTick) {
|
|||
if (chan[3].freqChanged || updateSNMode) {
|
||||
chan[3].freq=parent->calcFreq(chan[3].baseFreq,chan[3].pitch,true,0,chan[3].pitch2,chipClock,noiseDivider);
|
||||
if (chan[3].freq>1023) chan[3].freq=1023;
|
||||
if (chan[3].actualNote>0x5d) chan[3].freq=0x01;
|
||||
if (parent->song.snNoLowPeriods) {
|
||||
if (chan[3].actualNote>0x5d) chan[3].freq=0x01;
|
||||
}
|
||||
if (snNoiseMode&2) { // take period from channel 3
|
||||
if (updateSNMode || resetPhase) {
|
||||
if (snNoiseMode&1) {
|
||||
|
|
|
|||
|
|
@ -500,6 +500,7 @@ struct DivSong {
|
|||
bool brokenOutVol;
|
||||
bool e1e2StopOnSameNote;
|
||||
bool brokenPortaArp;
|
||||
bool snNoLowPeriods;
|
||||
|
||||
std::vector<DivInstrument*> ins;
|
||||
std::vector<DivWavetable*> wave;
|
||||
|
|
@ -600,7 +601,8 @@ struct DivSong {
|
|||
volMacroLinger(true),
|
||||
brokenOutVol(false),
|
||||
e1e2StopOnSameNote(false),
|
||||
brokenPortaArp(false) {
|
||||
brokenPortaArp(false),
|
||||
snNoLowPeriods(false) {
|
||||
for (int i=0; i<32; i++) {
|
||||
system[i]=DIV_SYSTEM_NULL;
|
||||
systemVol[i]=64;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue