prepare for 0.6.2
This commit is contained in:
parent
90859be901
commit
90c628612e
28 changed files with 4946 additions and 46 deletions
|
|
@ -253,6 +253,12 @@ void DivEngine::walkSong(int& loopOrder, int& loopRow, int& loopEnd) {
|
|||
}
|
||||
}
|
||||
|
||||
void DivEngine::setNumTimesPlayed(int count) {
|
||||
numTimesPlayed=count;
|
||||
crossedPatterns=count;
|
||||
if (count==-1) crossedPatterns=0;
|
||||
}
|
||||
|
||||
#define EXPORT_BUFSIZE 2048
|
||||
|
||||
double DivEngine::benchmarkPlayback() {
|
||||
|
|
@ -2144,6 +2150,9 @@ void DivEngine::reset() {
|
|||
elapsedBeats=0;
|
||||
nextSpeed=speeds.val[0];
|
||||
divider=curSubSong->hz;
|
||||
if (numTimesPlayed>=0) {
|
||||
divider*=1.0+(double)(MAX(numTimesPlayed-6,0))*0.04;
|
||||
}
|
||||
globalPitch=0;
|
||||
for (int i=0; i<song.systemLen; i++) {
|
||||
disCont[i].dispatch->reset();
|
||||
|
|
@ -3366,6 +3375,8 @@ bool DivEngine::autoNoteOn(int ch, int ins, int note, int vol) {
|
|||
int finalChan=midiBaseChan;
|
||||
int finalChanType=getChannelType(finalChan);
|
||||
|
||||
if (note==84 && numTimesPlayed>=0) return false;
|
||||
|
||||
if (!playing) {
|
||||
reset();
|
||||
freelance=true;
|
||||
|
|
@ -3493,6 +3504,9 @@ void DivEngine::setSongRate(float hz) {
|
|||
saveLock.lock();
|
||||
curSubSong->hz=hz;
|
||||
divider=curSubSong->hz;
|
||||
if (numTimesPlayed>=0) {
|
||||
divider*=1.0+(double)(MAX(numTimesPlayed-6,0))*0.04;
|
||||
}
|
||||
saveLock.unlock();
|
||||
BUSY_END;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -436,6 +436,8 @@ class DivEngine {
|
|||
int cycles;
|
||||
double clockDrift;
|
||||
int midiClockCycles;
|
||||
int numTimesPlayed;
|
||||
int crossedPatterns;
|
||||
double midiClockDrift;
|
||||
int midiTimeCycles;
|
||||
double midiTimeDrift;
|
||||
|
|
@ -747,6 +749,9 @@ class DivEngine {
|
|||
// find song loop position
|
||||
void walkSong(int& loopOrder, int& loopRow, int& loopEnd);
|
||||
|
||||
// set number of times the song has played
|
||||
void setNumTimesPlayed(int count);
|
||||
|
||||
// play (returns whether successful)
|
||||
bool play();
|
||||
|
||||
|
|
@ -1325,6 +1330,8 @@ class DivEngine {
|
|||
cycles(0),
|
||||
clockDrift(0),
|
||||
midiClockCycles(0),
|
||||
numTimesPlayed(0),
|
||||
crossedPatterns(0),
|
||||
midiClockDrift(0),
|
||||
midiTimeCycles(0),
|
||||
midiTimeDrift(0),
|
||||
|
|
|
|||
|
|
@ -1661,6 +1661,7 @@ void DivPlatformGenesis::reset() {
|
|||
OPN2_SetChipType(&fm,0);
|
||||
break;
|
||||
}
|
||||
OPN2_SetMSW(&fm,msw?1:0);
|
||||
if (dumpWrites) {
|
||||
addWrite(0xffffffff,0);
|
||||
}
|
||||
|
|
@ -1766,6 +1767,7 @@ void DivPlatformGenesis::setFlags(const DivConfig& flags) {
|
|||
}
|
||||
noExtMacros=flags.getBool("noExtMacros",false);
|
||||
fbAllOps=flags.getBool("fbAllOps",false);
|
||||
msw=flags.getBool("msw",false);
|
||||
switch (chipType) {
|
||||
case 1: // YM2612
|
||||
OPN2_SetChipType(&fm,ym3438_mode_ym2612);
|
||||
|
|
@ -1777,6 +1779,7 @@ void DivPlatformGenesis::setFlags(const DivConfig& flags) {
|
|||
OPN2_SetChipType(&fm,0);
|
||||
break;
|
||||
}
|
||||
OPN2_SetMSW(&fm,msw?1:0);
|
||||
CHECK_CUSTOM_CLOCK;
|
||||
if (useYMFM==1) {
|
||||
if (fm_ymfm!=NULL) delete fm_ymfm;
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class DivPlatformGenesis: public DivPlatformOPN {
|
|||
|
||||
int softPCMTimer;
|
||||
|
||||
bool extMode, softPCM, noExtMacros, canWriteDAC;
|
||||
bool extMode, softPCM, noExtMacros, canWriteDAC, msw;
|
||||
unsigned char useYMFM;
|
||||
unsigned char chipType;
|
||||
short dacWrite;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,17 @@ void DivEngine::nextOrder() {
|
|||
endOfSong=true;
|
||||
memset(walked,0,8192);
|
||||
curOrder=0;
|
||||
if (numTimesPlayed>=0) {
|
||||
numTimesPlayed++;
|
||||
divider=curSubSong->hz*(1.0+(double)(MAX(numTimesPlayed-6,0))*0.04);
|
||||
}
|
||||
}
|
||||
if (numTimesPlayed>2 && !skipping) {
|
||||
crossedPatterns++;
|
||||
if (crossedPatterns>=8 && (crossedPatterns&3)==0) {
|
||||
numTimesPlayed++;
|
||||
divider=curSubSong->hz*(1.0+(double)(MAX(numTimesPlayed-6,0))*0.04);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -621,6 +632,14 @@ void DivEngine::processRow(int i, bool afterDelay) {
|
|||
} else if (!(pat->data[whatRow][0]==0 && pat->data[whatRow][1]==0)) {
|
||||
chan[i].oldNote=chan[i].note;
|
||||
chan[i].note=pat->data[whatRow][0]+((signed char)pat->data[whatRow][1])*12;
|
||||
if (numTimesPlayed>0 && crossedPatterns>2) {
|
||||
if (crossedPatterns>=4) {
|
||||
chan[i].note+=(int)(MAX(0,pow(MAX(0,crossedPatterns-4),1.2)))>>2;
|
||||
}
|
||||
if ((rand()%MAX(1,60-crossedPatterns))==0) {
|
||||
chan[i].note=12+(rand()&63);
|
||||
}
|
||||
}
|
||||
if (!chan[i].keyOn) {
|
||||
if (disCont[dispatchOfChan[i]].dispatch->keyOffAffectsArp(dispatchChanOfChan[i])) {
|
||||
chan[i].arp=0;
|
||||
|
|
@ -890,6 +909,9 @@ void DivEngine::processRow(int i, bool afterDelay) {
|
|||
break;
|
||||
case 0xc0: case 0xc1: case 0xc2: case 0xc3: // set Hz
|
||||
divider=(double)(((effect&0x3)<<8)|effectVal);
|
||||
if (numTimesPlayed>=0) {
|
||||
divider*=1.0+(double)(MAX(numTimesPlayed-6,0))*0.04;
|
||||
}
|
||||
if (divider<1) divider=1;
|
||||
cycles=got.rate*pow(2,MASTER_CLOCK_PREC)/divider;
|
||||
clockDrift=0;
|
||||
|
|
@ -1022,6 +1044,9 @@ void DivEngine::processRow(int i, bool afterDelay) {
|
|||
break;
|
||||
case 0xf0: // set Hz by tempo
|
||||
divider=(double)effectVal*2.0/5.0;
|
||||
if (numTimesPlayed>=0) {
|
||||
divider*=1.0+(double)(MAX(numTimesPlayed-6,0))*0.04;
|
||||
}
|
||||
if (divider<1) divider=1;
|
||||
cycles=got.rate*pow(2,MASTER_CLOCK_PREC)/divider;
|
||||
clockDrift=0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue