fix broken DAC mode
adds new compat flag
This commit is contained in:
parent
b73591970d
commit
2a0aa19b2b
6 changed files with 36 additions and 6 deletions
|
|
@ -37,8 +37,8 @@
|
|||
warnings+=(String("\n")+x); \
|
||||
}
|
||||
|
||||
#define DIV_VERSION "dev63"
|
||||
#define DIV_ENGINE_VERSION 63
|
||||
#define DIV_VERSION "dev64"
|
||||
#define DIV_ENGINE_VERSION 64
|
||||
|
||||
enum DivStatusView {
|
||||
DIV_STATUS_NOTHING=0,
|
||||
|
|
|
|||
|
|
@ -140,6 +140,7 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
|
|||
ds.algMacroBehavior=false;
|
||||
ds.brokenShortcutSlides=false;
|
||||
ds.ignoreDuplicateSlides=true;
|
||||
ds.brokenDACMode=true;
|
||||
|
||||
// 1.1 compat flags
|
||||
if (ds.version>24) {
|
||||
|
|
@ -799,6 +800,9 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
|
|||
if (ds.version<62) {
|
||||
ds.stopPortaOnNoteOff=true;
|
||||
}
|
||||
if (ds.version<64) {
|
||||
ds.brokenDACMode=false;
|
||||
}
|
||||
ds.isDMF=false;
|
||||
|
||||
reader.readS(); // reserved
|
||||
|
|
@ -975,7 +979,12 @@ bool DivEngine::loadFur(unsigned char* file, size_t len) {
|
|||
reader.readC();
|
||||
reader.readC();
|
||||
}
|
||||
for (int i=0; i<4; i++) reader.readC();
|
||||
if (ds.version>=64) {
|
||||
ds.brokenDACMode=reader.readC();
|
||||
} else {
|
||||
reader.readC();
|
||||
}
|
||||
for (int i=0; i<3; i++) reader.readC();
|
||||
} else {
|
||||
for (int i=0; i<20; i++) reader.readC();
|
||||
}
|
||||
|
|
@ -1417,7 +1426,8 @@ SafeWriter* DivEngine::saveFur() {
|
|||
w->writeC(song.ignoreDuplicateSlides);
|
||||
w->writeC(song.stopPortaOnNoteOff);
|
||||
w->writeC(song.continuousVibrato);
|
||||
for (int i=0; i<4; i++) {
|
||||
w->writeC(song.brokenDACMode);
|
||||
for (int i=0; i<3; i++) {
|
||||
w->writeC(0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -99,6 +99,9 @@ void DivPlatformGenesis::acquire_nuked(short* bufL, short* bufR, size_t start, s
|
|||
dacPos=s->loopStart;
|
||||
} else {
|
||||
dacSample=-1;
|
||||
if (parent->song.brokenDACMode) {
|
||||
rWrite(0x2b,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
dacPeriod+=MAX(40,dacRate);
|
||||
|
|
@ -163,6 +166,9 @@ void DivPlatformGenesis::acquire_ymfm(short* bufL, short* bufR, size_t start, si
|
|||
dacPos=s->loopStart;
|
||||
} else {
|
||||
dacSample=-1;
|
||||
if (parent->song.brokenDACMode) {
|
||||
rWrite(0x2b,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
dacPeriod+=MAX(40,dacRate);
|
||||
|
|
@ -460,6 +466,7 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
|
|||
if (dumpWrites) addWrite(0xffff0002,0);
|
||||
break;
|
||||
} else {
|
||||
rWrite(0x2b,1<<7);
|
||||
if (dumpWrites) addWrite(0xffff0000,dacSample);
|
||||
}
|
||||
dacPos=0;
|
||||
|
|
@ -477,6 +484,7 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
|
|||
if (dumpWrites) addWrite(0xffff0002,0);
|
||||
break;
|
||||
} else {
|
||||
rWrite(0x2b,1<<7);
|
||||
if (dumpWrites) addWrite(0xffff0000,dacSample);
|
||||
}
|
||||
dacPos=0;
|
||||
|
|
@ -541,6 +549,10 @@ int DivPlatformGenesis::dispatch(DivCommand c) {
|
|||
if (c.chan==5) {
|
||||
dacSample=-1;
|
||||
if (dumpWrites) addWrite(0xffff0002,0);
|
||||
if (parent->song.brokenDACMode) {
|
||||
rWrite(0x2b,0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
chan[c.chan].keyOff=true;
|
||||
chan[c.chan].keyOn=false;
|
||||
|
|
|
|||
|
|
@ -295,6 +295,7 @@ struct DivSong {
|
|||
bool ignoreDuplicateSlides;
|
||||
bool stopPortaOnNoteOff;
|
||||
bool continuousVibrato;
|
||||
bool brokenDACMode;
|
||||
|
||||
DivOrders orders;
|
||||
std::vector<DivInstrument*> ins;
|
||||
|
|
@ -359,7 +360,8 @@ struct DivSong {
|
|||
brokenShortcutSlides(false),
|
||||
ignoreDuplicateSlides(false),
|
||||
stopPortaOnNoteOff(false),
|
||||
continuousVibrato(false) {
|
||||
continuousVibrato(false),
|
||||
brokenDACMode(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