the final piece of f-num/block work

This commit is contained in:
tildearrow 2022-04-24 14:40:07 -05:00
parent dd9bb8327a
commit 23be8d9336
6 changed files with 41 additions and 13 deletions

View file

@ -43,8 +43,8 @@
#define BUSY_BEGIN_SOFT softLocked=true; isBusy.lock();
#define BUSY_END isBusy.unlock(); softLocked=false;
#define DIV_VERSION "dev84"
#define DIV_ENGINE_VERSION 84
#define DIV_VERSION "dev85"
#define DIV_ENGINE_VERSION 85
// for imports
#define DIV_VERSION_MOD 0xff01

View file

@ -162,6 +162,7 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
ds.gbInsAffectsEnvelope=true;
ds.ignoreDACModeOutsideIntendedChannel=false;
ds.e1e2AlsoTakePriority=true;
ds.fbPortaPause=true;
// 1.1 compat flags
if (ds.version>24) {
@ -993,6 +994,9 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
if (ds.version<84) {
ds.newSegaPCM=false;
}
if (ds.version<85) {
ds.fbPortaPause=true;
}
ds.isDMF=false;
reader.readS(); // reserved
@ -1342,7 +1346,12 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
} else {
reader.readC();
}
for (int i=0; i<22; i++) {
if (ds.version>=85) {
ds.fbPortaPause=reader.readC();
} else {
reader.readC();
}
for (int i=0; i<21; i++) {
reader.readC();
}
}
@ -2283,7 +2292,8 @@ SafeWriter* DivEngine::saveFur(bool notPrimary) {
w->writeC(song.ignoreDACModeOutsideIntendedChannel);
w->writeC(song.e1e2AlsoTakePriority);
w->writeC(song.newSegaPCM);
for (int i=0; i<22; i++) {
w->writeC(song.fbPortaPause);
for (int i=0; i<21; i++) {
w->writeC(0);
}

View file

@ -149,14 +149,22 @@ int DivPlatformGenesisExt::dispatch(DivCommand c) {
// what the heck!
if (!opChan[ch].portaPause) {
if ((newFreq&0x7ff)>1288) {
opChan[ch].portaPauseFreq=(644)|((newFreq+0x800)&0xf800);
opChan[ch].portaPause=true;
break;
if (parent->song.fbPortaPause) {
opChan[ch].portaPauseFreq=(644)|((newFreq+0x800)&0xf800);
opChan[ch].portaPause=true;
break;
} else {
newFreq=(newFreq>>1)|((newFreq+0x800)&0xf800);
}
}
if ((newFreq&0x7ff)<644) {
opChan[ch].portaPauseFreq=newFreq=(1287)|((newFreq-0x800)&0xf800);
opChan[ch].portaPause=true;
break;
if (parent->song.fbPortaPause) {
opChan[ch].portaPauseFreq=newFreq=(1287)|((newFreq-0x800)&0xf800);
opChan[ch].portaPause=true;
break;
} else {
newFreq=(newFreq<<1)|((newFreq-0x800)&0xf800);
}
}
}
opChan[ch].portaPause=false;

View file

@ -324,6 +324,7 @@ struct DivSong {
bool ignoreDACModeOutsideIntendedChannel;
bool e1e2AlsoTakePriority;
bool newSegaPCM;
bool fbPortaPause;
DivOrders orders;
std::vector<DivInstrument*> ins;
@ -406,7 +407,8 @@ struct DivSong {
sharedExtStat(true),
ignoreDACModeOutsideIntendedChannel(false),
e1e2AlsoTakePriority(false),
newSegaPCM(true) {
newSegaPCM(true),
fbPortaPause(false) {
for (int i=0; i<32; i++) {
system[i]=DIV_SYSTEM_NULL;
systemVol[i]=64;