dev112 - prepare for advanced arp macro
this new advanced arp macro offers more flexibility and reduces code duplication it allows you to set each step of the macro to either relative or fixed mode (instead of just one mode for the entire macro) the UI is still a work in progress and doesn't work well this change is big and may break things! further fixes incoming
This commit is contained in:
parent
d406380773
commit
c009cb3536
|
@ -32,6 +32,7 @@ these fields are 0 in format versions prior to 100 (0.6pre1).
|
||||||
|
|
||||||
the format versions are:
|
the format versions are:
|
||||||
|
|
||||||
|
- 112: Furnace dev112
|
||||||
- 111: Furnace dev111
|
- 111: Furnace dev111
|
||||||
- 110: Furnace dev110
|
- 110: Furnace dev110
|
||||||
- 109: Furnace dev109
|
- 109: Furnace dev109
|
||||||
|
@ -454,6 +455,7 @@ size | description
|
||||||
| - 29: SNES
|
| - 29: SNES
|
||||||
| - 30: Sound Unit
|
| - 30: Sound Unit
|
||||||
| - 31: Namco WSG
|
| - 31: Namco WSG
|
||||||
|
| - 32: OPL (drums)
|
||||||
1 | reserved
|
1 | reserved
|
||||||
STR | instrument name
|
STR | instrument name
|
||||||
--- | **FM instrument data**
|
--- | **FM instrument data**
|
||||||
|
@ -545,7 +547,18 @@ size | description
|
||||||
4 | extra 1 macro loop (>=17)
|
4 | extra 1 macro loop (>=17)
|
||||||
4 | extra 2 macro loop (>=17)
|
4 | extra 2 macro loop (>=17)
|
||||||
4 | extra 3 macro loop (>=17)
|
4 | extra 3 macro loop (>=17)
|
||||||
1 | arp macro mode
|
1 | arp macro mode (<112) or reserved
|
||||||
|
| - treat this value in a special way.
|
||||||
|
| - before version 112, this byte indicates whether the arp macro mode is fixed or not.
|
||||||
|
| - from that version onwards, the fixed mode is part of the macro values.
|
||||||
|
| - to convert a <112 macro mode to a modern one, do the following:
|
||||||
|
| - is the macro mode set to fixed?
|
||||||
|
| - if yes, then:
|
||||||
|
| - set bit 30 of all arp macro values (this is the fixed mode bit)
|
||||||
|
| - does the macro loop?
|
||||||
|
| - if yes, then do nothing else
|
||||||
|
| - if no, then add one to the macro length, and set the last macro value to 0
|
||||||
|
| - if no, then do nothing
|
||||||
1 | reserved (>=17) or volume macro height (>=15) or reserved
|
1 | reserved (>=17) or volume macro height (>=15) or reserved
|
||||||
1 | reserved (>=17) or duty macro height (>=15) or reserved
|
1 | reserved (>=17) or duty macro height (>=15) or reserved
|
||||||
1 | reserved (>=17) or wave macro height (>=15) or reserved
|
1 | reserved (>=17) or wave macro height (>=15) or reserved
|
||||||
|
@ -553,6 +566,7 @@ size | description
|
||||||
| - before version 87, if this is the C64 relative cutoff macro, its values were stored offset by 18.
|
| - before version 87, if this is the C64 relative cutoff macro, its values were stored offset by 18.
|
||||||
4?? | arp macro
|
4?? | arp macro
|
||||||
| - before version 31, this macro's values were stored offset by 12.
|
| - before version 31, this macro's values were stored offset by 12.
|
||||||
|
| - from version 112 onward, bit 30 of a value indicates fixed mode.
|
||||||
4?? | duty macro
|
4?? | duty macro
|
||||||
| - before version 87, if this is the C64 relative duty macro, its values were stored offset by 12.
|
| - before version 87, if this is the C64 relative duty macro, its values were stored offset by 12.
|
||||||
4?? | wave macro
|
4?? | wave macro
|
||||||
|
|
|
@ -1712,6 +1712,11 @@ int DivEngine::calcFreq(int base, int pitch, bool period, int octave, int pitch2
|
||||||
base+((pitch*octave)>>1)+pitch2;
|
base+((pitch*octave)>>1)+pitch2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int DivEngine::calcArp(int note, int arp, int offset) {
|
||||||
|
if (arp&0x40000000) return (arp&(~0x40000000))+offset;
|
||||||
|
return note+arp;
|
||||||
|
}
|
||||||
|
|
||||||
int DivEngine::convertPanSplitToLinear(unsigned int val, unsigned char bits, int range) {
|
int DivEngine::convertPanSplitToLinear(unsigned int val, unsigned char bits, int range) {
|
||||||
int panL=val>>bits;
|
int panL=val>>bits;
|
||||||
int panR=val&((1<<bits)-1);
|
int panR=val&((1<<bits)-1);
|
||||||
|
|
|
@ -46,8 +46,8 @@
|
||||||
#define BUSY_BEGIN_SOFT softLocked=true; isBusy.lock();
|
#define BUSY_BEGIN_SOFT softLocked=true; isBusy.lock();
|
||||||
#define BUSY_END isBusy.unlock(); softLocked=false;
|
#define BUSY_END isBusy.unlock(); softLocked=false;
|
||||||
|
|
||||||
#define DIV_VERSION "dev111"
|
#define DIV_VERSION "dev112"
|
||||||
#define DIV_ENGINE_VERSION 111
|
#define DIV_ENGINE_VERSION 112
|
||||||
|
|
||||||
// for imports
|
// for imports
|
||||||
#define DIV_VERSION_MOD 0xff01
|
#define DIV_VERSION_MOD 0xff01
|
||||||
|
@ -554,6 +554,9 @@ class DivEngine {
|
||||||
// calculate frequency/period
|
// calculate frequency/period
|
||||||
int calcFreq(int base, int pitch, bool period=false, int octave=0, int pitch2=0, double clock=1.0, double divider=1.0, int blockBits=0);
|
int calcFreq(int base, int pitch, bool period=false, int octave=0, int pitch2=0, double clock=1.0, double divider=1.0, int blockBits=0);
|
||||||
|
|
||||||
|
// calculate arpeggio
|
||||||
|
int calcArp(int note, int arp, int offset=0);
|
||||||
|
|
||||||
// convert panning formats
|
// convert panning formats
|
||||||
int convertPanSplitToLinear(unsigned int val, unsigned char bits, int range);
|
int convertPanSplitToLinear(unsigned int val, unsigned char bits, int range);
|
||||||
int convertPanSplitToLinearLR(unsigned char left, unsigned char right, int range);
|
int convertPanSplitToLinearLR(unsigned char left, unsigned char right, int range);
|
||||||
|
|
|
@ -507,6 +507,14 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
|
||||||
for (int j=0; j<ins->std.arpMacro.len; j++) {
|
for (int j=0; j<ins->std.arpMacro.len; j++) {
|
||||||
ins->std.arpMacro.val[j]-=12;
|
ins->std.arpMacro.val[j]-=12;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
ins->std.arpMacro.mode=0;
|
||||||
|
for (int j=0; j<ins->std.arpMacro.len; j++) {
|
||||||
|
ins->std.arpMacro.val[i]|=0x40000000;
|
||||||
|
}
|
||||||
|
if (ins->std.arpMacro.loop<ins->std.arpMacro.len && ins->std.arpMacro.len<255) {
|
||||||
|
ins->std.arpMacro.val[ins->std.arpMacro.len++]=0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ins->std.dutyMacro.len=reader.readC();
|
ins->std.dutyMacro.len=reader.readC();
|
||||||
|
@ -2886,9 +2894,6 @@ bool DivEngine::loadFC(unsigned char* file, size_t len) {
|
||||||
loopMapFreq[j]=ins->std.arpMacro.len;
|
loopMapFreq[j]=ins->std.arpMacro.len;
|
||||||
loopMapWave[j]=ins->std.waveMacro.len;
|
loopMapWave[j]=ins->std.waveMacro.len;
|
||||||
if (fm.val[j]==0xe1) {
|
if (fm.val[j]==0xe1) {
|
||||||
if (ins->std.arpMacro.mode) {
|
|
||||||
ins->std.arpMacro.loop=(signed int)ins->std.arpMacro.len-1;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
} else if (fm.val[j]==0xe2 || fm.val[j]==0xe4) {
|
} else if (fm.val[j]==0xe2 || fm.val[j]==0xe4) {
|
||||||
if (++j>=64) break;
|
if (++j>=64) break;
|
||||||
|
@ -2923,8 +2928,7 @@ bool DivEngine::loadFC(unsigned char* file, size_t len) {
|
||||||
logV("unhandled pitch!");
|
logV("unhandled pitch!");
|
||||||
} else {
|
} else {
|
||||||
if (fm.val[j]>0x80) {
|
if (fm.val[j]>0x80) {
|
||||||
ins->std.arpMacro.val[ins->std.arpMacro.len]=fm.val[j]-0x80+24;
|
ins->std.arpMacro.val[ins->std.arpMacro.len]=(fm.val[j]-0x80+24)|0x40000000;
|
||||||
ins->std.arpMacro.mode=1; // TODO: variable fixed/relative mode
|
|
||||||
} else {
|
} else {
|
||||||
ins->std.arpMacro.val[ins->std.arpMacro.len]=fm.val[j];
|
ins->std.arpMacro.val[ins->std.arpMacro.len]=fm.val[j];
|
||||||
}
|
}
|
||||||
|
@ -3293,6 +3297,7 @@ bool DivEngine::loadFTM(unsigned char* file, size_t len) {
|
||||||
ins->std.arpMacro.len=reader.readC();
|
ins->std.arpMacro.len=reader.readC();
|
||||||
ins->std.arpMacro.loop=reader.readI();
|
ins->std.arpMacro.loop=reader.readI();
|
||||||
ins->std.arpMacro.rel=reader.readI();
|
ins->std.arpMacro.rel=reader.readI();
|
||||||
|
// TODO: get rid
|
||||||
ins->std.arpMacro.mode=reader.readI();
|
ins->std.arpMacro.mode=reader.readI();
|
||||||
for (int j=0; j<ins->std.arpMacro.len; j++) {
|
for (int j=0; j<ins->std.arpMacro.len; j++) {
|
||||||
ins->std.arpMacro.val[j]=reader.readC();
|
ins->std.arpMacro.val[j]=reader.readC();
|
||||||
|
@ -4204,6 +4209,7 @@ SafeWriter* DivEngine::saveDMF(unsigned char version) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: take care of new arp macro format
|
||||||
w->writeC(i->std.arpMacro.len);
|
w->writeC(i->std.arpMacro.len);
|
||||||
if (i->std.arpMacro.mode) {
|
if (i->std.arpMacro.mode) {
|
||||||
for (int j=0; j<i->std.arpMacro.len; j++) {
|
for (int j=0; j<i->std.arpMacro.len; j++) {
|
||||||
|
|
|
@ -132,7 +132,7 @@ void DivInstrument::putInsData(SafeWriter* w) {
|
||||||
w->writeI(std.ex1Macro.loop);
|
w->writeI(std.ex1Macro.loop);
|
||||||
w->writeI(std.ex2Macro.loop);
|
w->writeI(std.ex2Macro.loop);
|
||||||
w->writeI(std.ex3Macro.loop);
|
w->writeI(std.ex3Macro.loop);
|
||||||
w->writeC(std.arpMacro.mode);
|
w->writeC(0); // this was arp macro mode
|
||||||
w->writeC(0); // reserved
|
w->writeC(0); // reserved
|
||||||
w->writeC(0);
|
w->writeC(0);
|
||||||
w->writeC(0);
|
w->writeC(0);
|
||||||
|
@ -1342,6 +1342,19 @@ DivDataErrors DivInstrument::readInsData(SafeReader& reader, short version) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// old arp macro format
|
||||||
|
if (version<112) {
|
||||||
|
if (std.arpMacro.mode) {
|
||||||
|
std.arpMacro.mode=0;
|
||||||
|
for (int i=0; i<std.arpMacro.len; i++) {
|
||||||
|
std.arpMacro.val[i]|=0x40000000;
|
||||||
|
}
|
||||||
|
if (std.arpMacro.loop<std.arpMacro.len && std.arpMacro.rel>std.arpMacro.loop && std.arpMacro.len<255) {
|
||||||
|
std.arpMacro.val[std.arpMacro.len++]=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return DIV_DATA_SUCCESS;
|
return DIV_DATA_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -163,19 +163,9 @@ void DivPlatformAmiga::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
// TODO: why the off mult? this may be a bug!
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=round(off*NOTE_PERIODIC_NOROUND(parent->calcArp(chan[i].note,chan[i].std.arp.val)));
|
||||||
chan[i].baseFreq=round(off*NOTE_PERIODIC_NOROUND(chan[i].std.arp.val));
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=round(off*NOTE_PERIODIC_NOROUND(chan[i].note+chan[i].std.arp.val));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=round(off*NOTE_PERIODIC_NOROUND(chan[i].note));
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].useWave && chan[i].std.wave.had) {
|
if (chan[i].useWave && chan[i].std.wave.had) {
|
||||||
if (chan[i].wave!=chan[i].std.wave.val || chan[i].ws.activeChanged()) {
|
if (chan[i].wave!=chan[i].std.wave.val || chan[i].ws.activeChanged()) {
|
||||||
|
|
|
@ -161,18 +161,9 @@ void DivPlatformArcade::tick(bool sysTick) {
|
||||||
|
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_LINEAR(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_LINEAR(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_LINEAR(chan[i].note+(signed char)chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_LINEAR(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chan[i].std.duty.had) {
|
if (chan[i].std.duty.had) {
|
||||||
|
|
|
@ -159,18 +159,9 @@ void DivPlatformAY8910::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.duty.had) {
|
if (chan[i].std.duty.had) {
|
||||||
rWrite(0x06,31-chan[i].std.duty.val);
|
rWrite(0x06,31-chan[i].std.duty.val);
|
||||||
|
|
|
@ -167,18 +167,9 @@ void DivPlatformAY8930::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.duty.had) {
|
if (chan[i].std.duty.had) {
|
||||||
rWrite(0x06,chan[i].std.duty.val);
|
rWrite(0x06,chan[i].std.duty.val);
|
||||||
|
|
|
@ -92,18 +92,9 @@ void DivPlatformBubSysWSG::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.wave.had) {
|
if (chan[i].std.wave.had) {
|
||||||
if (chan[i].wave!=chan[i].std.wave.val || chan[i].ws.activeChanged()) {
|
if (chan[i].wave!=chan[i].std.wave.val || chan[i].ws.activeChanged()) {
|
||||||
|
|
|
@ -104,18 +104,9 @@ void DivPlatformC64::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].note+(signed char)chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.duty.had) {
|
if (chan[i].std.duty.had) {
|
||||||
DivInstrument* ins=parent->getIns(chan[i].ins,DIV_INS_C64);
|
DivInstrument* ins=parent->getIns(chan[i].ins,DIV_INS_C64);
|
||||||
|
|
|
@ -121,18 +121,9 @@ void DivPlatformFDS::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
if (chan[i].std.duty.had) {
|
if (chan[i].std.duty.had) {
|
||||||
|
|
|
@ -165,28 +165,13 @@ void DivPlatformGB::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (i==3) { // noise
|
if (i==3) { // noise
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=parent->calcArp(chan[i].note,chan[i].std.arp.val,24);
|
||||||
chan[i].baseFreq=chan[i].std.arp.val+24;
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=chan[i].note+chan[i].std.arp.val;
|
|
||||||
}
|
|
||||||
if (chan[i].baseFreq>255) chan[i].baseFreq=255;
|
if (chan[i].baseFreq>255) chan[i].baseFreq=255;
|
||||||
if (chan[i].baseFreq<0) chan[i].baseFreq=0;
|
if (chan[i].baseFreq<0) chan[i].baseFreq=0;
|
||||||
} else {
|
} else {
|
||||||
if (!chan[i].inPorta) {
|
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
if (chan[i].std.arp.mode) {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].std.arp.val+24);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.duty.had) {
|
if (chan[i].std.duty.had) {
|
||||||
chan[i].duty=chan[i].std.duty.val;
|
chan[i].duty=chan[i].std.duty.val;
|
||||||
|
|
|
@ -266,34 +266,16 @@ void DivPlatformGenesis::tick(bool sysTick) {
|
||||||
if (i>=5 && chan[i].furnaceDac) {
|
if (i>=5 && chan[i].furnaceDac) {
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=parent->calcBaseFreq(1,1,parent->calcArp(chan[i].note,chan[i].std.arp.val),false);
|
||||||
chan[i].baseFreq=parent->calcBaseFreq(1,1,chan[i].std.arp.val,false);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=parent->calcBaseFreq(1,1,chan[i].note+(signed char)chan[i].std.arp.val,false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=parent->calcBaseFreq(1,1,chan[i].note,false);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_FNUM_BLOCK(parent->calcArp(chan[i].note,chan[i].std.arp.val),11);
|
||||||
chan[i].baseFreq=NOTE_FNUM_BLOCK(chan[i].std.arp.val,11);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_FNUM_BLOCK(chan[i].note+(signed char)chan[i].std.arp.val,11);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_FNUM_BLOCK(chan[i].note,11);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -172,22 +172,9 @@ void DivPlatformLynx::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].actualNote=parent->calcArp(chan[i].note,chan[i].std.arp.val);
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].std.arp.val);
|
chan[i].baseFreq=NOTE_PERIODIC(chan[i].actualNote);
|
||||||
if (chan[i].pcm) chan[i].sampleBaseFreq=parent->calcBaseFreq(1.0,1.0,chan[i].std.arp.val,false);
|
if (chan[i].pcm) chan[i].sampleBaseFreq=parent->calcBaseFreq(1.0,1.0,chan[i].actualNote,false);
|
||||||
chan[i].actualNote=chan[i].std.arp.val;
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note+chan[i].std.arp.val);
|
|
||||||
if (chan[i].pcm) chan[i].sampleBaseFreq=parent->calcBaseFreq(1.0,1.0,chan[i].note+chan[i].std.arp.val,false);
|
|
||||||
chan[i].actualNote=chan[i].note+chan[i].std.arp.val;
|
|
||||||
}
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note);
|
|
||||||
if (chan[i].pcm) chan[i].sampleBaseFreq=parent->calcBaseFreq(1.0,1.0,chan[i].note,false);
|
|
||||||
chan[i].actualNote=chan[i].note;
|
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,20 +101,12 @@ void DivPlatformMMC5::tick(bool sysTick) {
|
||||||
if (chan[i].outVol<0) chan[i].outVol=0;
|
if (chan[i].outVol<0) chan[i].outVol=0;
|
||||||
rWrite(0x5000+i*4,0x30|chan[i].outVol|((chan[i].duty&3)<<6));
|
rWrite(0x5000+i*4,0x30|chan[i].outVol|((chan[i].duty&3)<<6));
|
||||||
}
|
}
|
||||||
|
// TODO: arp macros on NES PCM?
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.duty.had) {
|
if (chan[i].std.duty.had) {
|
||||||
chan[i].duty=chan[i].std.duty.val;
|
chan[i].duty=chan[i].std.duty.val;
|
||||||
|
|
|
@ -189,18 +189,9 @@ void DivPlatformN163::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].note+(signed char)chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.duty.had) {
|
if (chan[i].std.duty.had) {
|
||||||
if (chan[i].wavePos!=chan[i].std.duty.val) {
|
if (chan[i].wavePos!=chan[i].std.duty.val) {
|
||||||
|
|
|
@ -206,18 +206,9 @@ void DivPlatformNamcoWSG::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.wave.had) {
|
if (chan[i].std.wave.had) {
|
||||||
if (chan[i].wave!=chan[i].std.wave.val || chan[i].ws.activeChanged()) {
|
if (chan[i].wave!=chan[i].std.wave.val || chan[i].ws.activeChanged()) {
|
||||||
|
|
|
@ -219,28 +219,15 @@ void DivPlatformNES::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (i==3) { // noise
|
if (i==3) { // noise
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=parent->calcArp(chan[i].note,chan[i].std.arp.val);
|
||||||
chan[i].baseFreq=chan[i].std.arp.val;
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=chan[i].note+chan[i].std.arp.val;
|
|
||||||
}
|
|
||||||
if (chan[i].baseFreq>255) chan[i].baseFreq=255;
|
if (chan[i].baseFreq>255) chan[i].baseFreq=255;
|
||||||
if (chan[i].baseFreq<0) chan[i].baseFreq=0;
|
if (chan[i].baseFreq<0) chan[i].baseFreq=0;
|
||||||
} else {
|
} else {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.duty.had) {
|
if (chan[i].std.duty.had) {
|
||||||
chan[i].duty=chan[i].std.duty.val;
|
chan[i].duty=chan[i].std.duty.val;
|
||||||
|
|
|
@ -297,18 +297,9 @@ void DivPlatformOPL::tick(bool sysTick) {
|
||||||
|
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].note+(signed char)chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oplType==3 && chan[i].std.panL.had) {
|
if (oplType==3 && chan[i].std.panL.had) {
|
||||||
|
@ -491,18 +482,9 @@ void DivPlatformOPL::tick(bool sysTick) {
|
||||||
|
|
||||||
if (chan[adpcmChan].std.arp.had) {
|
if (chan[adpcmChan].std.arp.had) {
|
||||||
if (!chan[adpcmChan].inPorta) {
|
if (!chan[adpcmChan].inPorta) {
|
||||||
if (chan[adpcmChan].std.arp.mode) {
|
chan[adpcmChan].baseFreq=NOTE_ADPCMB(parent->calcArp(chan[adpcmChan].note,chan[adpcmChan].std.arp.val));
|
||||||
chan[adpcmChan].baseFreq=NOTE_ADPCMB(chan[adpcmChan].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[adpcmChan].baseFreq=NOTE_ADPCMB(chan[adpcmChan].note+(signed char)chan[adpcmChan].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[adpcmChan].freqChanged=true;
|
chan[adpcmChan].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[adpcmChan].std.arp.mode && chan[adpcmChan].std.arp.finished) {
|
|
||||||
chan[adpcmChan].baseFreq=NOTE_ADPCMB(chan[adpcmChan].note);
|
|
||||||
chan[adpcmChan].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (chan[adpcmChan].freqChanged) {
|
if (chan[adpcmChan].freqChanged) {
|
||||||
|
|
|
@ -107,18 +107,9 @@ void DivPlatformOPLL::tick(bool sysTick) {
|
||||||
|
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].note+(signed char)chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chan[i].std.wave.had && chan[i].state.opllPreset!=16) {
|
if (chan[i].std.wave.had && chan[i].state.opllPreset!=16) {
|
||||||
|
|
|
@ -162,28 +162,12 @@ void DivPlatformPCE::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
int noiseSeek=parent->calcArp(chan[i].note,chan[i].std.arp.val);
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].std.arp.val);
|
chan[i].baseFreq=NOTE_PERIODIC(noiseSeek);
|
||||||
// noise
|
|
||||||
int noiseSeek=chan[i].std.arp.val;
|
|
||||||
if (noiseSeek<0) noiseSeek=0;
|
|
||||||
chWrite(i,0x07,chan[i].noise?(0x80|(parent->song.properNoiseLayout?(noiseSeek&31):noiseFreq[noiseSeek%12])):0);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note+chan[i].std.arp.val);
|
|
||||||
int noiseSeek=chan[i].note+chan[i].std.arp.val;
|
|
||||||
if (noiseSeek<0) noiseSeek=0;
|
|
||||||
chWrite(i,0x07,chan[i].noise?(0x80|(parent->song.properNoiseLayout?(noiseSeek&31):noiseFreq[noiseSeek%12])):0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note);
|
|
||||||
int noiseSeek=chan[i].note;
|
|
||||||
if (noiseSeek<0) noiseSeek=0;
|
if (noiseSeek<0) noiseSeek=0;
|
||||||
chWrite(i,0x07,chan[i].noise?(0x80|(parent->song.properNoiseLayout?(noiseSeek&31):noiseFreq[noiseSeek%12])):0);
|
chWrite(i,0x07,chan[i].noise?(0x80|(parent->song.properNoiseLayout?(noiseSeek&31):noiseFreq[noiseSeek%12])):0);
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
}
|
||||||
|
chan[i].freqChanged=true;
|
||||||
}
|
}
|
||||||
if (chan[i].std.wave.had && !chan[i].pcm) {
|
if (chan[i].std.wave.had && !chan[i].pcm) {
|
||||||
if (chan[i].wave!=chan[i].std.wave.val || chan[i].ws.activeChanged()) {
|
if (chan[i].wave!=chan[i].std.wave.val || chan[i].ws.activeChanged()) {
|
||||||
|
|
|
@ -83,18 +83,9 @@ void DivPlatformPCMDAC::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan.std.arp.had) {
|
if (chan.std.arp.had) {
|
||||||
if (!chan.inPorta) {
|
if (!chan.inPorta) {
|
||||||
if (chan.std.arp.mode) {
|
chan.baseFreq=NOTE_FREQUENCY(parent->calcArp(chan.note,chan.std.arp.val));
|
||||||
chan.baseFreq=NOTE_FREQUENCY(chan.std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan.baseFreq=NOTE_FREQUENCY(chan.note+chan.std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan.freqChanged=true;
|
chan.freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan.std.arp.mode && chan.std.arp.finished) {
|
|
||||||
chan.baseFreq=NOTE_FREQUENCY(chan.note);
|
|
||||||
chan.freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan.useWave && chan.std.wave.had) {
|
if (chan.useWave && chan.std.wave.had) {
|
||||||
if (chan.wave!=chan.std.wave.val || chan.ws.activeChanged()) {
|
if (chan.wave!=chan.std.wave.val || chan.ws.activeChanged()) {
|
||||||
|
|
|
@ -347,18 +347,9 @@ void DivPlatformPCSpeaker::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.pitch.had) {
|
if (chan[i].std.pitch.had) {
|
||||||
if (chan[i].std.pitch.mode) {
|
if (chan[i].std.pitch.mode) {
|
||||||
|
|
|
@ -104,18 +104,9 @@ void DivPlatformPET::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan.std.arp.had) {
|
if (chan.std.arp.had) {
|
||||||
if (!chan.inPorta) {
|
if (!chan.inPorta) {
|
||||||
if (chan.std.arp.mode) {
|
chan.baseFreq=NOTE_PERIODIC(parent->calcArp(chan.note,chan.std.arp.val));
|
||||||
chan.baseFreq=NOTE_PERIODIC(chan.std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan.baseFreq=NOTE_PERIODIC(chan.note+chan.std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan.freqChanged=true;
|
chan.freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan.std.arp.mode && chan.std.arp.finished) {
|
|
||||||
chan.baseFreq=NOTE_PERIODIC(chan.note);
|
|
||||||
chan.freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan.std.wave.had) {
|
if (chan.std.wave.had) {
|
||||||
if (chan.wave!=chan.std.wave.val) {
|
if (chan.wave!=chan.std.wave.val) {
|
||||||
|
|
|
@ -297,18 +297,9 @@ void DivPlatformQSound::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=QS_NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=QS_NOTE_FREQUENCY(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=QS_NOTE_FREQUENCY(chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=QS_NOTE_FREQUENCY(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.pitch.had) {
|
if (chan[i].std.pitch.had) {
|
||||||
if (chan[i].std.pitch.mode) {
|
if (chan[i].std.pitch.mode) {
|
||||||
|
|
|
@ -84,18 +84,9 @@ void DivPlatformRF5C68::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.pitch.had) {
|
if (chan[i].std.pitch.had) {
|
||||||
if (chan[i].std.pitch.mode) {
|
if (chan[i].std.pitch.mode) {
|
||||||
|
|
|
@ -99,18 +99,9 @@ void DivPlatformSAA1099::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.duty.had) {
|
if (chan[i].std.duty.had) {
|
||||||
saaNoise[i/3]=chan[i].std.duty.val&3;
|
saaNoise[i/3]=chan[i].std.duty.val&3;
|
||||||
|
|
|
@ -115,18 +115,9 @@ void DivPlatformSCC::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.wave.had) {
|
if (chan[i].std.wave.had) {
|
||||||
if (chan[i].wave!=chan[i].std.wave.val || chan[i].ws.activeChanged()) {
|
if (chan[i].wave!=chan[i].std.wave.val || chan[i].ws.activeChanged()) {
|
||||||
|
|
|
@ -88,18 +88,9 @@ void DivPlatformSegaPCM::tick(bool sysTick) {
|
||||||
|
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=(parent->calcArp(chan[i].note,chan[i].std.arp.val)<<6);
|
||||||
chan[i].baseFreq=(chan[i].std.arp.val<<6);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=((chan[i].note+(signed char)chan[i].std.arp.val)<<6);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=(chan[i].note<<6);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chan[i].std.panL.had) {
|
if (chan[i].std.panL.had) {
|
||||||
|
|
|
@ -132,22 +132,12 @@ void DivPlatformSMS::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
// TODO: check whether this weird octave boundary thing applies to other systems as well
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].std.arp.val);
|
// TODO: add compatibility flag. this is horrible.
|
||||||
chan[i].actualNote=chan[i].std.arp.val;
|
int areYouSerious=parent->calcArp(chan[i].note,chan[i].std.arp.val);
|
||||||
} else {
|
while (areYouSerious>0x60) areYouSerious-=12;
|
||||||
// TODO: check whether this weird octave boundary thing applies to other systems as well
|
chan[i].baseFreq=NOTE_PERIODIC(areYouSerious);
|
||||||
int areYouSerious=chan[i].note+chan[i].std.arp.val;
|
chan[i].actualNote=areYouSerious;
|
||||||
while (areYouSerious>0x60) areYouSerious-=12;
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(areYouSerious);
|
|
||||||
chan[i].actualNote=areYouSerious;
|
|
||||||
}
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note);
|
|
||||||
chan[i].actualNote=chan[i].note;
|
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,18 +78,9 @@ void DivPlatformSoundUnit::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_SU(i,parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_SU(i,chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_SU(i,chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_SU(i,chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.duty.had) {
|
if (chan[i].std.duty.had) {
|
||||||
chan[i].duty=chan[i].std.duty.val;
|
chan[i].duty=chan[i].std.duty.val;
|
||||||
|
|
|
@ -134,18 +134,9 @@ void DivPlatformSwan::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.wave.had && !(i==1 && pcm)) {
|
if (chan[i].std.wave.had && !(i==1 && pcm)) {
|
||||||
if (chan[i].wave!=chan[i].std.wave.val || chan[i].ws.activeChanged()) {
|
if (chan[i].wave!=chan[i].std.wave.val || chan[i].ws.activeChanged()) {
|
||||||
|
|
|
@ -87,20 +87,16 @@ void DivPlatformTIA::tick(bool sysTick) {
|
||||||
rWrite(0x19+i,chan[i].outVol&15);
|
rWrite(0x19+i,chan[i].outVol&15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// TODO: the way arps work on TIA is really weird
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
if (chan[i].std.arp.val&0x40000000) {
|
||||||
chan[i].baseFreq=0x80000000|chan[i].std.arp.val;
|
chan[i].baseFreq=0x80000000|(chan[i].std.arp.val&(~0x40000000));
|
||||||
} else {
|
} else {
|
||||||
chan[i].baseFreq=(chan[i].note+chan[i].std.arp.val)<<8;
|
chan[i].baseFreq=(chan[i].note+chan[i].std.arp.val)<<8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=chan[i].note<<8;
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.wave.had) {
|
if (chan[i].std.wave.had) {
|
||||||
chan[i].shape=chan[i].std.wave.val&15;
|
chan[i].shape=chan[i].std.wave.val&15;
|
||||||
|
|
|
@ -123,18 +123,9 @@ void DivPlatformTX81Z::tick(bool sysTick) {
|
||||||
|
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_LINEAR(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_LINEAR(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_LINEAR(chan[i].note+(signed char)chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_LINEAR(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chan[i].std.duty.had) {
|
if (chan[i].std.duty.had) {
|
||||||
|
|
|
@ -159,18 +159,9 @@ void DivPlatformVERA::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=calcNoteFreq(0,parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=calcNoteFreq(0,chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=calcNoteFreq(0,chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=calcNoteFreq(0,chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.duty.had) {
|
if (chan[i].std.duty.had) {
|
||||||
rWriteLo(i,3,chan[i].std.duty.val);
|
rWriteLo(i,3,chan[i].std.duty.val);
|
||||||
|
@ -209,18 +200,9 @@ void DivPlatformVERA::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[16].std.arp.had) {
|
if (chan[16].std.arp.had) {
|
||||||
if (!chan[16].inPorta) {
|
if (!chan[16].inPorta) {
|
||||||
if (chan[16].std.arp.mode) {
|
chan[16].baseFreq=calcNoteFreq(16,parent->calcArp(chan[16].note,chan[16].std.arp.val));
|
||||||
chan[16].baseFreq=calcNoteFreq(16,chan[16].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[16].baseFreq=calcNoteFreq(16,chan[16].note+chan[16].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[16].freqChanged=true;
|
chan[16].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[16].std.arp.mode && chan[16].std.arp.finished) {
|
|
||||||
chan[16].baseFreq=calcNoteFreq(16,chan[16].note);
|
|
||||||
chan[16].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[16].freqChanged) {
|
if (chan[16].freqChanged) {
|
||||||
double off=65536.0;
|
double off=65536.0;
|
||||||
|
|
|
@ -94,18 +94,9 @@ void DivPlatformVIC20::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.wave.had) {
|
if (chan[i].std.wave.had) {
|
||||||
if (chan[i].wave!=chan[i].std.wave.val) {
|
if (chan[i].wave!=chan[i].std.wave.val) {
|
||||||
|
|
|
@ -153,18 +153,9 @@ void DivPlatformVRC6::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_PERIODIC(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_PERIODIC(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.duty.had) {
|
if (chan[i].std.duty.had) {
|
||||||
chan[i].duty=chan[i].std.duty.val;
|
chan[i].duty=chan[i].std.duty.val;
|
||||||
|
|
|
@ -321,18 +321,9 @@ void DivPlatformX1_010::tick(bool sysTick) {
|
||||||
if ((!chan[i].pcm) || chan[i].furnacePCM) {
|
if ((!chan[i].pcm) || chan[i].furnacePCM) {
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NoteX1_010(i,parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NoteX1_010(i,chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NoteX1_010(i,chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NoteX1_010(i,chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (chan[i].std.wave.had && !chan[i].pcm) {
|
if (chan[i].std.wave.had && !chan[i].pcm) {
|
||||||
|
|
|
@ -231,18 +231,9 @@ void DivPlatformYM2203::tick(bool sysTick) {
|
||||||
|
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_FNUM_BLOCK(parent->calcArp(chan[i].note,chan[i].std.arp.val),11);
|
||||||
chan[i].baseFreq=NOTE_FNUM_BLOCK(chan[i].std.arp.val,11);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_FNUM_BLOCK(chan[i].note+(signed char)chan[i].std.arp.val,11);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_FNUM_BLOCK(chan[i].note,11);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chan[i].std.pitch.had) {
|
if (chan[i].std.pitch.had) {
|
||||||
|
|
|
@ -386,18 +386,9 @@ void DivPlatformYM2608::tick(bool sysTick) {
|
||||||
|
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_FNUM_BLOCK(parent->calcArp(chan[i].note,chan[i].std.arp.val),11);
|
||||||
chan[i].baseFreq=NOTE_FNUM_BLOCK(chan[i].std.arp.val,11);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_FNUM_BLOCK(chan[i].note+(signed char)chan[i].std.arp.val,11);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_FNUM_BLOCK(chan[i].note,11);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chan[i].std.panL.had) {
|
if (chan[i].std.panL.had) {
|
||||||
|
@ -538,18 +529,9 @@ void DivPlatformYM2608::tick(bool sysTick) {
|
||||||
|
|
||||||
if (chan[15].std.arp.had) {
|
if (chan[15].std.arp.had) {
|
||||||
if (!chan[15].inPorta) {
|
if (!chan[15].inPorta) {
|
||||||
if (chan[15].std.arp.mode) {
|
chan[15].baseFreq=NOTE_ADPCMB(parent->calcArp(chan[15].note,chan[15].std.arp.val));
|
||||||
chan[15].baseFreq=NOTE_ADPCMB(chan[15].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[15].baseFreq=NOTE_ADPCMB(chan[15].note+(signed char)chan[15].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[15].freqChanged=true;
|
chan[15].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[15].std.arp.mode && chan[15].std.arp.finished) {
|
|
||||||
chan[15].baseFreq=NOTE_ADPCMB(chan[15].note);
|
|
||||||
chan[15].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (chan[15].freqChanged) {
|
if (chan[15].freqChanged) {
|
||||||
|
|
|
@ -427,18 +427,9 @@ void DivPlatformYM2610::tick(bool sysTick) {
|
||||||
|
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_FNUM_BLOCK(parent->calcArp(chan[i].note,chan[i].std.arp.val),11);
|
||||||
chan[i].baseFreq=NOTE_FNUM_BLOCK(chan[i].std.arp.val,11);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_FNUM_BLOCK(chan[i].note+(signed char)chan[i].std.arp.val,11);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_FNUM_BLOCK(chan[i].note,11);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chan[i].std.panL.had) {
|
if (chan[i].std.panL.had) {
|
||||||
|
@ -580,18 +571,9 @@ void DivPlatformYM2610::tick(bool sysTick) {
|
||||||
|
|
||||||
if (chan[13].std.arp.had) {
|
if (chan[13].std.arp.had) {
|
||||||
if (!chan[13].inPorta) {
|
if (!chan[13].inPorta) {
|
||||||
if (chan[13].std.arp.mode) {
|
chan[13].baseFreq=NOTE_ADPCMB(parent->calcArp(chan[13].note,chan[13].std.arp.val));
|
||||||
chan[13].baseFreq=NOTE_ADPCMB(chan[13].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[13].baseFreq=NOTE_ADPCMB(chan[13].note+(signed char)chan[13].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[13].freqChanged=true;
|
chan[13].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[13].std.arp.mode && chan[13].std.arp.finished) {
|
|
||||||
chan[13].baseFreq=NOTE_ADPCMB(chan[13].note);
|
|
||||||
chan[13].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (chan[13].freqChanged) {
|
if (chan[13].freqChanged) {
|
||||||
|
|
|
@ -410,18 +410,9 @@ void DivPlatformYM2610B::tick(bool sysTick) {
|
||||||
|
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_FNUM_BLOCK(parent->calcArp(chan[i].note,chan[i].std.arp.val),11);
|
||||||
chan[i].baseFreq=NOTE_FNUM_BLOCK(chan[i].std.arp.val,11);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_FNUM_BLOCK(chan[i].note+(signed char)chan[i].std.arp.val,11);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_FNUM_BLOCK(chan[i].note,11);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chan[i].std.panL.had) {
|
if (chan[i].std.panL.had) {
|
||||||
|
@ -562,18 +553,9 @@ void DivPlatformYM2610B::tick(bool sysTick) {
|
||||||
|
|
||||||
if (chan[15].std.arp.had) {
|
if (chan[15].std.arp.had) {
|
||||||
if (!chan[15].inPorta) {
|
if (!chan[15].inPorta) {
|
||||||
if (chan[15].std.arp.mode) {
|
chan[15].baseFreq=NOTE_ADPCMB(parent->calcArp(chan[15].note,chan[15].std.arp.val));
|
||||||
chan[15].baseFreq=NOTE_ADPCMB(chan[15].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[15].baseFreq=NOTE_ADPCMB(chan[15].note+(signed char)chan[15].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[15].freqChanged=true;
|
chan[15].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[15].std.arp.mode && chan[15].std.arp.finished) {
|
|
||||||
chan[15].baseFreq=NOTE_ADPCMB(chan[15].note);
|
|
||||||
chan[15].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (chan[15].freqChanged) {
|
if (chan[15].freqChanged) {
|
||||||
|
|
|
@ -95,18 +95,9 @@ void DivPlatformYMZ280B::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.pitch.had) {
|
if (chan[i].std.pitch.had) {
|
||||||
if (chan[i].std.pitch.mode) {
|
if (chan[i].std.pitch.mode) {
|
||||||
|
|
|
@ -81,18 +81,9 @@ void DivPlatformZXBeeper::tick(bool sysTick) {
|
||||||
}
|
}
|
||||||
if (chan[i].std.arp.had) {
|
if (chan[i].std.arp.had) {
|
||||||
if (!chan[i].inPorta) {
|
if (!chan[i].inPorta) {
|
||||||
if (chan[i].std.arp.mode) {
|
chan[i].baseFreq=NOTE_FREQUENCY(parent->calcArp(chan[i].note,chan[i].std.arp.val));
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].std.arp.val);
|
|
||||||
} else {
|
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].note+chan[i].std.arp.val);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
chan[i].freqChanged=true;
|
chan[i].freqChanged=true;
|
||||||
} else {
|
|
||||||
if (chan[i].std.arp.mode && chan[i].std.arp.finished) {
|
|
||||||
chan[i].baseFreq=NOTE_FREQUENCY(chan[i].note);
|
|
||||||
chan[i].freqChanged=true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (chan[i].std.pitch.had) {
|
if (chan[i].std.pitch.had) {
|
||||||
if (chan[i].std.pitch.mode) {
|
if (chan[i].std.pitch.mode) {
|
||||||
|
|
|
@ -195,23 +195,25 @@ void FurnaceGUI::decodeKeyMap(std::map<int,int>& map, String source) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FurnaceGUI::encodeMMLStr(String& target, int* macro, int macroLen, int macroLoop, int macroRel, bool hex) {
|
void FurnaceGUI::encodeMMLStr(String& target, int* macro, int macroLen, int macroLoop, int macroRel, bool hex, bool bit30) {
|
||||||
target="";
|
target="";
|
||||||
char buf[32];
|
char buf[32];
|
||||||
for (int i=0; i<macroLen; i++) {
|
for (int i=0; i<macroLen; i++) {
|
||||||
if (i==macroLoop) target+="| ";
|
if (i==macroLoop) target+="| ";
|
||||||
if (i==macroRel) target+="/ ";
|
if (i==macroRel) target+="/ ";
|
||||||
|
if (bit30 && macro[i]&0x40000000) target+="@";
|
||||||
|
int macroVal=macro[i]&(bit30?(~0x40000000):0xffffffff);
|
||||||
if (hex) {
|
if (hex) {
|
||||||
if (i==macroLen-1) {
|
if (i==macroLen-1) {
|
||||||
snprintf(buf,31,"%.2X",macro[i]);
|
snprintf(buf,31,"%.2X",macroVal);
|
||||||
} else {
|
} else {
|
||||||
snprintf(buf,31,"%.2X ",macro[i]);
|
snprintf(buf,31,"%.2X ",macroVal);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (i==macroLen-1) {
|
if (i==macroLen-1) {
|
||||||
snprintf(buf,31,"%d",macro[i]);
|
snprintf(buf,31,"%d",macroVal);
|
||||||
} else {
|
} else {
|
||||||
snprintf(buf,31,"%d ",macro[i]);
|
snprintf(buf,31,"%d ",macroVal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
target+=buf;
|
target+=buf;
|
||||||
|
@ -276,9 +278,10 @@ void FurnaceGUI::decodeMMLStrW(String& source, int* macro, int& macroLen, int ma
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FurnaceGUI::decodeMMLStr(String& source, int* macro, unsigned char& macroLen, unsigned char& macroLoop, int macroMin, int macroMax, unsigned char& macroRel) {
|
void FurnaceGUI::decodeMMLStr(String& source, int* macro, unsigned char& macroLen, unsigned char& macroLoop, int macroMin, int macroMax, unsigned char& macroRel, bool bit30) {
|
||||||
int buf=0;
|
int buf=0;
|
||||||
bool negaBuf=false;
|
bool negaBuf=false;
|
||||||
|
bool setBit30=false;
|
||||||
bool hasVal=false;
|
bool hasVal=false;
|
||||||
macroLen=0;
|
macroLen=0;
|
||||||
macroLoop=255;
|
macroLoop=255;
|
||||||
|
@ -297,6 +300,11 @@ void FurnaceGUI::decodeMMLStr(String& source, int* macro, unsigned char& macroLe
|
||||||
negaBuf=true;
|
negaBuf=true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case '@':
|
||||||
|
if (bit30) {
|
||||||
|
setBit30=true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case ' ':
|
case ' ':
|
||||||
if (hasVal) {
|
if (hasVal) {
|
||||||
hasVal=false;
|
hasVal=false;
|
||||||
|
@ -304,6 +312,8 @@ void FurnaceGUI::decodeMMLStr(String& source, int* macro, unsigned char& macroLe
|
||||||
negaBuf=false;
|
negaBuf=false;
|
||||||
if (macro[macroLen]<macroMin) macro[macroLen]=macroMin;
|
if (macro[macroLen]<macroMin) macro[macroLen]=macroMin;
|
||||||
if (macro[macroLen]>macroMax) macro[macroLen]=macroMax;
|
if (macro[macroLen]>macroMax) macro[macroLen]=macroMax;
|
||||||
|
if (setBit30) macro[macroLen]|=0x40000000;
|
||||||
|
setBit30=false;
|
||||||
macroLen++;
|
macroLen++;
|
||||||
buf=0;
|
buf=0;
|
||||||
}
|
}
|
||||||
|
@ -315,6 +325,8 @@ void FurnaceGUI::decodeMMLStr(String& source, int* macro, unsigned char& macroLe
|
||||||
negaBuf=false;
|
negaBuf=false;
|
||||||
if (macro[macroLen]<macroMin) macro[macroLen]=macroMin;
|
if (macro[macroLen]<macroMin) macro[macroLen]=macroMin;
|
||||||
if (macro[macroLen]>macroMax) macro[macroLen]=macroMax;
|
if (macro[macroLen]>macroMax) macro[macroLen]=macroMax;
|
||||||
|
if (setBit30) macro[macroLen]|=0x40000000;
|
||||||
|
setBit30=false;
|
||||||
macroLen++;
|
macroLen++;
|
||||||
buf=0;
|
buf=0;
|
||||||
}
|
}
|
||||||
|
@ -329,6 +341,8 @@ void FurnaceGUI::decodeMMLStr(String& source, int* macro, unsigned char& macroLe
|
||||||
negaBuf=false;
|
negaBuf=false;
|
||||||
if (macro[macroLen]<macroMin) macro[macroLen]=macroMin;
|
if (macro[macroLen]<macroMin) macro[macroLen]=macroMin;
|
||||||
if (macro[macroLen]>macroMax) macro[macroLen]=macroMax;
|
if (macro[macroLen]>macroMax) macro[macroLen]=macroMax;
|
||||||
|
if (setBit30) macro[macroLen]|=0x40000000;
|
||||||
|
setBit30=false;
|
||||||
macroLen++;
|
macroLen++;
|
||||||
buf=0;
|
buf=0;
|
||||||
}
|
}
|
||||||
|
@ -345,6 +359,8 @@ void FurnaceGUI::decodeMMLStr(String& source, int* macro, unsigned char& macroLe
|
||||||
negaBuf=false;
|
negaBuf=false;
|
||||||
if (macro[macroLen]<macroMin) macro[macroLen]=macroMin;
|
if (macro[macroLen]<macroMin) macro[macroLen]=macroMin;
|
||||||
if (macro[macroLen]>macroMax) macro[macroLen]=macroMax;
|
if (macro[macroLen]>macroMax) macro[macroLen]=macroMax;
|
||||||
|
if (setBit30) macro[macroLen]|=0x40000000;
|
||||||
|
setBit30=false;
|
||||||
macroLen++;
|
macroLen++;
|
||||||
buf=0;
|
buf=0;
|
||||||
}
|
}
|
||||||
|
@ -1758,6 +1774,8 @@ void FurnaceGUI::showError(String what) {
|
||||||
displayError=true;
|
displayError=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define B30(tt) (macroDragBit30?((tt)&0x40000000):0)
|
||||||
|
|
||||||
#define MACRO_DRAG(t) \
|
#define MACRO_DRAG(t) \
|
||||||
if (macroDragBitMode) { \
|
if (macroDragBitMode) { \
|
||||||
if (macroDragLastX!=x || macroDragLastY!=y) { \
|
if (macroDragLastX!=x || macroDragLastY!=y) { \
|
||||||
|
@ -1790,25 +1808,25 @@ void FurnaceGUI::showError(String what) {
|
||||||
} \
|
} \
|
||||||
if (macroDragMouseMoved) { \
|
if (macroDragMouseMoved) { \
|
||||||
if ((int)round(x-macroDragLineInitial.x)==0) { \
|
if ((int)round(x-macroDragLineInitial.x)==0) { \
|
||||||
t[x]=macroDragLineInitial.y; \
|
t[x]=B30(t[x])|(int)(macroDragLineInitial.y); \
|
||||||
} else { \
|
} else { \
|
||||||
if ((int)round(x-macroDragLineInitial.x)<0) { \
|
if ((int)round(x-macroDragLineInitial.x)<0) { \
|
||||||
for (int i=0; i<=(int)round(macroDragLineInitial.x-x); i++) { \
|
for (int i=0; i<=(int)round(macroDragLineInitial.x-x); i++) { \
|
||||||
int index=(int)round(x+i); \
|
int index=(int)round(x+i); \
|
||||||
if (index<0) continue; \
|
if (index<0) continue; \
|
||||||
t[index]=y+(macroDragLineInitial.y-y)*((float)i/(float)(macroDragLineInitial.x-x)); \
|
t[index]=B30(t[index])|(int)(y+(macroDragLineInitial.y-y)*((float)i/(float)(macroDragLineInitial.x-x))); \
|
||||||
} \
|
} \
|
||||||
} else { \
|
} else { \
|
||||||
for (int i=0; i<=(int)round(x-macroDragLineInitial.x); i++) { \
|
for (int i=0; i<=(int)round(x-macroDragLineInitial.x); i++) { \
|
||||||
int index=(int)round(i+macroDragLineInitial.x); \
|
int index=(int)round(i+macroDragLineInitial.x); \
|
||||||
if (index<0) continue; \
|
if (index<0) continue; \
|
||||||
t[index]=macroDragLineInitial.y+(y-macroDragLineInitial.y)*((float)i/(x-macroDragLineInitial.x)); \
|
t[index]=B30(t[index])|(int)(macroDragLineInitial.y+(y-macroDragLineInitial.y)*((float)i/(x-macroDragLineInitial.x))); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
} else { \
|
} else { \
|
||||||
t[x]=y; \
|
t[x]=B30(t[x])|(y); \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4868,6 +4886,7 @@ FurnaceGUI::FurnaceGUI():
|
||||||
macroDragInitialValueSet(false),
|
macroDragInitialValueSet(false),
|
||||||
macroDragInitialValue(false),
|
macroDragInitialValue(false),
|
||||||
macroDragChar(false),
|
macroDragChar(false),
|
||||||
|
macroDragBit30(false),
|
||||||
macroDragLineMode(false),
|
macroDragLineMode(false),
|
||||||
macroDragMouseMoved(false),
|
macroDragMouseMoved(false),
|
||||||
macroDragLineInitial(0,0),
|
macroDragLineInitial(0,0),
|
||||||
|
|
|
@ -869,10 +869,10 @@ struct FurnaceGUIMacroDesc {
|
||||||
const char* modeName;
|
const char* modeName;
|
||||||
ImVec4 color;
|
ImVec4 color;
|
||||||
unsigned int bitOffset;
|
unsigned int bitOffset;
|
||||||
bool isBitfield, blockMode;
|
bool isBitfield, blockMode, bit30;
|
||||||
String (*hoverFunc)(int,float);
|
String (*hoverFunc)(int,float);
|
||||||
|
|
||||||
FurnaceGUIMacroDesc(const char* name, DivInstrumentMacro* m, int macroMin, int macroMax, float macroHeight, ImVec4 col=ImVec4(1.0f,1.0f,1.0f,1.0f), bool block=false, const char* mName=NULL, String (*hf)(int,float)=NULL, bool bitfield=false, const char** bfVal=NULL, unsigned int bitOff=0):
|
FurnaceGUIMacroDesc(const char* name, DivInstrumentMacro* m, int macroMin, int macroMax, float macroHeight, ImVec4 col=ImVec4(1.0f,1.0f,1.0f,1.0f), bool block=false, const char* mName=NULL, String (*hf)(int,float)=NULL, bool bitfield=false, const char** bfVal=NULL, unsigned int bitOff=0, bool bit30Special=false):
|
||||||
macro(m),
|
macro(m),
|
||||||
height(macroHeight),
|
height(macroHeight),
|
||||||
displayName(name),
|
displayName(name),
|
||||||
|
@ -882,6 +882,7 @@ struct FurnaceGUIMacroDesc {
|
||||||
bitOffset(bitOff),
|
bitOffset(bitOff),
|
||||||
isBitfield(bitfield),
|
isBitfield(bitfield),
|
||||||
blockMode(block),
|
blockMode(block),
|
||||||
|
bit30(bit30Special),
|
||||||
hoverFunc(hf) {
|
hoverFunc(hf) {
|
||||||
// MSVC -> hell
|
// MSVC -> hell
|
||||||
this->min=macroMin;
|
this->min=macroMin;
|
||||||
|
@ -1395,6 +1396,7 @@ class FurnaceGUI {
|
||||||
bool macroDragInitialValueSet;
|
bool macroDragInitialValueSet;
|
||||||
bool macroDragInitialValue;
|
bool macroDragInitialValue;
|
||||||
bool macroDragChar;
|
bool macroDragChar;
|
||||||
|
bool macroDragBit30;
|
||||||
bool macroDragLineMode;
|
bool macroDragLineMode;
|
||||||
bool macroDragMouseMoved;
|
bool macroDragMouseMoved;
|
||||||
ImVec2 macroDragLineInitial;
|
ImVec2 macroDragLineInitial;
|
||||||
|
@ -1686,8 +1688,8 @@ class FurnaceGUI {
|
||||||
void applyUISettings(bool updateFonts=true);
|
void applyUISettings(bool updateFonts=true);
|
||||||
void initSystemPresets();
|
void initSystemPresets();
|
||||||
|
|
||||||
void encodeMMLStr(String& target, int* macro, int macroLen, int macroLoop, int macroRel, bool hex=false);
|
void encodeMMLStr(String& target, int* macro, int macroLen, int macroLoop, int macroRel, bool hex=false, bool bit30=false);
|
||||||
void decodeMMLStr(String& source, int* macro, unsigned char& macroLen, unsigned char& macroLoop, int macroMin, int macroMax, unsigned char& macroRel);
|
void decodeMMLStr(String& source, int* macro, unsigned char& macroLen, unsigned char& macroLoop, int macroMin, int macroMax, unsigned char& macroRel, bool bit30=false);
|
||||||
void decodeMMLStrW(String& source, int* macro, int& macroLen, int macroMax, bool hex=false);
|
void decodeMMLStrW(String& source, int* macro, int& macroLen, int macroMax, bool hex=false);
|
||||||
|
|
||||||
String encodeKeyMap(std::map<int,int>& map);
|
String encodeKeyMap(std::map<int,int>& map);
|
||||||
|
|
|
@ -331,6 +331,11 @@ String macroHoverLoop(int id, float val) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String macroHoverBit30(int id, float val) {
|
||||||
|
if (val>0) return "Fixed";
|
||||||
|
return "Relative";
|
||||||
|
}
|
||||||
|
|
||||||
String macroHoverES5506FilterMode(int id, float val) {
|
String macroHoverES5506FilterMode(int id, float val) {
|
||||||
String mode="???";
|
String mode="???";
|
||||||
switch (((int)val)&3) {
|
switch (((int)val)&3) {
|
||||||
|
@ -1196,6 +1201,7 @@ void FurnaceGUI::drawMacros(std::vector<FurnaceGUIMacroDesc>& macros) {
|
||||||
float asFloat[256];
|
float asFloat[256];
|
||||||
int asInt[256];
|
int asInt[256];
|
||||||
float loopIndicator[256];
|
float loopIndicator[256];
|
||||||
|
float bit30Indicator[256];
|
||||||
bool doHighlight[256];
|
bool doHighlight[256];
|
||||||
int index=0;
|
int index=0;
|
||||||
|
|
||||||
|
@ -1281,12 +1287,14 @@ void FurnaceGUI::drawMacros(std::vector<FurnaceGUIMacroDesc>& macros) {
|
||||||
// macro area
|
// macro area
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
for (int j=0; j<256; j++) {
|
for (int j=0; j<256; j++) {
|
||||||
|
bit30Indicator[j]=0;
|
||||||
if (j+macroDragScroll>=i.macro->len) {
|
if (j+macroDragScroll>=i.macro->len) {
|
||||||
asFloat[j]=0;
|
asFloat[j]=0;
|
||||||
asInt[j]=0;
|
asInt[j]=0;
|
||||||
} else {
|
} else {
|
||||||
asFloat[j]=i.macro->val[j+macroDragScroll];
|
asFloat[j]=i.macro->val[j+macroDragScroll]&(i.bit30?(~0x40000000):0xffffffff);
|
||||||
asInt[j]=i.macro->val[j+macroDragScroll]+i.bitOffset;
|
asInt[j]=(i.macro->val[j+macroDragScroll]&(i.bit30?(~0x40000000):0xffffffff))+i.bitOffset;
|
||||||
|
if (i.bit30) bit30Indicator[j]=(i.macro->val[j+macroDragScroll]&0x40000000)?1:0;
|
||||||
}
|
}
|
||||||
if (j+macroDragScroll>=i.macro->len || (j+macroDragScroll>i.macro->rel && i.macro->loop<i.macro->rel)) {
|
if (j+macroDragScroll>=i.macro->len || (j+macroDragScroll>i.macro->rel && i.macro->loop<i.macro->rel)) {
|
||||||
loopIndicator[j]=0;
|
loopIndicator[j]=0;
|
||||||
|
@ -1355,6 +1363,7 @@ void FurnaceGUI::drawMacros(std::vector<FurnaceGUIMacroDesc>& macros) {
|
||||||
macroDragInitialValue=false;
|
macroDragInitialValue=false;
|
||||||
macroDragLen=totalFit;
|
macroDragLen=totalFit;
|
||||||
macroDragActive=true;
|
macroDragActive=true;
|
||||||
|
macroDragBit30=i.bit30;
|
||||||
macroDragTarget=i.macro->val;
|
macroDragTarget=i.macro->val;
|
||||||
macroDragChar=false;
|
macroDragChar=false;
|
||||||
macroDragLineMode=(i.isBitfield)?false:ImGui::IsItemClicked(ImGuiMouseButton_Right);
|
macroDragLineMode=(i.isBitfield)?false:ImGui::IsItemClicked(ImGuiMouseButton_Right);
|
||||||
|
@ -1422,6 +1431,12 @@ void FurnaceGUI::drawMacros(std::vector<FurnaceGUIMacroDesc>& macros) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// bit 30 area
|
||||||
|
// TODO: ability to set it
|
||||||
|
if (i.bit30) {
|
||||||
|
PlotCustom("##IMacroBit30",bit30Indicator,totalFit,macroDragScroll,NULL,0,1,ImVec2(availableWidth,12.0f*dpiScale),sizeof(float),i.color,i.macro->len-macroDragScroll,¯oHoverBit30);
|
||||||
|
}
|
||||||
|
|
||||||
// loop area
|
// loop area
|
||||||
PlotCustom("##IMacroLoop",loopIndicator,totalFit,macroDragScroll,NULL,0,2,ImVec2(availableWidth,12.0f*dpiScale),sizeof(float),i.color,i.macro->len-macroDragScroll,¯oHoverLoop);
|
PlotCustom("##IMacroLoop",loopIndicator,totalFit,macroDragScroll,NULL,0,2,ImVec2(availableWidth,12.0f*dpiScale),sizeof(float),i.color,i.macro->len-macroDragScroll,¯oHoverLoop);
|
||||||
if (ImGui::IsItemClicked(ImGuiMouseButton_Left)) {
|
if (ImGui::IsItemClicked(ImGuiMouseButton_Left)) {
|
||||||
|
@ -4178,7 +4193,7 @@ void FurnaceGUI::drawInsEdit() {
|
||||||
if (volMax>0) {
|
if (volMax>0) {
|
||||||
macroList.push_back(FurnaceGUIMacroDesc(volumeLabel,&ins->std.volMacro,volMin,volMax,160,uiColors[GUI_COLOR_MACRO_VOLUME]));
|
macroList.push_back(FurnaceGUIMacroDesc(volumeLabel,&ins->std.volMacro,volMin,volMax,160,uiColors[GUI_COLOR_MACRO_VOLUME]));
|
||||||
}
|
}
|
||||||
macroList.push_back(FurnaceGUIMacroDesc("Arpeggio",&ins->std.arpMacro,-120,120,160,uiColors[GUI_COLOR_MACRO_PITCH],true,macroAbsoluteMode,ins->std.arpMacro.mode?(¯oHoverNote):NULL));
|
macroList.push_back(FurnaceGUIMacroDesc("Arpeggio",&ins->std.arpMacro,-120,120,160,uiColors[GUI_COLOR_MACRO_PITCH],true,NULL,NULL,false,NULL,0,true));
|
||||||
if (dutyMax>0) {
|
if (dutyMax>0) {
|
||||||
if (ins->type==DIV_INS_MIKEY) {
|
if (ins->type==DIV_INS_MIKEY) {
|
||||||
macroList.push_back(FurnaceGUIMacroDesc(dutyLabel,&ins->std.dutyMacro,0,dutyMax,160,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,mikeyFeedbackBits));
|
macroList.push_back(FurnaceGUIMacroDesc(dutyLabel,&ins->std.dutyMacro,0,dutyMax,160,uiColors[GUI_COLOR_MACRO_OTHER],false,NULL,NULL,true,mikeyFeedbackBits));
|
||||||
|
|
Loading…
Reference in a new issue