Merge branch 'tildearrow:master' into welcomescr
This commit is contained in:
commit
8dc8bc285d
69 changed files with 10475 additions and 2379 deletions
|
|
@ -283,6 +283,30 @@ enum DivDispatchCmds {
|
|||
DIV_CMD_MULTIPCM_PSEUDO_REVERB, // (value)
|
||||
DIV_CMD_MULTIPCM_LFO_RESET, // (value)
|
||||
DIV_CMD_MULTIPCM_LEVEL_DIRECT, // (value)
|
||||
|
||||
DIV_CMD_SID3_SPECIAL_WAVE,
|
||||
DIV_CMD_SID3_RING_MOD_SRC,
|
||||
DIV_CMD_SID3_HARD_SYNC_SRC,
|
||||
DIV_CMD_SID3_PHASE_MOD_SRC,
|
||||
DIV_CMD_SID3_WAVE_MIX,
|
||||
DIV_CMD_SID3_LFSR_FEEDBACK_BITS,
|
||||
DIV_CMD_SID3_1_BIT_NOISE,
|
||||
DIV_CMD_SID3_FILTER_DISTORTION,
|
||||
DIV_CMD_SID3_FILTER_OUTPUT_VOLUME,
|
||||
DIV_CMD_SID3_CHANNEL_INVERSION,
|
||||
DIV_CMD_SID3_FILTER_CONNECTION,
|
||||
DIV_CMD_SID3_FILTER_MATRIX,
|
||||
DIV_CMD_SID3_FILTER_ENABLE,
|
||||
|
||||
DIV_CMD_C64_PW_SLIDE,
|
||||
DIV_CMD_C64_CUTOFF_SLIDE,
|
||||
|
||||
DIV_CMD_SID3_PHASE_RESET,
|
||||
DIV_CMD_SID3_NOISE_PHASE_RESET,
|
||||
DIV_CMD_SID3_ENVELOPE_RESET,
|
||||
|
||||
DIV_CMD_SID3_CUTOFF_SCALING,
|
||||
DIV_CMD_SID3_RESONANCE_SCALING,
|
||||
|
||||
DIV_CMD_MAX
|
||||
};
|
||||
|
|
@ -601,10 +625,10 @@ class DivDispatch {
|
|||
|
||||
/**
|
||||
* get "paired" channels.
|
||||
* @param chan the channel to query.
|
||||
* @return a DivChannelPair.
|
||||
* @param ch the channel to query.
|
||||
* @param ret the DivChannelPair vector of pairs.
|
||||
*/
|
||||
virtual DivChannelPair getPaired(int chan);
|
||||
virtual void getPaired(int ch, std::vector<DivChannelPair>& ret);
|
||||
|
||||
/**
|
||||
* get channel mode hints.
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@
|
|||
#include "platform/nds.h"
|
||||
#include "platform/bifurcator.h"
|
||||
#include "platform/sid2.h"
|
||||
#include "platform/sid3.h"
|
||||
#include "platform/dummy.h"
|
||||
#include "../ta-log.h"
|
||||
#include "song.h"
|
||||
|
|
@ -768,6 +769,9 @@ void DivDispatchContainer::init(DivSystem sys, DivEngine* eng, int chanCount, do
|
|||
case DIV_SYSTEM_SID2:
|
||||
dispatch=new DivPlatformSID2;
|
||||
break;
|
||||
case DIV_SYSTEM_SID3:
|
||||
dispatch=new DivPlatformSID3;
|
||||
break;
|
||||
case DIV_SYSTEM_OPL4:
|
||||
dispatch=new DivPlatformOPL;
|
||||
((DivPlatformOPL*)dispatch)->setOPLType(4,false);
|
||||
|
|
|
|||
|
|
@ -1575,9 +1575,9 @@ void* DivEngine::getDispatchChanState(int ch) {
|
|||
return disCont[dispatchOfChan[ch]].dispatch->getChanState(dispatchChanOfChan[ch]);
|
||||
}
|
||||
|
||||
DivChannelPair DivEngine::getChanPaired(int ch) {
|
||||
if (ch<0 || ch>=chans) return DivChannelPair();
|
||||
return disCont[dispatchOfChan[ch]].dispatch->getPaired(dispatchChanOfChan[ch]);
|
||||
void DivEngine::getChanPaired(int ch, std::vector<DivChannelPair>& ret) {
|
||||
if (ch<0 || ch>=chans) return;
|
||||
disCont[dispatchOfChan[ch]].dispatch->getPaired(dispatchChanOfChan[ch],ret);
|
||||
}
|
||||
|
||||
DivChannelModeHints DivEngine::getChanModeHints(int ch) {
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@ class DivWorkPool;
|
|||
|
||||
#define DIV_UNSTABLE
|
||||
|
||||
#define DIV_VERSION "dev221"
|
||||
#define DIV_ENGINE_VERSION 221
|
||||
#define DIV_VERSION "dev222"
|
||||
#define DIV_ENGINE_VERSION 222
|
||||
// for imports
|
||||
#define DIV_VERSION_MOD 0xff01
|
||||
#define DIV_VERSION_FC 0xff02
|
||||
|
|
@ -1151,7 +1151,7 @@ class DivEngine {
|
|||
void* getDispatchChanState(int chan);
|
||||
|
||||
// get channel pairs
|
||||
DivChannelPair getChanPaired(int chan);
|
||||
void getChanPaired(int chan, std::vector<DivChannelPair>& ret);
|
||||
|
||||
// get channel mode hints
|
||||
DivChannelModeHints getChanModeHints(int chan);
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ bool DivInstrumentC64::operator==(const DivInstrumentC64& other) {
|
|||
_C(dutyIsAbs) &&
|
||||
_C(filterIsAbs) &&
|
||||
_C(noTest) &&
|
||||
_C(resetDuty) &&
|
||||
_C(res) &&
|
||||
_C(cut) &&
|
||||
_C(hp) &&
|
||||
|
|
@ -258,6 +259,65 @@ bool DivInstrumentESFM::Operator::operator==(const DivInstrumentESFM::Operator&
|
|||
);
|
||||
}
|
||||
|
||||
bool DivInstrumentSID3::operator==(const DivInstrumentSID3& other) {
|
||||
return (
|
||||
_C(triOn) &&
|
||||
_C(sawOn) &&
|
||||
_C(pulseOn) &&
|
||||
_C(noiseOn) &&
|
||||
_C(a) &&
|
||||
_C(d) &&
|
||||
_C(s) &&
|
||||
_C(r) &&
|
||||
_C(sr) &&
|
||||
_C(duty) &&
|
||||
_C(ringMod) &&
|
||||
_C(oscSync) &&
|
||||
_C(phase_mod) &&
|
||||
_C(phase_mod_source) &&
|
||||
_C(ring_mod_source) &&
|
||||
_C(sync_source) &&
|
||||
_C(specialWaveOn) &&
|
||||
_C(oneBitNoise) &&
|
||||
_C(separateNoisePitch) &&
|
||||
_C(special_wave) &&
|
||||
_C(doWavetable) &&
|
||||
_C(dutyIsAbs) &&
|
||||
_C(resetDuty) &&
|
||||
_C(phaseInv) &&
|
||||
_C(feedback) &&
|
||||
_C(mixMode) &&
|
||||
_C(filt[0]) &&
|
||||
_C(filt[1]) &&
|
||||
_C(filt[2]) &&
|
||||
_C(filt[3])
|
||||
);
|
||||
}
|
||||
|
||||
bool DivInstrumentSID3::Filter::operator==(const DivInstrumentSID3::Filter& other) {
|
||||
return (
|
||||
_C(cutoff) &&
|
||||
_C(resonance) &&
|
||||
_C(output_volume) &&
|
||||
_C(distortion_level) &&
|
||||
_C(mode) &&
|
||||
_C(enabled) &&
|
||||
_C(init) &&
|
||||
_C(filter_matrix) &&
|
||||
_C(absoluteCutoff) &&
|
||||
_C(bindCutoffToNote) &&
|
||||
_C(bindCutoffToNoteStrength) &&
|
||||
_C(bindCutoffToNoteCenter) &&
|
||||
_C(bindCutoffToNoteDir) &&
|
||||
_C(bindCutoffOnNote) &&
|
||||
_C(bindResonanceToNote) &&
|
||||
_C(bindResonanceToNoteStrength) &&
|
||||
_C(bindResonanceToNoteCenter) &&
|
||||
_C(bindResonanceToNoteDir) &&
|
||||
_C(bindResonanceOnNote)
|
||||
);
|
||||
}
|
||||
|
||||
bool DivInstrumentPowerNoise::operator==(const DivInstrumentPowerNoise& other) {
|
||||
return _C(octave);
|
||||
}
|
||||
|
|
@ -622,7 +682,7 @@ void DivInstrument::writeFeature64(SafeWriter* w) {
|
|||
w->writeS(c64.duty);
|
||||
w->writeS((unsigned short)((c64.cut&4095)|((c64.res&15)<<12)));
|
||||
|
||||
w->writeC((c64.res>>4)&15);
|
||||
w->writeC(((c64.res>>4)&15)|(c64.resetDuty?0x10:0));
|
||||
|
||||
FEATURE_END;
|
||||
}
|
||||
|
|
@ -995,6 +1055,80 @@ void DivInstrument::writeFeatureS2(SafeWriter* w) {
|
|||
FEATURE_END;
|
||||
}
|
||||
|
||||
void DivInstrument::writeFeatureS3(SafeWriter* w) {
|
||||
FEATURE_BEGIN("S3");
|
||||
|
||||
w->writeC(
|
||||
(sid3.dutyIsAbs?0x80:0)|
|
||||
(sid3.noiseOn?8:0)|
|
||||
(sid3.pulseOn?4:0)|
|
||||
(sid3.sawOn?2:0)|
|
||||
(sid3.triOn?1:0)
|
||||
);
|
||||
|
||||
w->writeC(sid3.a);
|
||||
w->writeC(sid3.d);
|
||||
w->writeC(sid3.s);
|
||||
w->writeC(sid3.sr);
|
||||
w->writeC(sid3.r);
|
||||
|
||||
w->writeC(sid3.mixMode);
|
||||
|
||||
w->writeS(sid3.duty);
|
||||
|
||||
w->writeC(
|
||||
(sid3.phase_mod?0x80:0)|
|
||||
(sid3.specialWaveOn?0x40:0)|
|
||||
(sid3.oneBitNoise?0x20:0)|
|
||||
(sid3.separateNoisePitch?0x10:0)|
|
||||
(sid3.doWavetable?8:0)|
|
||||
(sid3.resetDuty?4:0)|
|
||||
(sid3.oscSync?2:0)|
|
||||
(sid3.ringMod?1:0)
|
||||
);
|
||||
|
||||
w->writeC(sid3.phase_mod_source);
|
||||
w->writeC(sid3.ring_mod_source);
|
||||
w->writeC(sid3.sync_source);
|
||||
w->writeC(sid3.special_wave);
|
||||
w->writeC(sid3.phaseInv);
|
||||
w->writeC(sid3.feedback);
|
||||
|
||||
w->writeC(4); // number of filters
|
||||
|
||||
for (int i=0; i<4; i++) {
|
||||
w->writeC(
|
||||
(sid3.filt[i].enabled?0x80:0)|
|
||||
(sid3.filt[i].init?0x40:0)|
|
||||
(sid3.filt[i].absoluteCutoff?0x20:0)|
|
||||
(sid3.filt[i].bindCutoffToNote?0x10:0)|
|
||||
(sid3.filt[i].bindCutoffToNoteDir?8:0)|
|
||||
(sid3.filt[i].bindCutoffOnNote?4:0)|
|
||||
(sid3.filt[i].bindResonanceToNote?2:0)|
|
||||
(sid3.filt[i].bindResonanceToNoteDir?1:0)
|
||||
);
|
||||
|
||||
w->writeC(
|
||||
(sid3.filt[i].bindResonanceOnNote?0x80:0)
|
||||
);
|
||||
|
||||
w->writeS(sid3.filt[i].cutoff);
|
||||
|
||||
w->writeC(sid3.filt[i].resonance);
|
||||
w->writeC(sid3.filt[i].output_volume);
|
||||
w->writeC(sid3.filt[i].distortion_level);
|
||||
w->writeC(sid3.filt[i].mode);
|
||||
w->writeC(sid3.filt[i].filter_matrix);
|
||||
|
||||
w->writeC(sid3.filt[i].bindCutoffToNoteStrength);
|
||||
w->writeC(sid3.filt[i].bindCutoffToNoteCenter);
|
||||
w->writeC(sid3.filt[i].bindResonanceToNoteStrength);
|
||||
w->writeC(sid3.filt[i].bindResonanceToNoteCenter);
|
||||
}
|
||||
|
||||
FEATURE_END;
|
||||
}
|
||||
|
||||
void DivInstrument::putInsData2(SafeWriter* w, bool fui, const DivSong* song, bool insName) {
|
||||
size_t blockStartSeek=0;
|
||||
size_t blockEndSeek=0;
|
||||
|
|
@ -1041,6 +1175,7 @@ void DivInstrument::putInsData2(SafeWriter* w, bool fui, const DivSong* song, bo
|
|||
bool featureEF=false;
|
||||
bool featurePN=false;
|
||||
bool featureS2=false;
|
||||
bool featureS3=false;
|
||||
|
||||
bool checkForWL=false;
|
||||
|
||||
|
|
@ -1284,6 +1419,11 @@ void DivInstrument::putInsData2(SafeWriter* w, bool fui, const DivSong* song, bo
|
|||
feature64=true;
|
||||
featureS2=true;
|
||||
break;
|
||||
case DIV_INS_SID3:
|
||||
feature64=true;
|
||||
featureS2=true;
|
||||
featureS3=true;
|
||||
break;
|
||||
case DIV_INS_SUPERVISION:
|
||||
featureSM=true;
|
||||
if (amiga.useSample) featureSL=true;
|
||||
|
|
@ -1346,6 +1486,9 @@ void DivInstrument::putInsData2(SafeWriter* w, bool fui, const DivSong* song, bo
|
|||
if (sid2!=defaultIns.sid2) {
|
||||
featureS2=true;
|
||||
}
|
||||
if (sid3!=defaultIns.sid3) {
|
||||
featureS3=true;
|
||||
}
|
||||
}
|
||||
|
||||
// check ins name
|
||||
|
|
@ -1497,6 +1640,9 @@ void DivInstrument::putInsData2(SafeWriter* w, bool fui, const DivSong* song, bo
|
|||
if (featureS2) {
|
||||
writeFeatureS2(w);
|
||||
}
|
||||
if (featureS3) {
|
||||
writeFeatureS3(w);
|
||||
}
|
||||
|
||||
if (fui && (featureSL || featureWL)) {
|
||||
w->write("EN",2);
|
||||
|
|
@ -1812,7 +1958,12 @@ void DivInstrument::readFeature64(SafeReader& reader, bool& volIsCutoff, short v
|
|||
c64.res=cr>>12;
|
||||
|
||||
if (version>=199) {
|
||||
c64.res|=((unsigned char)reader.readC())<<4;
|
||||
next=(unsigned char)reader.readC();
|
||||
c64.res|=(next&15)<<4;
|
||||
|
||||
if (version>=222) {
|
||||
c64.resetDuty=next&0x10;
|
||||
}
|
||||
}
|
||||
|
||||
READ_FEAT_END;
|
||||
|
|
@ -2345,6 +2496,82 @@ void DivInstrument::readFeatureS2(SafeReader& reader, short version) {
|
|||
READ_FEAT_END;
|
||||
}
|
||||
|
||||
void DivInstrument::readFeatureS3(SafeReader& reader, short version) {
|
||||
READ_FEAT_BEGIN;
|
||||
|
||||
unsigned char next=reader.readC();
|
||||
|
||||
sid3.dutyIsAbs=next&0x80;
|
||||
sid3.noiseOn=next&8;
|
||||
sid3.pulseOn=next&4;
|
||||
sid3.sawOn=next&2;
|
||||
sid3.triOn=next&1;
|
||||
|
||||
sid3.a=reader.readC();
|
||||
sid3.d=reader.readC();
|
||||
sid3.s=reader.readC();
|
||||
sid3.sr=reader.readC();
|
||||
sid3.r=reader.readC();
|
||||
|
||||
sid3.mixMode=reader.readC();
|
||||
|
||||
sid3.duty=reader.readS();
|
||||
|
||||
next=reader.readC();
|
||||
|
||||
sid3.phase_mod=next&0x80;
|
||||
sid3.specialWaveOn=next&0x40;
|
||||
sid3.oneBitNoise=next&0x20;
|
||||
sid3.separateNoisePitch=next&0x10;
|
||||
sid3.doWavetable=next&8;
|
||||
sid3.resetDuty=next&4;
|
||||
sid3.oscSync=next&2;
|
||||
sid3.ringMod=next&1;
|
||||
|
||||
sid3.phase_mod_source=reader.readC();
|
||||
sid3.ring_mod_source=reader.readC();
|
||||
sid3.sync_source=reader.readC();
|
||||
sid3.special_wave=reader.readC();
|
||||
sid3.phaseInv=reader.readC();
|
||||
sid3.feedback=reader.readC();
|
||||
|
||||
unsigned char numFilters=reader.readC();
|
||||
|
||||
for (int i=0; i<numFilters; i++) {
|
||||
if (i>=4) break;
|
||||
|
||||
next=reader.readC();
|
||||
|
||||
sid3.filt[i].enabled=next&0x80;
|
||||
sid3.filt[i].init=next&0x40;
|
||||
sid3.filt[i].absoluteCutoff=next&0x20;
|
||||
sid3.filt[i].bindCutoffToNote=next&0x10;
|
||||
sid3.filt[i].bindCutoffToNoteDir=next&8;
|
||||
sid3.filt[i].bindCutoffOnNote=next&4;
|
||||
sid3.filt[i].bindResonanceToNote=next&2;
|
||||
sid3.filt[i].bindResonanceToNoteDir=next&1;
|
||||
|
||||
next=reader.readC();
|
||||
|
||||
sid3.filt[i].bindResonanceOnNote=next&0x80;
|
||||
|
||||
sid3.filt[i].cutoff=reader.readS();
|
||||
|
||||
sid3.filt[i].resonance=reader.readC();
|
||||
sid3.filt[i].output_volume=reader.readC();
|
||||
sid3.filt[i].distortion_level=reader.readC();
|
||||
sid3.filt[i].mode=reader.readC();
|
||||
sid3.filt[i].filter_matrix=reader.readC();
|
||||
|
||||
sid3.filt[i].bindCutoffToNoteStrength=reader.readC();
|
||||
sid3.filt[i].bindCutoffToNoteCenter=reader.readC();
|
||||
sid3.filt[i].bindResonanceToNoteStrength=reader.readC();
|
||||
sid3.filt[i].bindResonanceToNoteCenter=reader.readC();
|
||||
}
|
||||
|
||||
READ_FEAT_END;
|
||||
}
|
||||
|
||||
DivDataErrors DivInstrument::readInsDataNew(SafeReader& reader, short version, bool fui, DivSong* song) {
|
||||
unsigned char featCode[2];
|
||||
bool volIsCutoff=false;
|
||||
|
|
@ -2419,6 +2646,8 @@ DivDataErrors DivInstrument::readInsDataNew(SafeReader& reader, short version, b
|
|||
readFeaturePN(reader,version);
|
||||
} else if (memcmp(featCode,"S2",2)==0) { // SID2
|
||||
readFeatureS2(reader,version);
|
||||
} else if (memcmp(featCode,"S3",2)==0) { // SID3
|
||||
readFeatureS3(reader,version);
|
||||
} else {
|
||||
if (song==NULL && (memcmp(featCode,"SL",2)==0 || (memcmp(featCode,"WL",2)==0))) {
|
||||
// nothing
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ enum DivInstrumentType: unsigned short {
|
|||
DIV_INS_SID2=63, // coincidence!
|
||||
DIV_INS_SUPERVISION=64,
|
||||
DIV_INS_UPD1771C=65,
|
||||
DIV_INS_SID3=66,
|
||||
DIV_INS_MAX,
|
||||
DIV_INS_NULL
|
||||
};
|
||||
|
|
@ -429,7 +430,7 @@ struct DivInstrumentC64 {
|
|||
unsigned char a, d, s, r;
|
||||
unsigned short duty;
|
||||
unsigned char ringMod, oscSync;
|
||||
bool toFilter, initFilter, dutyIsAbs, filterIsAbs, noTest;
|
||||
bool toFilter, initFilter, dutyIsAbs, filterIsAbs, noTest, resetDuty;
|
||||
unsigned char res;
|
||||
unsigned short cut;
|
||||
bool hp, lp, bp, ch3off;
|
||||
|
|
@ -456,6 +457,7 @@ struct DivInstrumentC64 {
|
|||
dutyIsAbs(false),
|
||||
filterIsAbs(false),
|
||||
noTest(false),
|
||||
resetDuty(true),
|
||||
res(0),
|
||||
cut(0),
|
||||
hp(false),
|
||||
|
|
@ -869,6 +871,111 @@ struct DivInstrumentSID2 {
|
|||
noiseMode(0) {}
|
||||
};
|
||||
|
||||
struct DivInstrumentSID3 {
|
||||
bool triOn, sawOn, pulseOn, noiseOn;
|
||||
unsigned char a, d, s, r;
|
||||
unsigned char sr;
|
||||
unsigned short duty;
|
||||
unsigned char ringMod, oscSync;
|
||||
bool phase_mod;
|
||||
unsigned char phase_mod_source, ring_mod_source, sync_source;
|
||||
bool specialWaveOn;
|
||||
bool oneBitNoise;
|
||||
bool separateNoisePitch;
|
||||
unsigned char special_wave;
|
||||
bool doWavetable;
|
||||
bool dutyIsAbs;
|
||||
bool resetDuty;
|
||||
unsigned char phaseInv;
|
||||
unsigned char feedback;
|
||||
unsigned char mixMode;
|
||||
|
||||
struct Filter {
|
||||
unsigned short cutoff;
|
||||
unsigned char resonance;
|
||||
unsigned char output_volume;
|
||||
unsigned char distortion_level;
|
||||
unsigned char mode;
|
||||
bool enabled;
|
||||
bool init;
|
||||
unsigned char filter_matrix;
|
||||
|
||||
// this is done purely in software
|
||||
bool absoluteCutoff;
|
||||
bool bindCutoffToNote;
|
||||
unsigned char bindCutoffToNoteStrength; // how much cutoff changes over e.g. 1 semitone
|
||||
unsigned char bindCutoffToNoteCenter; // central note of the cutoff change
|
||||
bool bindCutoffToNoteDir; // if we decrease or increase cutoff if e.g. we go upper in note space
|
||||
bool bindCutoffOnNote; // only do cutoff scaling once, on new note
|
||||
|
||||
bool bindResonanceToNote;
|
||||
unsigned char bindResonanceToNoteStrength; // how much resonance changes over e.g. 1 semitone
|
||||
unsigned char bindResonanceToNoteCenter; // central note of the resonance change
|
||||
bool bindResonanceToNoteDir; // if we decrease or increase resonance if e.g. we go upper in note space
|
||||
bool bindResonanceOnNote; // only do resonance scaling once, on new note
|
||||
|
||||
bool operator==(const Filter& other);
|
||||
bool operator!=(const Filter& other) {
|
||||
return !(*this==other);
|
||||
}
|
||||
Filter():
|
||||
cutoff(0),
|
||||
resonance(0),
|
||||
output_volume(0),
|
||||
distortion_level(0),
|
||||
mode(0),
|
||||
enabled(false),
|
||||
init(false),
|
||||
filter_matrix(0),
|
||||
absoluteCutoff(false),
|
||||
bindCutoffToNote(false),
|
||||
bindCutoffToNoteStrength(0),
|
||||
bindCutoffToNoteCenter(0),
|
||||
bindCutoffToNoteDir(false),
|
||||
bindCutoffOnNote(false),
|
||||
bindResonanceToNote(false),
|
||||
bindResonanceToNoteStrength(0),
|
||||
bindResonanceToNoteCenter(0),
|
||||
bindResonanceToNoteDir(false),
|
||||
bindResonanceOnNote(false) {}
|
||||
} filt[4];
|
||||
|
||||
bool operator==(const DivInstrumentSID3& other);
|
||||
bool operator!=(const DivInstrumentSID3& other) {
|
||||
return !(*this==other);
|
||||
}
|
||||
DivInstrumentSID3():
|
||||
triOn(false),
|
||||
sawOn(true),
|
||||
pulseOn(false),
|
||||
noiseOn(false),
|
||||
a(0),
|
||||
d(64),
|
||||
s(0),
|
||||
r(0),
|
||||
sr(0),
|
||||
duty(32768),
|
||||
ringMod(0),
|
||||
oscSync(0),
|
||||
phase_mod(false),
|
||||
phase_mod_source(0),
|
||||
ring_mod_source(0),
|
||||
sync_source(0),
|
||||
specialWaveOn(false),
|
||||
oneBitNoise(false),
|
||||
separateNoisePitch(false),
|
||||
special_wave(0),
|
||||
doWavetable(false),
|
||||
dutyIsAbs(true),
|
||||
resetDuty(false),
|
||||
phaseInv(0),
|
||||
feedback(0),
|
||||
mixMode(0) {
|
||||
filt[0].mode=16|32; // default settings so filter just works, connect to input and channel output
|
||||
filt[0].output_volume=0xff;
|
||||
}
|
||||
};
|
||||
|
||||
struct DivInstrumentPOD {
|
||||
DivInstrumentType type;
|
||||
DivInstrumentFM fm;
|
||||
|
|
@ -887,6 +994,7 @@ struct DivInstrumentPOD {
|
|||
DivInstrumentESFM esfm;
|
||||
DivInstrumentPowerNoise powernoise;
|
||||
DivInstrumentSID2 sid2;
|
||||
DivInstrumentSID3 sid3;
|
||||
|
||||
DivInstrumentPOD() :
|
||||
type(DIV_INS_FM) {
|
||||
|
|
@ -985,6 +1093,7 @@ struct DivInstrument : DivInstrumentPOD {
|
|||
void writeFeatureEF(SafeWriter* w);
|
||||
void writeFeaturePN(SafeWriter* w);
|
||||
void writeFeatureS2(SafeWriter* w);
|
||||
void writeFeatureS3(SafeWriter* w);
|
||||
|
||||
void readFeatureNA(SafeReader& reader, short version);
|
||||
void readFeatureFM(SafeReader& reader, short version);
|
||||
|
|
@ -1008,6 +1117,7 @@ struct DivInstrument : DivInstrumentPOD {
|
|||
void readFeatureEF(SafeReader& reader, short version);
|
||||
void readFeaturePN(SafeReader& reader, short version);
|
||||
void readFeatureS2(SafeReader& reader, short version);
|
||||
void readFeatureS3(SafeReader& reader, short version);
|
||||
|
||||
DivDataErrors readInsDataOld(SafeReader& reader, short version);
|
||||
DivDataErrors readInsDataNew(SafeReader& reader, short version, bool fui, DivSong* song);
|
||||
|
|
|
|||
|
|
@ -37,8 +37,7 @@ unsigned short DivDispatch::getPan(int chan) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
DivChannelPair DivDispatch::getPaired(int chan) {
|
||||
return DivChannelPair();
|
||||
void DivDispatch::getPaired(int ch, std::vector<DivChannelPair>& ret) {
|
||||
}
|
||||
|
||||
DivChannelModeHints DivDispatch::getModeHints(int chan) {
|
||||
|
|
|
|||
|
|
@ -561,12 +561,11 @@ float DivPlatformC140::getPostAmp() {
|
|||
return 3.0f;
|
||||
}
|
||||
|
||||
DivChannelPair DivPlatformC140::getPaired(int ch) {
|
||||
if (!is219) return DivChannelPair();
|
||||
void DivPlatformC140::getPaired(int ch, std::vector<DivChannelPair>& ret) {
|
||||
if (!is219) return;
|
||||
if ((ch&3)==0) {
|
||||
return DivChannelPair(bankLabel[ch>>2],ch+1,ch+2,ch+3,-1,-1,-1,-1,-1);
|
||||
ret.push_back(DivChannelPair(bankLabel[ch>>2],ch+1,ch+2,ch+3,-1,-1,-1,-1,-1));
|
||||
}
|
||||
return DivChannelPair();
|
||||
}
|
||||
|
||||
const void* DivPlatformC140::getSampleMem(int index) {
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class DivPlatformC140: public DivDispatch {
|
|||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
unsigned short getPan(int chan);
|
||||
DivChannelPair getPaired(int chan);
|
||||
void getPaired(int ch, std::vector<DivChannelPair>& ret);
|
||||
DivDispatchOscBuffer* getOscBuffer(int chan);
|
||||
unsigned char* getRegisterPool();
|
||||
int getRegisterPoolSize();
|
||||
|
|
|
|||
|
|
@ -158,6 +158,21 @@ void DivPlatformC64::tick(bool sysTick) {
|
|||
int i=chanOrder[_i];
|
||||
|
||||
chan[i].std.next();
|
||||
|
||||
if (sysTick) {
|
||||
if (chan[i].pw_slide!=0) {
|
||||
chan[i].duty-=chan[i].pw_slide;
|
||||
chan[i].duty=CLAMP(chan[i].duty,0,0xfff);
|
||||
rWrite(i*7+2,chan[i].duty&0xff);
|
||||
rWrite(i*7+3,(chan[i].duty>>8)|(chan[i].outVol<<4));
|
||||
}
|
||||
if (cutoff_slide!=0) {
|
||||
filtCut+=cutoff_slide;
|
||||
filtCut=CLAMP(filtCut,0,0x7ff);
|
||||
updateFilter();
|
||||
}
|
||||
}
|
||||
|
||||
if (chan[i].std.vol.had) {
|
||||
vol=MIN(15,chan[i].std.vol.val);
|
||||
willUpdateFilter=true;
|
||||
|
|
@ -305,7 +320,7 @@ int DivPlatformC64::dispatch(DivCommand c) {
|
|||
chan[c.chan].active=true;
|
||||
chan[c.chan].keyOn=true;
|
||||
chan[c.chan].test=false;
|
||||
if (chan[c.chan].insChanged || chan[c.chan].resetDuty || ins->std.waveMacro.len>0) {
|
||||
if (((chan[c.chan].insChanged || chan[c.chan].resetDuty || ins->std.waveMacro.len>0) && ins->c64.resetDuty) || chan[c.chan].resetDuty) {
|
||||
chan[c.chan].duty=ins->c64.duty;
|
||||
rWrite(c.chan*7+2,chan[c.chan].duty&0xff);
|
||||
rWrite(c.chan*7+3,chan[c.chan].duty>>8);
|
||||
|
|
@ -535,6 +550,12 @@ int DivPlatformC64::dispatch(DivCommand c) {
|
|||
chan[c.chan].release=c.value&15;
|
||||
rWrite(c.chan*7+6,(chan[c.chan].sustain<<4)|(chan[c.chan].release));
|
||||
break;
|
||||
case DIV_CMD_C64_PW_SLIDE:
|
||||
chan[c.chan].pw_slide=c.value*c.value2;
|
||||
break;
|
||||
case DIV_CMD_C64_CUTOFF_SLIDE:
|
||||
cutoff_slide=c.value*c.value2;
|
||||
break;
|
||||
case DIV_CMD_MACRO_OFF:
|
||||
chan[c.chan].std.mask(c.value,true);
|
||||
break;
|
||||
|
|
@ -600,6 +621,23 @@ DivMacroInt* DivPlatformC64::getChanMacroInt(int ch) {
|
|||
return &chan[ch].std;
|
||||
}
|
||||
|
||||
void DivPlatformC64::getPaired(int ch, std::vector<DivChannelPair>& ret) {
|
||||
if (chan[ch].ring) {
|
||||
if (ch==0){
|
||||
ret.push_back(DivChannelPair(_("ring"),2));
|
||||
} else {
|
||||
ret.push_back(DivChannelPair(_("ring"),(ch-1)%3));
|
||||
}
|
||||
}
|
||||
if (chan[ch].sync) {
|
||||
if (ch==0) {
|
||||
ret.push_back(DivChannelPair(_("sync"),2));
|
||||
} else {
|
||||
ret.push_back(DivChannelPair(_("sync"),(ch-1)%3));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DivChannelModeHints DivPlatformC64::getModeHints(int ch) {
|
||||
DivChannelModeHints ret;
|
||||
ret.count=1;
|
||||
|
|
@ -653,8 +691,11 @@ void DivPlatformC64::reset() {
|
|||
chan[i].std.setEngine(parent);
|
||||
fakeLow[i]=0;
|
||||
fakeBand[i]=0;
|
||||
chan[i].pw_slide=0;
|
||||
}
|
||||
|
||||
cutoff_slide=0;
|
||||
|
||||
if (sidCore==2) {
|
||||
dSID_init(sid_d,chipClock,rate,sidIs6581?6581:8580,needInitTables);
|
||||
dSID_setMuteMask(
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ class DivPlatformC64: public DivDispatch {
|
|||
short duty;
|
||||
bool sweepChanged, filter;
|
||||
bool resetMask, resetFilter, resetDuty, gate, ring, sync, test;
|
||||
short pw_slide;
|
||||
Channel():
|
||||
SharedChannel<signed char>(15),
|
||||
prevFreq(65535),
|
||||
|
|
@ -56,7 +57,8 @@ class DivPlatformC64: public DivDispatch {
|
|||
gate(true),
|
||||
ring(false),
|
||||
sync(false),
|
||||
test(false) {}
|
||||
test(false),
|
||||
pw_slide(0) {}
|
||||
};
|
||||
Channel chan[3];
|
||||
DivDispatchOscBuffer* oscBuf[3];
|
||||
|
|
@ -76,6 +78,7 @@ class DivPlatformC64: public DivDispatch {
|
|||
unsigned char writeOscBuf;
|
||||
unsigned char sidCore;
|
||||
int filtCut, resetTime, initResetTime;
|
||||
short cutoff_slide;
|
||||
|
||||
bool keyPriority, sidIs6581, needInitTables, no1EUpdate, multiplyRel, macroRace;
|
||||
unsigned char chanOrder[3];
|
||||
|
|
@ -114,6 +117,7 @@ class DivPlatformC64: public DivDispatch {
|
|||
bool isVolGlobal();
|
||||
float getPostAmp();
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
void getPaired(int ch, std::vector<DivChannelPair>& ret);
|
||||
DivChannelModeHints getModeHints(int chan);
|
||||
void notifyInsDeletion(void* ins);
|
||||
void poke(unsigned int addr, unsigned short val);
|
||||
|
|
|
|||
|
|
@ -524,12 +524,16 @@ unsigned short DivPlatformDave::getPan(int ch) {
|
|||
return (chan[ch].panL<<8)|chan[ch].panR;
|
||||
}
|
||||
|
||||
// TODO: the rest
|
||||
DivChannelPair DivPlatformDave::getPaired(int ch) {
|
||||
void DivPlatformDave::getPaired(int ch, std::vector<DivChannelPair>& ret) {
|
||||
if (chan[ch].highPass) {
|
||||
DivChannelPair("high",(ch+1)&3);
|
||||
ret.push_back(DivChannelPair(_("high"),(ch+1)&3));
|
||||
}
|
||||
if (chan[ch].ringMod) {
|
||||
ret.push_back(DivChannelPair(_("ring"),(ch+2)&3));
|
||||
}
|
||||
if (chan[ch].lowPass && ch==3) {
|
||||
ret.push_back(DivChannelPair(_("low"),2));
|
||||
}
|
||||
return DivChannelPair();
|
||||
}
|
||||
|
||||
DivChannelModeHints DivPlatformDave::getModeHints(int ch) {
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class DivPlatformDave: public DivDispatch {
|
|||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
unsigned short getPan(int chan);
|
||||
DivChannelPair getPaired(int chan);
|
||||
void getPaired(int ch, std::vector<DivChannelPair>& ret);
|
||||
DivChannelModeHints getModeHints(int chan);
|
||||
DivSamplePos getSamplePos(int ch);
|
||||
DivDispatchOscBuffer* getOscBuffer(int chan);
|
||||
|
|
|
|||
|
|
@ -771,6 +771,8 @@ int DivPlatformGBAMinMod::init(DivEngine* p, int channels, int sugRate, const Di
|
|||
setFlags(flags);
|
||||
reset();
|
||||
|
||||
maxCPU=0.0; // initialize!
|
||||
|
||||
return 16;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2646,13 +2646,12 @@ unsigned short DivPlatformOPL::getPan(int ch) {
|
|||
return ((chan[ch].pan&1)<<8)|((chan[ch].pan&2)>>1);
|
||||
}
|
||||
|
||||
DivChannelPair DivPlatformOPL::getPaired(int ch) {
|
||||
void DivPlatformOPL::getPaired(int ch, std::vector<DivChannelPair>& ret) {
|
||||
if (oplType==3 && ch<12 && !(ch&1)) {
|
||||
if (chan[ch].fourOp) {
|
||||
return DivChannelPair("4OP",ch+1);
|
||||
ret.push_back(DivChannelPair(_("4OP"),ch+1));
|
||||
}
|
||||
}
|
||||
return DivChannelPair();
|
||||
}
|
||||
|
||||
DivDispatchOscBuffer* DivPlatformOPL::getOscBuffer(int ch) {
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ class DivPlatformOPL: public DivDispatch {
|
|||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
unsigned short getPan(int chan);
|
||||
DivChannelPair getPaired(int chan);
|
||||
void getPaired(int ch, std::vector<DivChannelPair>& ret);
|
||||
DivDispatchOscBuffer* getOscBuffer(int chan);
|
||||
int mapVelocity(int ch, float vel);
|
||||
float getGain(int ch, int vol);
|
||||
|
|
|
|||
|
|
@ -538,11 +538,10 @@ unsigned short DivPlatformPCE::getPan(int ch) {
|
|||
return ((chan[ch].pan&0xf0)<<4)|(chan[ch].pan&15);
|
||||
}
|
||||
|
||||
DivChannelPair DivPlatformPCE::getPaired(int ch) {
|
||||
void DivPlatformPCE::getPaired(int ch, std::vector<DivChannelPair>& ret) {
|
||||
if (ch==1 && lfoMode>0) {
|
||||
return DivChannelPair("mod",0);
|
||||
ret.push_back(DivChannelPair(_("mod"),0));
|
||||
}
|
||||
return DivChannelPair();
|
||||
}
|
||||
|
||||
DivChannelModeHints DivPlatformPCE::getModeHints(int ch) {
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class DivPlatformPCE: public DivDispatch {
|
|||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
unsigned short getPan(int chan);
|
||||
DivChannelPair getPaired(int chan);
|
||||
void getPaired(int ch, std::vector<DivChannelPair>& ret);
|
||||
DivChannelModeHints getModeHints(int chan);
|
||||
DivSamplePos getSamplePos(int ch);
|
||||
DivDispatchOscBuffer* getOscBuffer(int chan);
|
||||
|
|
|
|||
|
|
@ -407,22 +407,21 @@ DivMacroInt* DivPlatformPOKEY::getChanMacroInt(int ch) {
|
|||
return &chan[ch].std;
|
||||
}
|
||||
|
||||
DivChannelPair DivPlatformPOKEY::getPaired(int ch) {
|
||||
void DivPlatformPOKEY::getPaired(int ch, std::vector<DivChannelPair>& ret) {
|
||||
switch (ch) {
|
||||
case 0:
|
||||
if (audctl&4) return DivChannelPair("filter",2);
|
||||
if (audctl&4) ret.push_back(DivChannelPair(_("filter"),2));
|
||||
break;
|
||||
case 1:
|
||||
if (audctl&16) return DivChannelPair("16-bit",0);
|
||||
if (audctl&16) ret.push_back(DivChannelPair(_("16-bit"),0));
|
||||
break;
|
||||
case 2:
|
||||
if (audctl&8) return DivChannelPair("16-bit",3);
|
||||
if (audctl&8) ret.push_back(DivChannelPair(_("16-bit"),3));
|
||||
break;
|
||||
case 3:
|
||||
if (audctl&2) return DivChannelPair("filter",1);
|
||||
if (audctl&2) ret.push_back(DivChannelPair(_("filter"),1));
|
||||
break;
|
||||
}
|
||||
return DivChannelPair();
|
||||
}
|
||||
|
||||
DivDispatchOscBuffer* DivPlatformPOKEY::getOscBuffer(int ch) {
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class DivPlatformPOKEY: public DivDispatch {
|
|||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
DivChannelPair getPaired(int chan);
|
||||
void getPaired(int ch, std::vector<DivChannelPair>& ret);
|
||||
DivDispatchOscBuffer* getOscBuffer(int chan);
|
||||
unsigned char* getRegisterPool();
|
||||
int getRegisterPoolSize();
|
||||
|
|
|
|||
|
|
@ -93,7 +93,10 @@ void DivPlatformSID2::acquire(short** buf, size_t len)
|
|||
|
||||
for(int j = 0; j < 3; j++)
|
||||
{
|
||||
oscBuf[j]->data[oscBuf[j]->needle++] = sid2->chan_out[j] / 4;
|
||||
int co=sid2->chan_out[j]>>2;
|
||||
if (co<-32768) co=-32768;
|
||||
if (co>32767) co=32767;
|
||||
oscBuf[j]->data[oscBuf[j]->needle++]=co;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -113,6 +116,21 @@ void DivPlatformSID2::tick(bool sysTick) {
|
|||
bool willUpdateFilter = false;
|
||||
|
||||
chan[i].std.next();
|
||||
|
||||
if (sysTick) {
|
||||
if (chan[i].pw_slide!=0) {
|
||||
chan[i].duty-=chan[i].pw_slide;
|
||||
chan[i].duty=CLAMP(chan[i].duty,0,0xfff);
|
||||
rWrite(i*7+2,chan[i].duty&0xff);
|
||||
rWrite(i*7+3,(chan[i].duty>>8)|(chan[i].outVol<<4));
|
||||
}
|
||||
if (chan[i].cutoff_slide!=0) {
|
||||
chan[i].filtCut+=chan[i].cutoff_slide;
|
||||
chan[i].filtCut=CLAMP(chan[i].filtCut,0,0xfff);
|
||||
updateFilter(i);
|
||||
}
|
||||
}
|
||||
|
||||
if (chan[i].std.vol.had) {
|
||||
chan[i].outVol=VOL_SCALE_LINEAR(chan[i].vol&15,MIN(15,chan[i].std.vol.val),15);
|
||||
rWrite(i*7+3,(chan[i].duty>>8) | (chan[i].outVol << 4));
|
||||
|
|
@ -297,7 +315,7 @@ int DivPlatformSID2::dispatch(DivCommand c) {
|
|||
chan[c.chan].keyOn=true;
|
||||
chan[c.chan].test=false;
|
||||
|
||||
if (chan[c.chan].insChanged || chan[c.chan].resetDuty || ins->std.waveMacro.len>0) {
|
||||
if (((chan[c.chan].insChanged || chan[c.chan].resetDuty || ins->std.waveMacro.len>0) && ins->c64.resetDuty) || chan[c.chan].resetDuty) {
|
||||
chan[c.chan].duty=ins->c64.duty;
|
||||
rWrite(c.chan*7+2,chan[c.chan].duty&0xff);
|
||||
rWrite(c.chan*7+3,(chan[c.chan].duty>>8) | (chan[c.chan].outVol << 4));
|
||||
|
|
@ -521,6 +539,12 @@ int DivPlatformSID2::dispatch(DivCommand c) {
|
|||
break;
|
||||
}
|
||||
break;
|
||||
case DIV_CMD_C64_PW_SLIDE:
|
||||
chan[c.chan].pw_slide=c.value*c.value2;
|
||||
break;
|
||||
case DIV_CMD_C64_CUTOFF_SLIDE:
|
||||
chan[c.chan].cutoff_slide=c.value*c.value2;
|
||||
break;
|
||||
case DIV_CMD_MACRO_OFF:
|
||||
chan[c.chan].std.mask(c.value,true);
|
||||
break;
|
||||
|
|
@ -574,15 +598,31 @@ DivMacroInt* DivPlatformSID2::getChanMacroInt(int ch) {
|
|||
return &chan[ch].std;
|
||||
}
|
||||
|
||||
void DivPlatformSID2::getPaired(int ch, std::vector<DivChannelPair>& ret) {
|
||||
if (chan[ch].ring) {
|
||||
if (ch==0) {
|
||||
ret.push_back(DivChannelPair(_("ring"),2));
|
||||
} else {
|
||||
ret.push_back(DivChannelPair(_("ring"),(ch-1)%3));
|
||||
}
|
||||
}
|
||||
if (chan[ch].sync) {
|
||||
if (ch==0) {
|
||||
ret.push_back(DivChannelPair(_("sync"),2));
|
||||
} else {
|
||||
ret.push_back(DivChannelPair(_("sync"),(ch-1)%3));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DivChannelModeHints DivPlatformSID2::getModeHints(int ch) {
|
||||
DivChannelModeHints ret;
|
||||
ret.count=1;
|
||||
ret.hint[0]=ICON_FA_BELL_SLASH_O;
|
||||
ret.type[0]=0;
|
||||
if (ch == 2 && (chan[ch].filtControl & 8)) {
|
||||
ret.type[0] = 7;
|
||||
}
|
||||
else if (!chan[ch].gate) {
|
||||
if (ch==2 && (chan[ch].filtControl & 8)) {
|
||||
ret.type[0]=7;
|
||||
} else if (!chan[ch].gate) {
|
||||
ret.type[0]=4;
|
||||
}
|
||||
|
||||
|
|
@ -633,6 +673,9 @@ void DivPlatformSID2::reset() {
|
|||
chan[i].noise_mode = 0;
|
||||
|
||||
rWrite(0x3 + 7 * i,0xf0);
|
||||
|
||||
chan[i].cutoff_slide = 0;
|
||||
chan[i].pw_slide = 0;
|
||||
}
|
||||
|
||||
sid2->reset();
|
||||
|
|
|
|||
|
|
@ -36,7 +36,8 @@ class DivPlatformSID2: public DivDispatch {
|
|||
unsigned char noise_mode;
|
||||
unsigned char mix_mode;
|
||||
int filtCut;
|
||||
bool do_pw_sweep_writes, do_cutoff_sweep_writes;
|
||||
short cutoff_slide;
|
||||
short pw_slide;
|
||||
Channel():
|
||||
SharedChannel<signed char>(15),
|
||||
prevFreq(0x1ffff),
|
||||
|
|
@ -60,8 +61,8 @@ class DivPlatformSID2: public DivDispatch {
|
|||
noise_mode(0),
|
||||
mix_mode(0),
|
||||
filtCut(0),
|
||||
do_pw_sweep_writes(false),
|
||||
do_cutoff_sweep_writes(false) {}
|
||||
cutoff_slide(0),
|
||||
pw_slide(0) {}
|
||||
};
|
||||
Channel chan[3];
|
||||
DivDispatchOscBuffer* oscBuf[3];
|
||||
|
|
@ -108,6 +109,7 @@ class DivPlatformSID2: public DivDispatch {
|
|||
bool isVolGlobal();
|
||||
float getPostAmp();
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
void getPaired(int ch, std::vector<DivChannelPair>& ret);
|
||||
DivChannelModeHints getModeHints(int chan);
|
||||
void notifyInsDeletion(void* ins);
|
||||
void poke(unsigned int addr, unsigned short val);
|
||||
|
|
|
|||
1411
src/engine/platform/sid3.cpp
Normal file
1411
src/engine/platform/sid3.cpp
Normal file
File diff suppressed because it is too large
Load diff
276
src/engine/platform/sid3.h
Normal file
276
src/engine/platform/sid3.h
Normal file
|
|
@ -0,0 +1,276 @@
|
|||
/**
|
||||
* Furnace Tracker - multi-system chiptune tracker
|
||||
* Copyright (C) 2021-2024 tildearrow and contributors
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#ifndef _SID3_H
|
||||
#define _SID3_H
|
||||
|
||||
#include "../dispatch.h"
|
||||
#include "../../fixedQueue.h"
|
||||
#include "../waveSynth.h"
|
||||
#include "sound/sid3.h"
|
||||
|
||||
class DivPlatformSID3: public DivDispatch {
|
||||
struct Channel: public SharedChannel<signed short> {
|
||||
int prevFreq;
|
||||
unsigned char wave, special_wave, attack, decay, sustain, sr, release;
|
||||
int duty;
|
||||
bool resetMask, resetFilter, resetDuty, gate, ring, sync, phase, oneBitNoise;
|
||||
bool phaseReset, envReset, phaseResetNoise;
|
||||
bool noiseFreqChanged;
|
||||
unsigned char vol;
|
||||
unsigned char noise_mode;
|
||||
unsigned char mix_mode;
|
||||
unsigned char ringSrc, syncSrc, phaseSrc;
|
||||
unsigned char panLeft, panRight;
|
||||
int noiseFreq;
|
||||
bool independentNoiseFreq;
|
||||
unsigned int noiseLFSRMask;
|
||||
|
||||
struct Filter
|
||||
{
|
||||
int cutoff;
|
||||
unsigned char resonance;
|
||||
unsigned char output_volume;
|
||||
unsigned char distortion_level;
|
||||
unsigned char mode;
|
||||
bool enabled;
|
||||
unsigned char filter_matrix;
|
||||
|
||||
short cutoff_slide;
|
||||
|
||||
bool bindCutoffToNote; //cutoff scaling
|
||||
unsigned char bindCutoffToNoteStrength; //how much cutoff changes over e.g. 1 semitone
|
||||
unsigned char bindCutoffToNoteCenter; //central note of the cutoff change
|
||||
bool bindCutoffToNoteDir; //if we decrease or increase cutoff if e.g. we go upper in note space
|
||||
|
||||
bool bindResonanceToNote;
|
||||
unsigned char bindResonanceToNoteStrength; //how much resonance changes over e.g. 1 semitone
|
||||
unsigned char bindResonanceToNoteCenter; //central note of the resonance change
|
||||
bool bindResonanceToNoteDir; //if we decrease or increase resonance if e.g. we go upper in note space
|
||||
|
||||
Filter():
|
||||
cutoff(0),
|
||||
resonance(0),
|
||||
output_volume(0),
|
||||
distortion_level(0),
|
||||
mode(0),
|
||||
enabled(false),
|
||||
filter_matrix(0),
|
||||
cutoff_slide(0),
|
||||
bindCutoffToNote(false),
|
||||
bindCutoffToNoteStrength(0),
|
||||
bindCutoffToNoteCenter(0),
|
||||
bindCutoffToNoteDir(false),
|
||||
bindResonanceToNote(false),
|
||||
bindResonanceToNoteStrength(0),
|
||||
bindResonanceToNoteCenter(0),
|
||||
bindResonanceToNoteDir(false) {}
|
||||
} filt[SID3_NUM_FILTERS];
|
||||
|
||||
int noise_baseNoteOverride;
|
||||
bool noise_fixedArp;
|
||||
int noise_arpOff;
|
||||
int noise_pitch2;
|
||||
bool noise_hasArp;
|
||||
bool noise_hasPitch;
|
||||
|
||||
bool pcm;
|
||||
int wavetable;
|
||||
|
||||
long long dacPeriod, dacRate, dacOut;
|
||||
unsigned long long dacPos;
|
||||
int dacSample;
|
||||
|
||||
unsigned char phaseInv;
|
||||
unsigned char feedback;
|
||||
|
||||
short pw_slide;
|
||||
|
||||
short phase_reset_counter;
|
||||
short noise_phase_reset_counter;
|
||||
short envelope_reset_counter;
|
||||
|
||||
void handleArpNoise(int offset=0)
|
||||
{
|
||||
DivMacroStruct& m = this->std.op[3].am;
|
||||
|
||||
if (m.had) {
|
||||
noise_hasArp=true;
|
||||
|
||||
if (m.val<0) {
|
||||
if (!(m.val&0x40000000)) {
|
||||
noise_baseNoteOverride=(m.val|0x40000000)+offset;
|
||||
noise_fixedArp=true;
|
||||
} else {
|
||||
noise_arpOff=m.val;
|
||||
noise_fixedArp=false;
|
||||
}
|
||||
} else {
|
||||
if (m.val&0x40000000) {
|
||||
noise_baseNoteOverride=(m.val&(~0x40000000))+offset;
|
||||
noise_fixedArp=true;
|
||||
} else {
|
||||
noise_arpOff=m.val;
|
||||
noise_fixedArp=false;
|
||||
}
|
||||
}
|
||||
noiseFreqChanged=true;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
noise_hasArp=false;
|
||||
}
|
||||
}
|
||||
|
||||
void handlePitchNoise()
|
||||
{
|
||||
DivMacroStruct& m = this->std.op[0].ar;
|
||||
|
||||
if (m.had) {
|
||||
noise_hasPitch=true;
|
||||
|
||||
if (m.mode) {
|
||||
noise_pitch2+=m.val;
|
||||
CLAMP_VAR(noise_pitch2,-131071,131071);
|
||||
} else {
|
||||
noise_pitch2=m.val;
|
||||
}
|
||||
noiseFreqChanged=true;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
noise_hasPitch=false;
|
||||
}
|
||||
}
|
||||
|
||||
Channel():
|
||||
SharedChannel<signed short>(SID3_MAX_VOL),
|
||||
prevFreq(0xffffff),
|
||||
wave(0),
|
||||
special_wave(0),
|
||||
attack(0),
|
||||
decay(0),
|
||||
sustain(0),
|
||||
sr(0),
|
||||
release(0),
|
||||
duty(0),
|
||||
resetMask(false),
|
||||
resetFilter(false),
|
||||
resetDuty(false),
|
||||
gate(true),
|
||||
ring(false),
|
||||
sync(false),
|
||||
phase(false),
|
||||
oneBitNoise(false),
|
||||
phaseReset(false),
|
||||
envReset(false),
|
||||
phaseResetNoise(false),
|
||||
noiseFreqChanged(false),
|
||||
vol(SID3_MAX_VOL),
|
||||
noise_mode(0),
|
||||
mix_mode(0),
|
||||
ringSrc(0),
|
||||
syncSrc(0),
|
||||
phaseSrc(0),
|
||||
panLeft(0xff),
|
||||
panRight(0xff),
|
||||
noiseFreq(0),
|
||||
independentNoiseFreq(false),
|
||||
noiseLFSRMask((1 << 29) | (1 << 5) | (1 << 3) | 1), //https://docs.amd.com/v/u/en-US/xapp052 for 30 bits: 30, 6, 4, 1
|
||||
pcm(false),
|
||||
wavetable(-1),
|
||||
dacPeriod(0),
|
||||
dacRate(0),
|
||||
dacOut(0),
|
||||
dacPos(0),
|
||||
dacSample(-1),
|
||||
phaseInv(0),
|
||||
feedback(0),
|
||||
pw_slide(0),
|
||||
phase_reset_counter(-1),
|
||||
noise_phase_reset_counter(-1),
|
||||
envelope_reset_counter(-1) {}
|
||||
};
|
||||
Channel chan[SID3_NUM_CHANNELS];
|
||||
DivDispatchOscBuffer* oscBuf[SID3_NUM_CHANNELS];
|
||||
struct QueuedWrite {
|
||||
unsigned short addr;
|
||||
unsigned char val;
|
||||
QueuedWrite(): addr(0), val(0) {}
|
||||
QueuedWrite(unsigned short a, unsigned char v): addr(a), val(v) {}
|
||||
};
|
||||
FixedQueue<QueuedWrite,SID3_NUM_REGISTERS * 4> writes;
|
||||
DivWaveSynth ws;
|
||||
|
||||
unsigned char writeOscBuf;
|
||||
|
||||
SID3* sid3;
|
||||
unsigned char regPool[SID3_NUM_REGISTERS];
|
||||
|
||||
bool isMuted[SID3_NUM_CHANNELS];
|
||||
|
||||
unsigned char sampleTick; //used to update streamed sample and not clash with other reg writes at high rate samples
|
||||
bool updateSample;
|
||||
bool quarterClock;
|
||||
|
||||
friend void putDispatchChip(void*,int);
|
||||
friend void putDispatchChan(void*,int,int);
|
||||
|
||||
void updateFlags(int channel, bool gate);
|
||||
void updateFilter(int channel, int filter);
|
||||
void updateFreq(int channel);
|
||||
void updateNoiseFreq(int channel);
|
||||
void updateNoiseLFSRMask(int channel);
|
||||
void updateDuty(int channel);
|
||||
void updateEnvelope(int channel);
|
||||
void updatePanning(int channel);
|
||||
void updateWave();
|
||||
|
||||
public:
|
||||
void acquire(short** buf, size_t len);
|
||||
int dispatch(DivCommand c);
|
||||
void* getChanState(int chan);
|
||||
DivDispatchOscBuffer* getOscBuffer(int chan);
|
||||
unsigned char* getRegisterPool();
|
||||
int getRegisterPoolSize();
|
||||
void reset();
|
||||
void forceIns();
|
||||
void tick(bool sysTick=true);
|
||||
void muteChannel(int ch, bool mute);
|
||||
void setFlags(const DivConfig& flags);
|
||||
void notifyInsChange(int ins);
|
||||
void notifyWaveChange(int wave);
|
||||
float getPostAmp();
|
||||
bool getDCOffRequired();
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
DivChannelModeHints getModeHints(int chan);
|
||||
void notifyInsDeletion(void* ins);
|
||||
void poke(unsigned int addr, unsigned short val);
|
||||
void poke(std::vector<DivRegWrite>& wlist);
|
||||
const char** getRegisterSheet();
|
||||
int init(DivEngine* parent, int channels, int sugRate, const DivConfig& flags);
|
||||
int getOutputCount();
|
||||
void getPaired(int ch, std::vector<DivChannelPair>& ret);
|
||||
void quit();
|
||||
~DivPlatformSID3();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -723,11 +723,10 @@ unsigned short DivPlatformSNES::getPan(int ch) {
|
|||
return (chan[ch].panL<<8)|chan[ch].panR;
|
||||
}
|
||||
|
||||
DivChannelPair DivPlatformSNES::getPaired(int ch) {
|
||||
void DivPlatformSNES::getPaired(int ch, std::vector<DivChannelPair>& ret) {
|
||||
if (chan[ch].pitchMod) {
|
||||
return DivChannelPair("mod",(ch-1)&7);
|
||||
ret.push_back(DivChannelPair(_("mod"),(ch-1)&7));
|
||||
}
|
||||
return DivChannelPair();
|
||||
}
|
||||
|
||||
DivChannelModeHints DivPlatformSNES::getModeHints(int ch) {
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class DivPlatformSNES: public DivDispatch {
|
|||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
unsigned short getPan(int chan);
|
||||
DivChannelPair getPaired(int chan);
|
||||
void getPaired(int ch, std::vector<DivChannelPair>& ret);
|
||||
DivChannelModeHints getModeHints(int chan);
|
||||
DivSamplePos getSamplePos(int ch);
|
||||
DivDispatchOscBuffer* getOscBuffer(int chan);
|
||||
|
|
|
|||
3856
src/engine/platform/sound/sid3.c
Normal file
3856
src/engine/platform/sound/sid3.c
Normal file
File diff suppressed because it is too large
Load diff
285
src/engine/platform/sound/sid3.h
Normal file
285
src/engine/platform/sound/sid3.h
Normal file
|
|
@ -0,0 +1,285 @@
|
|||
#ifndef SID3_H
|
||||
#define SID3_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define SID3_NUM_CHANNELS 7
|
||||
#define SID3_NUM_FILTERS 4
|
||||
#define SID3_REGISTERS_PER_CHANNEL 64
|
||||
#define SID3_REGISTERS_PER_FILTER 8
|
||||
#define SID3_NUM_REGISTERS (SID3_NUM_CHANNELS * SID3_REGISTERS_PER_CHANNEL)
|
||||
#define SID3_MAX_VOL 255
|
||||
|
||||
#define SID3_WAVETABLE_LENGTH 256
|
||||
|
||||
#define SID3_NUM_WAVEFORM_BITS 5
|
||||
|
||||
#define SID3_NUM_UNIQUE_SPECIAL_WAVES 28
|
||||
#define SID3_NUM_SPECIAL_WAVES (SID3_NUM_UNIQUE_SPECIAL_WAVES * 2 + 2) /* usual and 2x vol clipped + 2x vol clipped tri and saw... */
|
||||
#define SID3_SPECIAL_WAVE_LENGTH 16384
|
||||
|
||||
#define SID3_EXPONENTIAL_LUT_LENGTH ((0xff0000 >> 8) + 1)
|
||||
|
||||
#define SID3_ACC_BITS 30
|
||||
#define SID3_ACC_MASK ((1UL << SID3_ACC_BITS) - 1)
|
||||
|
||||
enum Flags
|
||||
{
|
||||
SID3_CHAN_ENABLE_GATE = 1,
|
||||
SID3_CHAN_ENABLE_RING_MOD = 2,
|
||||
SID3_CHAN_ENABLE_HARD_SYNC = 4,
|
||||
SID3_CHAN_ENABLE_PHASE_MOD = 8,
|
||||
SID3_CHAN_PHASE_RESET = 16,
|
||||
SID3_CHAN_ENV_RESET = 32,
|
||||
SID3_CHAN_NOISE_PHASE_RESET = 64,
|
||||
SID3_CHAN_1_BIT_NOISE = 128,
|
||||
};
|
||||
|
||||
enum PhaseInversion
|
||||
{
|
||||
SID3_INV_SIGNAL_RIGHT = 1,
|
||||
SID3_INV_SIGNAL_LEFT = 2,
|
||||
};
|
||||
|
||||
enum Waveforms
|
||||
{
|
||||
SID3_WAVE_TRIANGLE = 1,
|
||||
SID3_WAVE_SAW = 2,
|
||||
SID3_WAVE_PULSE = 4,
|
||||
SID3_WAVE_NOISE = 8,
|
||||
SID3_WAVE_SPECIAL = 16,
|
||||
};
|
||||
|
||||
enum Mixmodes
|
||||
{
|
||||
SID3_MIX_8580 = 0,
|
||||
SID3_MIX_AND = 1,
|
||||
SID3_MIX_OR = 2,
|
||||
SID3_MIX_XOR = 3,
|
||||
SID3_MIX_SUM = 4,
|
||||
};
|
||||
|
||||
enum Filter_modes
|
||||
{
|
||||
SID3_FILTER_LP = 1,
|
||||
SID3_FILTER_HP = 2,
|
||||
SID3_FILTER_BP = 4,
|
||||
|
||||
SID3_FILTER_MODES_MASK = 7,
|
||||
|
||||
SID3_FILTER_ENABLE = 8,
|
||||
SID3_FILTER_CHANNEL_INPUT = 16, //add channel input to filter input
|
||||
SID3_FILTER_OUTPUT = 32, //output sound from this filter to channel output
|
||||
};
|
||||
|
||||
enum Registers
|
||||
{
|
||||
SID3_REGISTER_FLAGS = 0,
|
||||
|
||||
SID3_REGISTER_ADSR_A = 1,
|
||||
SID3_REGISTER_ADSR_D = 2,
|
||||
SID3_REGISTER_ADSR_S = 3,
|
||||
SID3_REGISTER_ADSR_SR = 4,
|
||||
SID3_REGISTER_ADSR_R = 5,
|
||||
|
||||
SID3_REGISTER_WAVEFORM = 6,
|
||||
|
||||
SID3_REGISTER_PW_HIGH = 7,
|
||||
SID3_REGISTER_PW_LOW = 8,
|
||||
|
||||
SID3_REGISTER_SPECIAL_WAVE = 9,
|
||||
|
||||
SID3_REGISTER_FREQ_HIGH = 10,
|
||||
SID3_REGISTER_FREQ_MID = 11,
|
||||
SID3_REGISTER_FREQ_LOW = 12,
|
||||
|
||||
SID3_REGISTER_ADSR_VOL = 13,
|
||||
|
||||
SID3_REGISTER_MIXMODE = 14,
|
||||
|
||||
SID3_REGISTER_RING_MOD_SRC = 15,
|
||||
SID3_REGISTER_SYNC_SRC = 16,
|
||||
|
||||
SID3_REGISTER_FILT_BASE = 17,
|
||||
SID3_REGISTER_FILT_MODE = 17,
|
||||
SID3_REGISTER_FILT_CUTOFF_HIGH = 18,
|
||||
SID3_REGISTER_FILT_CUTOFF_LOW = 19,
|
||||
SID3_REGISTER_FILT_RESONANCE = 20,
|
||||
SID3_REGISTER_FILT_DISTORTION = 21,
|
||||
SID3_REGISTER_FILT_CONNECTION = 22,
|
||||
SID3_REGISTER_FILT_OUTPUT_VOLUME = 23,
|
||||
|
||||
SID3_REGISTER_AFTER_FILT_1ST_REG = SID3_REGISTER_FILT_BASE + SID3_REGISTERS_PER_FILTER * SID3_NUM_FILTERS,
|
||||
SID3_REGISTER_PHASE_MOD_SRC = SID3_REGISTER_AFTER_FILT_1ST_REG,
|
||||
|
||||
SID3_REGISTER_PAN_LEFT = SID3_REGISTER_AFTER_FILT_1ST_REG + 1,
|
||||
SID3_REGISTER_PAN_RIGHT = SID3_REGISTER_AFTER_FILT_1ST_REG + 2,
|
||||
|
||||
SID3_REGISTER_NOISE_FREQ_HIGH = SID3_REGISTER_AFTER_FILT_1ST_REG + 3,
|
||||
SID3_REGISTER_NOISE_FREQ_MID = SID3_REGISTER_AFTER_FILT_1ST_REG + 4,
|
||||
SID3_REGISTER_NOISE_FREQ_LOW = SID3_REGISTER_AFTER_FILT_1ST_REG + 5,
|
||||
|
||||
SID3_REGISTER_NOISE_LFSR_HIGHEST = SID3_REGISTER_AFTER_FILT_1ST_REG + 6,
|
||||
SID3_REGISTER_NOISE_LFSR_HIGH = SID3_REGISTER_AFTER_FILT_1ST_REG + 7,
|
||||
SID3_REGISTER_NOISE_LFSR_MID = SID3_REGISTER_AFTER_FILT_1ST_REG + 8,
|
||||
SID3_REGISTER_NOISE_LFSR_LOW = SID3_REGISTER_AFTER_FILT_1ST_REG + 9,
|
||||
|
||||
SID3_REGISTER_STREAMED_SAMPLE_HIGH = SID3_REGISTER_AFTER_FILT_1ST_REG + 10,
|
||||
SID3_REGISTER_STREAMED_SAMPLE_LOW = SID3_REGISTER_AFTER_FILT_1ST_REG + 11,
|
||||
|
||||
SID3_REGISTER_PHASE_INVERSION = SID3_REGISTER_AFTER_FILT_1ST_REG + 12,
|
||||
|
||||
SID3_REGISTER_FEEDBACK = SID3_REGISTER_AFTER_FILT_1ST_REG + 13,
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t input;
|
||||
int32_t output;
|
||||
|
||||
// State of filter.
|
||||
float Vhp; // highpass
|
||||
float Vbp; // bandpass
|
||||
float Vlp; // lowpass
|
||||
|
||||
// Cutoff frequency, resonance.
|
||||
float w0, w0_ceil_1;
|
||||
float _1024_div_Q;
|
||||
|
||||
double distortion_multiplier; //pre-calculated distortion multiplier for tanh() simple distortion
|
||||
double tanh_distortion_multiplier; //pre-calculated tanh(distortion multiplier)
|
||||
|
||||
uint16_t cutoff;
|
||||
uint8_t resonance;
|
||||
uint8_t distortion_level;
|
||||
|
||||
uint8_t mode;
|
||||
|
||||
uint8_t output_volume;
|
||||
} sid3_filter;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
sid3_filter filt[SID3_NUM_FILTERS];
|
||||
uint8_t connection_matrix[SID3_NUM_FILTERS];
|
||||
} sid3_filters_block;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t a, d, s, sr, r, vol, state;
|
||||
|
||||
uint32_t envelope_counter;
|
||||
uint32_t envelope_speed;
|
||||
bool hold_zero;
|
||||
} sid3_channel_adsr;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t accumulator;
|
||||
uint8_t sync_bit;
|
||||
uint32_t frequency;
|
||||
|
||||
uint32_t noise_accumulator;
|
||||
uint32_t noise_frequency;
|
||||
|
||||
uint32_t lfsr, lfsr_taps;
|
||||
|
||||
uint8_t waveform;
|
||||
uint8_t special_wave;
|
||||
|
||||
uint16_t pw;
|
||||
|
||||
uint8_t mix_mode;
|
||||
|
||||
sid3_channel_adsr adsr;
|
||||
|
||||
uint8_t flags;
|
||||
|
||||
uint8_t ring_mod_src;
|
||||
uint8_t hard_sync_src;
|
||||
uint8_t phase_mod_source;
|
||||
|
||||
sid3_filters_block filt;
|
||||
uint8_t clock_filter;
|
||||
|
||||
uint8_t panning_left, panning_right;
|
||||
|
||||
int32_t output_before_filter;
|
||||
|
||||
uint8_t phase_inv;
|
||||
uint32_t feedback;
|
||||
|
||||
int32_t prev_output, prev_output2;
|
||||
} sid3_channel;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t accumulator;
|
||||
uint8_t sync_bit;
|
||||
uint32_t frequency;
|
||||
|
||||
uint16_t streamed_sample;
|
||||
uint8_t wavetable[SID3_WAVETABLE_LENGTH];
|
||||
|
||||
uint8_t wave_address;
|
||||
|
||||
sid3_channel_adsr adsr;
|
||||
|
||||
uint8_t flags;
|
||||
uint8_t mode;
|
||||
|
||||
uint8_t ring_mod_src;
|
||||
uint8_t hard_sync_src;
|
||||
uint8_t phase_mod_source;
|
||||
|
||||
sid3_filters_block filt;
|
||||
uint8_t clock_filter;
|
||||
|
||||
uint8_t panning_left, panning_right;
|
||||
|
||||
int32_t output_before_filter;
|
||||
|
||||
uint8_t phase_inv;
|
||||
} sid3_wavetable_chan;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t special_waves[SID3_NUM_SPECIAL_WAVES][SID3_SPECIAL_WAVE_LENGTH]; //sine wave and OPL3-ish waves + OPZ and YMF825 waves!
|
||||
|
||||
uint16_t env_counter_to_exponential_output[SID3_EXPONENTIAL_LUT_LENGTH];
|
||||
uint32_t exponential_output_to_envelope_counter[SID3_EXPONENTIAL_LUT_LENGTH];
|
||||
|
||||
sid3_channel chan[SID3_NUM_CHANNELS - 1];
|
||||
sid3_wavetable_chan wave_chan;
|
||||
|
||||
int32_t output_l, output_r;
|
||||
|
||||
int32_t channel_signals_before_ADSR[SID3_NUM_CHANNELS];
|
||||
int32_t channel_output[SID3_NUM_CHANNELS];
|
||||
int32_t wave_channel_signal_before_ADSR;
|
||||
int32_t wave_channel_output;
|
||||
|
||||
//emulation-only helpers
|
||||
bool muted[SID3_NUM_CHANNELS];
|
||||
uint32_t clock_rate; //in Hz. 1 MHz default
|
||||
} SID3;
|
||||
|
||||
SID3* sid3_create();
|
||||
void sid3_reset(SID3* sid3);
|
||||
void sid3_write(SID3* sid3, uint16_t address, uint8_t data);
|
||||
void sid3_clock(SID3* sid3);
|
||||
void sid3_set_is_muted(SID3* sid3, uint8_t ch, bool mute);
|
||||
void sid3_set_clock_rate(SID3* sid3, uint32_t clock);
|
||||
void sid3_free(SID3* sid3);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
|
@ -67,6 +67,22 @@ void DivPlatformSoundUnit::writeControlUpper(int ch) {
|
|||
void DivPlatformSoundUnit::tick(bool sysTick) {
|
||||
for (int i=0; i<8; i++) {
|
||||
chan[i].std.next();
|
||||
if (sysTick) {
|
||||
if (chan[i].pw_slide!=0) {
|
||||
chan[i].virtual_duty-=chan[i].pw_slide;
|
||||
chan[i].virtual_duty=CLAMP(chan[i].virtual_duty,0,0xfff);
|
||||
chan[i].duty=chan[i].virtual_duty>>5;
|
||||
|
||||
chWrite(i,0x08,chan[i].duty);
|
||||
}
|
||||
if (chan[i].cutoff_slide!=0) {
|
||||
chan[i].cutoff+=chan[i].cutoff_slide*4;
|
||||
chan[i].cutoff=CLAMP(chan[i].cutoff,0,0x3fff);
|
||||
|
||||
chWrite(i,0x06,chan[i].cutoff&0xff);
|
||||
chWrite(i,0x07,chan[i].cutoff>>8);
|
||||
}
|
||||
}
|
||||
if (chan[i].std.vol.had) {
|
||||
DivInstrument* ins=parent->getIns(chan[i].ins,DIV_INS_SU);
|
||||
if (ins->type==DIV_INS_AMIGA) {
|
||||
|
|
@ -86,6 +102,7 @@ void DivPlatformSoundUnit::tick(bool sysTick) {
|
|||
}
|
||||
if (chan[i].std.duty.had) {
|
||||
chan[i].duty=chan[i].std.duty.val;
|
||||
chan[i].virtual_duty=(unsigned short)chan[i].duty<<5;
|
||||
chWrite(i,0x08,chan[i].duty);
|
||||
}
|
||||
if (chan[i].std.wave.had) {
|
||||
|
|
@ -351,6 +368,7 @@ int DivPlatformSoundUnit::dispatch(DivCommand c) {
|
|||
break;
|
||||
case DIV_CMD_STD_NOISE_MODE:
|
||||
chan[c.chan].duty=c.value&127;
|
||||
chan[c.chan].virtual_duty=(unsigned short)chan[c.chan].duty << 5;
|
||||
chWrite(c.chan,0x08,chan[c.chan].duty);
|
||||
break;
|
||||
case DIV_CMD_C64_RESONANCE:
|
||||
|
|
@ -498,6 +516,12 @@ int DivPlatformSoundUnit::dispatch(DivCommand c) {
|
|||
if (!chan[c.chan].inPorta && c.value && !parent->song.brokenPortaArp && chan[c.chan].std.arp.will && !NEW_ARP_STRAT) chan[c.chan].baseFreq=NOTE_SU(c.chan,chan[c.chan].note);
|
||||
chan[c.chan].inPorta=c.value;
|
||||
break;
|
||||
case DIV_CMD_C64_PW_SLIDE:
|
||||
chan[c.chan].pw_slide=c.value*c.value2;
|
||||
break;
|
||||
case DIV_CMD_C64_CUTOFF_SLIDE:
|
||||
chan[c.chan].cutoff_slide=c.value*c.value2;
|
||||
break;
|
||||
case DIV_CMD_GET_VOLMAX:
|
||||
return 127;
|
||||
break;
|
||||
|
|
@ -564,6 +588,11 @@ void DivPlatformSoundUnit::reset() {
|
|||
for (int i=0; i<8; i++) {
|
||||
chan[i]=DivPlatformSoundUnit::Channel();
|
||||
chan[i].std.setEngine(parent);
|
||||
|
||||
chan[i].cutoff_slide=0;
|
||||
chan[i].pw_slide=0;
|
||||
|
||||
chan[i].virtual_duty=0x800; // for some reason duty by default is 50%
|
||||
}
|
||||
if (dumpWrites) {
|
||||
addWrite(0xffffffff,0);
|
||||
|
|
|
|||
|
|
@ -38,6 +38,9 @@ class DivPlatformSoundUnit: public DivDispatch {
|
|||
signed short wave;
|
||||
unsigned short hwSeqPos;
|
||||
short hwSeqDelay;
|
||||
short cutoff_slide;
|
||||
short pw_slide;
|
||||
short virtual_duty;
|
||||
Channel():
|
||||
SharedChannel<signed char>(127),
|
||||
cutoff(16383),
|
||||
|
|
@ -71,7 +74,10 @@ class DivPlatformSoundUnit: public DivDispatch {
|
|||
syncTimer(0),
|
||||
wave(0),
|
||||
hwSeqPos(0),
|
||||
hwSeqDelay(0) {}
|
||||
hwSeqDelay(0),
|
||||
cutoff_slide(0),
|
||||
pw_slide(0),
|
||||
virtual_duty(0) {}
|
||||
};
|
||||
Channel chan[8];
|
||||
DivDispatchOscBuffer* oscBuf[8];
|
||||
|
|
|
|||
|
|
@ -265,7 +265,7 @@ const char* cmdName[]={
|
|||
"BIFURCATOR_PARAMETER",
|
||||
|
||||
"FDS_MOD_AUTO",
|
||||
|
||||
|
||||
"FM_OPMASK",
|
||||
|
||||
"MULTIPCM_MIX_FM",
|
||||
|
|
@ -282,7 +282,30 @@ const char* cmdName[]={
|
|||
"MULTIPCM_DAMP",
|
||||
"MULTIPCM_PSEUDO_REVERB",
|
||||
"MULTIPCM_LFO_RESET",
|
||||
"MULTIPCM_LEVEL_DIRECT"
|
||||
"MULTIPCM_LEVEL_DIRECT",
|
||||
|
||||
"SID3_SPECIAL_WAVE",
|
||||
"SID3_RING_MOD_SRC",
|
||||
"SID3_HARD_SYNC_SRC",
|
||||
"SID3_PHASE_MOD_SRC",
|
||||
"SID3_WAVE_MIX",
|
||||
"SID3_LFSR_FEEDBACK_BITS",
|
||||
"SID3_1_BIT_NOISE",
|
||||
"SID3_FILTER_DISTORTION",
|
||||
"SID3_FILTER_OUTPUT_VOLUME",
|
||||
"SID3_CHANNEL_INVERSION",
|
||||
"SID3_FILTER_CONNECTION",
|
||||
"SID3_FILTER_MATRIX",
|
||||
"SID3_FILTER_ENABLE",
|
||||
|
||||
"C64_PW_SLIDE",
|
||||
"C64_CUTOFF_SLIDE",
|
||||
|
||||
"SID3_PHASE_RESET",
|
||||
"SID3_NOISE_PHASE_RESET",
|
||||
"SID3_ENVELOPE_RESET",
|
||||
"SID3_CUTOFF_SCALING",
|
||||
"SID3_RESONANCE_SCALING"
|
||||
};
|
||||
|
||||
static_assert((sizeof(cmdName)/sizeof(void*))==DIV_CMD_MAX,"update cmdName!");
|
||||
|
|
|
|||
|
|
@ -143,6 +143,7 @@ enum DivSystem {
|
|||
DIV_SYSTEM_SID2,
|
||||
DIV_SYSTEM_SUPERVISION,
|
||||
DIV_SYSTEM_UPD1771C,
|
||||
DIV_SYSTEM_SID3,
|
||||
|
||||
DIV_SYSTEM_MAX
|
||||
};
|
||||
|
|
|
|||
|
|
@ -634,6 +634,12 @@ void DivEngine::registerSystems() {
|
|||
{0x1e, {DIV_CMD_C64_EXTENDED, _("1Exy: Change other parameters (LEGACY)")}},
|
||||
{0x20, {DIV_CMD_C64_AD, _("20xy: Set attack/decay (x: attack; y: decay)")}},
|
||||
{0x21, {DIV_CMD_C64_SR, _("21xy: Set sustain/release (x: sustain; y: release)")}},
|
||||
|
||||
{0x22, {DIV_CMD_C64_PW_SLIDE, _("22xx: Pulse width slide up"), effectVal, constVal<1>}},
|
||||
{0x23, {DIV_CMD_C64_PW_SLIDE, _("23xx: Pulse width slide down"), effectVal, constVal<-1>}},
|
||||
|
||||
{0x24, {DIV_CMD_C64_CUTOFF_SLIDE, _("24xx: Filter cutoff slide up"), effectVal, constVal<1>}},
|
||||
{0x25, {DIV_CMD_C64_CUTOFF_SLIDE, _("25xx: Filter cutoff slide down"), effectVal, constVal<-1>}},
|
||||
};
|
||||
const EffectHandler c64FineDutyHandler(DIV_CMD_C64_FINE_DUTY, _("3xxx: Set pulse width (0 to FFF)"), effectValLong<12>);
|
||||
const EffectHandler c64FineCutoffHandler(DIV_CMD_C64_FINE_CUTOFF, _("4xxx: Set cutoff (0 to 7FF)"), effectValLong<11>);
|
||||
|
|
@ -706,12 +712,97 @@ void DivEngine::registerSystems() {
|
|||
{0x14, {DIV_CMD_C64_FILTER_RESET, _("14xy: Reset cutoff (x: on new note; y: now)")}},
|
||||
{0x15, {DIV_CMD_C64_DUTY_RESET, _("15xy: Reset pulse width (x: on new note; y: now)")}},
|
||||
{0x16, {DIV_CMD_C64_EXTENDED, _("16xy: Change other parameters")}},
|
||||
|
||||
{0x17, {DIV_CMD_C64_PW_SLIDE, _("17xx: Pulse width slide up"), effectVal, constVal<1>}},
|
||||
{0x18, {DIV_CMD_C64_PW_SLIDE, _("18xx: Pulse width slide down"), effectVal, constVal<-1>}},
|
||||
|
||||
{0x19, {DIV_CMD_C64_CUTOFF_SLIDE, _("19xx: Filter cutoff slide up"), effectVal, constVal<1>}},
|
||||
{0x1A, {DIV_CMD_C64_CUTOFF_SLIDE, _("1Axx: Filter cutoff slide down"), effectVal, constVal<-1>}},
|
||||
};
|
||||
const EffectHandler SID2FineDutyHandler(DIV_CMD_C64_FINE_DUTY, _("3xxx: Set pulse width (0 to FFF)"), effectValLong<12>);
|
||||
const EffectHandler SID2FineCutoffHandler(DIV_CMD_C64_FINE_CUTOFF, _("4xxx: Set cutoff (0 to FFF)"), effectValLong<11>);
|
||||
for (int i=0; i<16; i++) SID2PostEffectHandlerMap.emplace(0x30+i,SID2FineDutyHandler);
|
||||
for (int i=0; i<16; i++) SID2PostEffectHandlerMap.emplace(0x40+i,SID2FineCutoffHandler);
|
||||
|
||||
EffectHandlerMap SID3PostEffectHandlerMap={
|
||||
{0x60, {DIV_CMD_WAVE, _("60xx: Set waveform (bit 0: triangle; bit 1: saw; bit 2: pulse; bit 3: noise; bit 4: special wave)")}},
|
||||
{0x61, {DIV_CMD_SID3_SPECIAL_WAVE, _("61xx: Set special wave (00-39)")}},
|
||||
{0x62, {DIV_CMD_C64_EXTENDED, _("62xx: Modulation control (bit 0: ring mod; bit 1: osc. sync; bit 2: phase mod)")}},
|
||||
{0x63, {DIV_CMD_C64_DUTY_RESET, _("63xy: Reset pulse width (x: on new note; y: now)")}},
|
||||
|
||||
{0x64, {DIV_CMD_SID3_RING_MOD_SRC, _("64xx: Set ring modulation source channel (0-7)")}},
|
||||
{0x65, {DIV_CMD_SID3_HARD_SYNC_SRC, _("65xx: Set hard sync source channel (0-6)")}},
|
||||
{0x66, {DIV_CMD_SID3_PHASE_MOD_SRC, _("66xx: Set phase modulation source channel (0-6)")}},
|
||||
|
||||
{0x67, {DIV_CMD_FM_AR, _("67xx: Set attack")}},
|
||||
{0x68, {DIV_CMD_FM_DR, _("68xx: Set decay")}},
|
||||
{0x69, {DIV_CMD_FM_SL, _("69xx: Set sustain level")}},
|
||||
{0x6A, {DIV_CMD_FM_D2R, _("6Axx: Set sustain rate")}},
|
||||
{0x6B, {DIV_CMD_FM_RR, _("6Bxx: Set release")}},
|
||||
|
||||
{0x6C, {DIV_CMD_SID3_WAVE_MIX, _("6Cxx: Set wave mix mode (0-4)")}},
|
||||
|
||||
{0x6D, {DIV_CMD_SID3_LFSR_FEEDBACK_BITS, _("6Dxx: Set noise LFSR feedback bits (low byte)"), effectVal, constVal<0>}},
|
||||
{0x6E, {DIV_CMD_SID3_LFSR_FEEDBACK_BITS, _("6Exx: Set noise LFSR feedback bits (medium byte)"), effectVal, constVal<1>}},
|
||||
{0x6F, {DIV_CMD_SID3_LFSR_FEEDBACK_BITS, _("6Fxx: Set noise LFSR feedback bits (higher byte)"), effectVal, constVal<2>}},
|
||||
{0x70, {DIV_CMD_SID3_LFSR_FEEDBACK_BITS, _("70xx: Set noise LFSR feedback bits (highest bits, 0-3F)"), effectVal, constVal<3>}},
|
||||
|
||||
{0x71, {DIV_CMD_C64_RESONANCE, _("71xx: Set filter 1 resonance"), effectVal, constVal<0>}},
|
||||
{0x72, {DIV_CMD_C64_RESONANCE, _("72xx: Set filter 2 resonance"), effectVal, constVal<1>}},
|
||||
{0x73, {DIV_CMD_C64_RESONANCE, _("73xx: Set filter 3 resonance"), effectVal, constVal<2>}},
|
||||
{0x74, {DIV_CMD_C64_RESONANCE, _("74xx: Set filter 4 resonance"), effectVal, constVal<3>}},
|
||||
|
||||
{0x75, {DIV_CMD_SID3_1_BIT_NOISE, _("75xx: Set noise mode (0: usual noise, 1: 1-bit noise (PCM mode on wave channel))")}},
|
||||
|
||||
{0x76, {DIV_CMD_SID3_FILTER_OUTPUT_VOLUME, _("76xx: Set filter 1 output volume"), effectVal, constVal<0>}},
|
||||
{0x77, {DIV_CMD_SID3_FILTER_OUTPUT_VOLUME, _("77xx: Set filter 2 output volume"), effectVal, constVal<1>}},
|
||||
{0x78, {DIV_CMD_SID3_FILTER_OUTPUT_VOLUME, _("78xx: Set filter 3 output volume"), effectVal, constVal<2>}},
|
||||
{0x79, {DIV_CMD_SID3_FILTER_OUTPUT_VOLUME, _("79xx: Set filter 4 output volume"), effectVal, constVal<3>}},
|
||||
|
||||
{0x7A, {DIV_CMD_SID3_FILTER_DISTORTION, _("7Axx: Set filter 1 distortion"), effectVal, constVal<0>}},
|
||||
{0x7B, {DIV_CMD_SID3_FILTER_DISTORTION, _("7Bxx: Set filter 2 distortion"), effectVal, constVal<1>}},
|
||||
{0x7C, {DIV_CMD_SID3_FILTER_DISTORTION, _("7Cxx: Set filter 3 distortion"), effectVal, constVal<2>}},
|
||||
{0x7D, {DIV_CMD_SID3_FILTER_DISTORTION, _("7Dxx: Set filter 4 distortion"), effectVal, constVal<3>}},
|
||||
|
||||
{0x7E, {DIV_CMD_FM_FB, _("7Exx: Set feedback")}},
|
||||
{0x7F, {DIV_CMD_SID3_CHANNEL_INVERSION, _("7Fxx: Set channel signal inversion (bit 0: right channel, bit 1: left channel)")}},
|
||||
|
||||
{0xA0, {DIV_CMD_C64_FILTER_MODE, _("A0xy: Set filter mode (x: filter (0-3); y: bit 0: low pass; bit 1: band pass; bit 2: high pass)")}},
|
||||
{0xA1, {DIV_CMD_SID3_FILTER_CONNECTION, _("A1xy: Set filter connection (x: filter (0-3); y: bit 0: connect to channel input; bit 1: connect to channel output)")}},
|
||||
{0xA2, {DIV_CMD_SID3_FILTER_MATRIX, _("A2xy: Set filter connection matrix (x: filter (0-3); y: bits 0-3: add filter 1-4 output to filter's input)")}},
|
||||
{0xA3, {DIV_CMD_SID3_FILTER_ENABLE, _("A3xy: Enable filter (x: filter (0-3); y: enable)")}},
|
||||
|
||||
{0xA4, {DIV_CMD_C64_PW_SLIDE, _("A4xx: Pulse width slide up"), effectVal, constVal<1>}},
|
||||
{0xA5, {DIV_CMD_C64_PW_SLIDE, _("A5xx: Pulse width slide down"), effectVal, constVal<-1>}},
|
||||
|
||||
{0xA6, {DIV_CMD_C64_CUTOFF_SLIDE, _("A6xx: Filter 1 cutoff slide up"), effectVal, constVal<1>}},
|
||||
{0xA7, {DIV_CMD_C64_CUTOFF_SLIDE, _("A7xx: Filter 1 cutoff slide down"), effectVal, constVal<-1>}},
|
||||
{0xA8, {DIV_CMD_C64_CUTOFF_SLIDE, _("A8xx: Filter 2 cutoff slide up"), effectVal, constVal<2>}},
|
||||
{0xA9, {DIV_CMD_C64_CUTOFF_SLIDE, _("A9xx: Filter 2 cutoff slide down"), effectVal, constVal<-2>}},
|
||||
{0xAA, {DIV_CMD_C64_CUTOFF_SLIDE, _("AAxx: Filter 3 cutoff slide up"), effectVal, constVal<3>}},
|
||||
{0xAB, {DIV_CMD_C64_CUTOFF_SLIDE, _("ABxx: Filter 3 cutoff slide down"), effectVal, constVal<-3>}},
|
||||
{0xAC, {DIV_CMD_C64_CUTOFF_SLIDE, _("ACxx: Filter 4 cutoff slide up"), effectVal, constVal<4>}},
|
||||
{0xAD, {DIV_CMD_C64_CUTOFF_SLIDE, _("ADxx: Filter 4 cutoff slide down"), effectVal, constVal<-4>}},
|
||||
|
||||
{0xAE, {DIV_CMD_SID3_PHASE_RESET, _("AExx: Phase reset on tick xx")}},
|
||||
{0xAF, {DIV_CMD_SID3_NOISE_PHASE_RESET, _("AFxx: Noise phase reset on tick xx")}},
|
||||
{0xB0, {DIV_CMD_SID3_ENVELOPE_RESET, _("B0xx: Envelope reset on tick xx")}},
|
||||
|
||||
{0xB1, {DIV_CMD_SID3_CUTOFF_SCALING, _("B1xy: Cutoff scaling control (x: filter (0-3); y: bit 0: enable scaling; bit 1: invert scaling)")}},
|
||||
{0xB2, {DIV_CMD_SID3_RESONANCE_SCALING, _("B2xy: Resonance scaling control (x: filter (0-3); y: bit 0: enable scaling; bit 1: invert scaling)")}},
|
||||
};
|
||||
|
||||
const EffectHandler SID3FineDutyHandler(DIV_CMD_C64_FINE_DUTY, _("5xxx: Set pulse width (0 to FFF)"), effectValLong<12>);
|
||||
const EffectHandler SID3FineCutoffHandler1(DIV_CMD_C64_FINE_CUTOFF, _("1xxx: Set cutoff of filter 1 (0 to FFF)"), effectValLong<12>, constVal<0>);
|
||||
const EffectHandler SID3FineCutoffHandler2(DIV_CMD_C64_FINE_CUTOFF, _("2xxx: Set cutoff of filter 2 (0 to FFF)"), effectValLong<12>, constVal<1>);
|
||||
const EffectHandler SID3FineCutoffHandler3(DIV_CMD_C64_FINE_CUTOFF, _("3xxx: Set cutoff of filter 3 (0 to FFF)"), effectValLong<12>, constVal<2>);
|
||||
const EffectHandler SID3FineCutoffHandler4(DIV_CMD_C64_FINE_CUTOFF, _("4xxx: Set cutoff of filter 4 (0 to FFF)"), effectValLong<12>, constVal<3>);
|
||||
for (int i=0; i<16; i++) SID3PostEffectHandlerMap.emplace(0x50+i,SID3FineDutyHandler);
|
||||
for (int i=0; i<16; i++) SID3PostEffectHandlerMap.emplace(0x10+i,SID3FineCutoffHandler1);
|
||||
for (int i=0; i<16; i++) SID3PostEffectHandlerMap.emplace(0x20+i,SID3FineCutoffHandler2);
|
||||
for (int i=0; i<16; i++) SID3PostEffectHandlerMap.emplace(0x30+i,SID3FineCutoffHandler3);
|
||||
for (int i=0; i<16; i++) SID3PostEffectHandlerMap.emplace(0x40+i,SID3FineCutoffHandler4);
|
||||
|
||||
// SysDefs
|
||||
|
||||
// this chip uses YMZ ADPCM, but the emulator uses ADPCM-B because I got it wrong back then.
|
||||
|
|
@ -1500,7 +1591,7 @@ void DivEngine::registerSystems() {
|
|||
|
||||
sysDefs[DIV_SYSTEM_OPLL_DRUMS]=new DivSysDef(
|
||||
_("Yamaha YM2413 (OPLL) with drums"), NULL, 0xa7, 0, 11, true, false, 0x150, false, 0, 0, 0,
|
||||
_("the OPLL chips but with drums mode turned on."),
|
||||
_("the OPLL chip but with drums mode turned on."),
|
||||
{_("FM 1"), _("FM 2"), _("FM 3"), _("FM 4"), _("FM 5"), _("FM 6"), _("Kick"), _("Snare"), _("Tom"), _("Top"), _("HiHat")},
|
||||
{"F1", "F2", "F3", "F4", "F5", "F6", "BD", "SD", "TM", "TP", "HH"},
|
||||
{DIV_CH_FM, DIV_CH_FM, DIV_CH_FM, DIV_CH_FM, DIV_CH_FM, DIV_CH_FM, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE},
|
||||
|
|
@ -1756,6 +1847,12 @@ void DivEngine::registerSystems() {
|
|||
{0x20, {DIV_CMD_SU_SWEEP_ENABLE, _("20xx: Toggle frequency sweep (bit 0-6: speed; bit 7: direction is up)"), constVal<0>, effectVal}},
|
||||
{0x21, {DIV_CMD_SU_SWEEP_ENABLE, _("21xx: Toggle volume sweep (bit 0-4: speed; bit 5: direction is up; bit 6: loop; bit 7: alternate)"), constVal<1>, effectVal}},
|
||||
{0x22, {DIV_CMD_SU_SWEEP_ENABLE, _("22xx: Toggle cutoff sweep (bit 0-6: speed; bit 7: direction is up)"), constVal<2>, effectVal}},
|
||||
|
||||
{0x23, {DIV_CMD_C64_PW_SLIDE, _("23xx: Pulse width slide up"), effectVal, constVal<1>}},
|
||||
{0x24, {DIV_CMD_C64_PW_SLIDE, _("24xx: Pulse width slide down"), effectVal, constVal<-1>}},
|
||||
|
||||
{0x25, {DIV_CMD_C64_CUTOFF_SLIDE, _("25xx: Filter cutoff slide up"), effectVal, constVal<1>}},
|
||||
{0x26, {DIV_CMD_C64_CUTOFF_SLIDE, _("26xx: Filter cutoff slide down"), effectVal, constVal<-1>}},
|
||||
};
|
||||
const EffectHandler suCutoffHandler(DIV_CMD_C64_FINE_CUTOFF, _("4xxx: Set cutoff (0 to FFF)"), effectValLong<12>);
|
||||
for (int i=0; i<16; i++) {
|
||||
|
|
@ -2198,6 +2295,18 @@ void DivEngine::registerSystems() {
|
|||
SID2PostEffectHandlerMap
|
||||
);
|
||||
|
||||
sysDefs[DIV_SYSTEM_SID3]=new DivSysDef(
|
||||
_("SID3"), NULL, 0xf5, 0, 7, false, true, 0, false, (1U<<DIV_SAMPLE_DEPTH_8BIT)|(1U<<DIV_SAMPLE_DEPTH_16BIT), 256, 256,
|
||||
_("a fantasy sound chip created by LTVA. it is a big rework of SID chip with probably too many features added on top."),
|
||||
{_("Channel 1"), _("Channel 2"), _("Channel 3"), _("Channel 4"), _("Channel 5"), _("Channel 6"), _("Wave")},
|
||||
{"CH1", "CH2", "CH3", "CH4", "CH5", "CH6", "WA"},
|
||||
{DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_NOISE, DIV_CH_WAVE},
|
||||
{DIV_INS_SID3, DIV_INS_SID3, DIV_INS_SID3, DIV_INS_SID3, DIV_INS_SID3, DIV_INS_SID3, DIV_INS_SID3},
|
||||
{},
|
||||
{},
|
||||
SID3PostEffectHandlerMap
|
||||
);
|
||||
|
||||
sysDefs[DIV_SYSTEM_DUMMY]=new DivSysDef(
|
||||
_("Dummy System"), NULL, 0xfd, 0, 8, false, true, 0, false, 0, 0, 0,
|
||||
_("this is a system designed for testing purposes."),
|
||||
|
|
|
|||
|
|
@ -301,6 +301,8 @@ const char* aboutLine[]={
|
|||
_N("ep128emu by Istvan Varga"),
|
||||
_N("NDS sound emulator by cam900"),
|
||||
_N("openMSX YMF278 emulator (modified version) by the openMSX developers"),
|
||||
_N("SID2 emulator by LTVA (modification of reSID emulator)"),
|
||||
_N("SID3 emulator by LTVA"),
|
||||
"",
|
||||
_N("greetings to:"),
|
||||
"floxy!",
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -356,6 +356,7 @@ enum FurnaceGUIColors {
|
|||
GUI_COLOR_INSTR_SID2,
|
||||
GUI_COLOR_INSTR_SUPERVISION,
|
||||
GUI_COLOR_INSTR_UPD1771C,
|
||||
GUI_COLOR_INSTR_SID3,
|
||||
GUI_COLOR_INSTR_UNKNOWN,
|
||||
|
||||
GUI_COLOR_CHANNEL_BG,
|
||||
|
|
@ -2236,7 +2237,7 @@ class FurnaceGUI {
|
|||
vsync(1),
|
||||
frameRateLimit(60),
|
||||
displayRenderTime(0),
|
||||
inputRepeat(0),
|
||||
inputRepeat(1),
|
||||
glRedSize(8),
|
||||
glGreenSize(8),
|
||||
glBlueSize(8),
|
||||
|
|
@ -2749,9 +2750,11 @@ class FurnaceGUI {
|
|||
|
||||
void drawSSGEnv(unsigned char type, const ImVec2& size);
|
||||
void drawWaveform(unsigned char type, bool opz, const ImVec2& size);
|
||||
void drawWaveformSID3(unsigned char type, const ImVec2& size);
|
||||
void drawAlgorithm(unsigned char alg, FurnaceGUIFMAlgs algType, const ImVec2& size);
|
||||
void drawESFMAlgorithm(DivInstrumentESFM& esfm, const ImVec2& size);
|
||||
void drawFMEnv(unsigned char tl, unsigned char ar, unsigned char dr, unsigned char d2r, unsigned char rr, unsigned char sl, unsigned char sus, unsigned char egt, unsigned char algOrGlobalSus, float maxTl, float maxArDr, float maxRr, const ImVec2& size, unsigned short instType);
|
||||
void drawSID3Env(unsigned char tl, unsigned char ar, unsigned char dr, unsigned char d2r, unsigned char rr, unsigned char sl, unsigned char sus, unsigned char egt, unsigned char algOrGlobalSus, float maxTl, float maxArDr, float maxRr, const ImVec2& size, unsigned short instType);
|
||||
void drawGBEnv(unsigned char vol, unsigned char len, unsigned char sLen, bool dir, const ImVec2& size);
|
||||
bool drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& flags, bool modifyOnChange, bool fromMenu=false);
|
||||
void kvsConfig(DivInstrument* ins, bool supportsKVS=true);
|
||||
|
|
@ -2815,6 +2818,7 @@ class FurnaceGUI {
|
|||
|
||||
void insTabFMModernHeader(DivInstrument* ins);
|
||||
void insTabFM(DivInstrument* ins);
|
||||
void insTabWavetable(DivInstrument* ins);
|
||||
void insTabSample(DivInstrument* ins);
|
||||
|
||||
void drawOrderButtons();
|
||||
|
|
@ -2851,6 +2855,7 @@ class FurnaceGUI {
|
|||
void drawPattern();
|
||||
void drawInsList(bool asChild=false);
|
||||
void drawInsEdit();
|
||||
void drawInsSID3(DivInstrument* ins);
|
||||
void drawWaveList(bool asChild=false);
|
||||
void drawWaveEdit();
|
||||
void drawSampleList(bool asChild=false);
|
||||
|
|
|
|||
|
|
@ -186,6 +186,7 @@ const char* insTypes[DIV_INS_MAX+1][3]={
|
|||
{"SID2",ICON_FA_KEYBOARD_O,ICON_FUR_INS_SID2},
|
||||
{"Watara Supervision",ICON_FA_GAMEPAD,ICON_FUR_INS_SUPERVISION},
|
||||
{"NEC μPD1771C",ICON_FA_BAR_CHART,ICON_FUR_INS_UPD1771C},
|
||||
{"SID3",ICON_FA_KEYBOARD_O,ICON_FUR_INS_SID3},
|
||||
{NULL,ICON_FA_QUESTION,ICON_FA_QUESTION}
|
||||
};
|
||||
|
||||
|
|
@ -346,40 +347,40 @@ const FurnaceGUIColors fxColors[256]={
|
|||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
|
||||
// 60-6F
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
|
||||
// 70-7F
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
|
||||
// 80-8F
|
||||
GUI_COLOR_PATTERN_EFFECT_PANNING,
|
||||
|
|
@ -418,27 +419,27 @@ const FurnaceGUIColors fxColors[256]={
|
|||
GUI_COLOR_PATTERN_EFFECT_MISC,
|
||||
|
||||
// A0-AF
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
|
||||
// B0-BF
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
GUI_COLOR_PATTERN_EFFECT_INVALID,
|
||||
|
|
@ -1022,6 +1023,7 @@ const FurnaceGUIColorDef guiColors[GUI_COLOR_MAX]={
|
|||
D(GUI_COLOR_INSTR_SID2,"",ImVec4(0.6f,0.75f,1.0f,1.0f)),
|
||||
D(GUI_COLOR_INSTR_SUPERVISION,"",ImVec4(0.52f,1.0f,0.6f,1.0f)),
|
||||
D(GUI_COLOR_INSTR_UPD1771C,"",ImVec4(0.94f,0.52f,0.6f,1.0f)),
|
||||
D(GUI_COLOR_INSTR_SID3,"",ImVec4(0.6f,0.75f,0.6f,1.0f)),
|
||||
D(GUI_COLOR_INSTR_UNKNOWN,"",ImVec4(0.3f,0.3f,0.3f,1.0f)),
|
||||
|
||||
D(GUI_COLOR_CHANNEL_BG,"",ImVec4(0.4f,0.6f,0.8f,1.0f)),
|
||||
|
|
@ -1274,6 +1276,7 @@ const int availableSystems[]={
|
|||
DIV_SYSTEM_OPL4_DRUMS,
|
||||
DIV_SYSTEM_SUPERVISION,
|
||||
DIV_SYSTEM_UPD1771C,
|
||||
DIV_SYSTEM_SID3,
|
||||
0 // don't remove this last one!
|
||||
};
|
||||
|
||||
|
|
@ -1373,6 +1376,7 @@ const int chipsSpecial[]={
|
|||
DIV_SYSTEM_SID2,
|
||||
DIV_SYSTEM_SUPERVISION,
|
||||
DIV_SYSTEM_UPD1771C,
|
||||
DIV_SYSTEM_SID3,
|
||||
0 // don't remove this last one!
|
||||
};
|
||||
|
||||
|
|
|
|||
1412
src/gui/insEdit.cpp
1412
src/gui/insEdit.cpp
File diff suppressed because it is too large
Load diff
|
|
@ -33,6 +33,7 @@ const int _THIRTY_ONE=31;
|
|||
const int _SIXTY_FOUR=64;
|
||||
const int _ONE_HUNDRED=100;
|
||||
const int _ONE_HUNDRED_TWENTY_SEVEN=127;
|
||||
const int _ONE_HUNDRED_SEVENTY_NINE=179;
|
||||
const int _TWO_HUNDRED_FIFTY_FIVE=255;
|
||||
const int _FIVE_HUNDRED_ELEVEN=511;
|
||||
const int _TWO_THOUSAND_FORTY_SEVEN=2047;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ extern const int _THIRTY_ONE;
|
|||
extern const int _SIXTY_FOUR;
|
||||
extern const int _ONE_HUNDRED;
|
||||
extern const int _ONE_HUNDRED_TWENTY_SEVEN;
|
||||
extern const int _ONE_HUNDRED_SEVENTY_NINE;
|
||||
extern const int _TWO_HUNDRED_FIFTY_FIVE;
|
||||
extern const int _FIVE_HUNDRED_ELEVEN;
|
||||
extern const int _TWO_THOUSAND_FORTY_SEVEN;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ void FurnaceGUI::drawSysDefs(std::vector<FurnaceGUISysDef>& category, bool& acce
|
|||
ImGui::TableNextColumn();
|
||||
if (!i.subDefs.empty()) {
|
||||
if (i.orig.empty()) {
|
||||
sysDefID=fmt::sprintf("%s%s/%dS",i.name,sysDefIDLeader,index);
|
||||
sysDefID=fmt::sprintf("%s%s/%dS",_(i.name.c_str()),sysDefIDLeader,index);
|
||||
} else {
|
||||
sysDefID=fmt::sprintf("%s/%dS",sysDefIDLeader,index);
|
||||
}
|
||||
|
|
@ -45,7 +45,7 @@ void FurnaceGUI::drawSysDefs(std::vector<FurnaceGUISysDef>& category, bool& acce
|
|||
ImGui::SameLine();
|
||||
}
|
||||
if (!i.orig.empty()) {
|
||||
sysDefID=fmt::sprintf("%s%s/%d",i.name,sysDefIDLeader,index);
|
||||
sysDefID=fmt::sprintf("%s%s/%d",_(i.name.c_str()),sysDefIDLeader,index);
|
||||
if (ImGui::Selectable(sysDefID.c_str(),false,ImGuiSelectableFlags_DontClosePopups)) {
|
||||
nextDesc=i.definition;
|
||||
nextDescName=i.name;
|
||||
|
|
|
|||
|
|
@ -1282,116 +1282,120 @@ void FurnaceGUI::drawPattern() {
|
|||
memset(floors,0,4*4*sizeof(unsigned int));
|
||||
|
||||
for (int i=0; i<chans; i++) {
|
||||
bool isPaired=false;
|
||||
int numPairs=0;
|
||||
unsigned int pairMin=i;
|
||||
unsigned int pairMax=i;
|
||||
unsigned char curFloor=0;
|
||||
if (!e->curSubSong->chanShow[i]) {
|
||||
continue;
|
||||
}
|
||||
std::vector<DivChannelPair> pairs;
|
||||
e->getChanPaired(i,pairs);
|
||||
|
||||
DivChannelPair pairs=e->getChanPaired(i);
|
||||
for (int j=0; j<8; j++) {
|
||||
if (pairs.pairs[j]==-1) continue;
|
||||
int pairCh=e->dispatchFirstChan[i]+pairs.pairs[j];
|
||||
if (!e->curSubSong->chanShow[pairCh]) {
|
||||
for (DivChannelPair pair: pairs) {
|
||||
bool isPaired=false;
|
||||
int numPairs=0;
|
||||
unsigned int pairMin=i;
|
||||
unsigned int pairMax=i;
|
||||
unsigned char curFloor=0;
|
||||
if (!e->curSubSong->chanShow[i]) {
|
||||
continue;
|
||||
}
|
||||
isPaired=true;
|
||||
if ((unsigned int)pairCh<pairMin) pairMin=pairCh;
|
||||
if ((unsigned int)pairCh>pairMax) pairMax=pairCh;
|
||||
}
|
||||
|
||||
if (!isPaired) continue;
|
||||
|
||||
float posY=chanHeadBottom;
|
||||
|
||||
// find a free floor
|
||||
while (curFloor<4) {
|
||||
bool free=true;
|
||||
for (unsigned int j=pairMin; j<=pairMax; j++) {
|
||||
const unsigned int j0=j>>5;
|
||||
const unsigned int j1=1U<<(j&31);
|
||||
if (floors[curFloor][j0]&j1) {
|
||||
free=false;
|
||||
break;
|
||||
for (int j=0; j<8; j++) {
|
||||
if (pair.pairs[j]==-1) continue;
|
||||
int pairCh=e->dispatchFirstChan[i]+pair.pairs[j];
|
||||
if (!e->curSubSong->chanShow[pairCh]) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (free) break;
|
||||
curFloor++;
|
||||
}
|
||||
if (curFloor<4) {
|
||||
// occupy floor
|
||||
floors[curFloor][pairMin>>5]|=1U<<(pairMin&31);
|
||||
floors[curFloor][pairMax>>5]|=1U<<(pairMax&31);
|
||||
}
|
||||
|
||||
pos=(patChanX[i+1]+patChanX[i])*0.5;
|
||||
posCenter=pos;
|
||||
posMin=pos;
|
||||
posMax=pos;
|
||||
numPairs++;
|
||||
|
||||
if (pairs.label==NULL) {
|
||||
textSize=ImGui::CalcTextSize("???");
|
||||
} else {
|
||||
textSize=ImGui::CalcTextSize(pairs.label);
|
||||
}
|
||||
|
||||
posY+=(textSize.y+ImGui::GetStyle().ItemSpacing.y)*curFloor;
|
||||
|
||||
tdl->AddLine(
|
||||
ImVec2(pos,chanHeadBottom),
|
||||
ImVec2(pos,posY+textSize.y),
|
||||
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
|
||||
2.0f*dpiScale
|
||||
);
|
||||
|
||||
for (int j=0; j<8; j++) {
|
||||
if (pairs.pairs[j]==-1) continue;
|
||||
int pairCh=e->dispatchFirstChan[i]+pairs.pairs[j];
|
||||
if (!e->curSubSong->chanShow[pairCh]) {
|
||||
continue;
|
||||
isPaired=true;
|
||||
if ((unsigned int)pairCh<pairMin) pairMin=pairCh;
|
||||
if ((unsigned int)pairCh>pairMax) pairMax=pairCh;
|
||||
}
|
||||
|
||||
pos=(patChanX[pairCh+1]+patChanX[pairCh])*0.5;
|
||||
posCenter+=pos;
|
||||
if (!isPaired) continue;
|
||||
|
||||
float posY=chanHeadBottom;
|
||||
|
||||
// find a free floor
|
||||
while (curFloor<4) {
|
||||
bool free=true;
|
||||
for (unsigned int j=pairMin; j<=pairMax; j++) {
|
||||
const unsigned int j0=j>>5;
|
||||
const unsigned int j1=1U<<(j&31);
|
||||
if (floors[curFloor][j0]&j1) {
|
||||
free=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (free) break;
|
||||
curFloor++;
|
||||
}
|
||||
if (curFloor<4) {
|
||||
// occupy floor
|
||||
floors[curFloor][pairMin>>5]|=1U<<(pairMin&31);
|
||||
floors[curFloor][pairMax>>5]|=1U<<(pairMax&31);
|
||||
}
|
||||
|
||||
pos=(patChanX[i+1]+patChanX[i])*0.5;
|
||||
posCenter=pos;
|
||||
posMin=pos;
|
||||
posMax=pos;
|
||||
numPairs++;
|
||||
if (pos<posMin) posMin=pos;
|
||||
if (pos>posMax) posMax=pos;
|
||||
|
||||
if (pair.label==NULL) {
|
||||
textSize=ImGui::CalcTextSize("???");
|
||||
} else {
|
||||
textSize=ImGui::CalcTextSize(pair.label);
|
||||
}
|
||||
|
||||
posY+=(textSize.y+ImGui::GetStyle().ItemSpacing.y)*curFloor;
|
||||
|
||||
tdl->AddLine(
|
||||
ImVec2(pos,chanHeadBottom),
|
||||
ImVec2(pos,posY+textSize.y),
|
||||
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
|
||||
2.0f*dpiScale
|
||||
);
|
||||
}
|
||||
|
||||
posCenter/=numPairs;
|
||||
for (int j=0; j<8; j++) {
|
||||
if (pair.pairs[j]==-1) continue;
|
||||
int pairCh=e->dispatchFirstChan[i]+pair.pairs[j];
|
||||
if (!e->curSubSong->chanShow[pairCh]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pairs.label==NULL) {
|
||||
tdl->AddLine(
|
||||
ImVec2(posMin,posY+textSize.y),
|
||||
ImVec2(posMax,posY+textSize.y),
|
||||
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
|
||||
2.0f*dpiScale
|
||||
);
|
||||
} else {
|
||||
tdl->AddLine(
|
||||
ImVec2(posMin,posY+textSize.y),
|
||||
ImVec2(posCenter-textSize.x*0.5-6.0f*dpiScale,posY+textSize.y),
|
||||
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
|
||||
2.0f*dpiScale
|
||||
);
|
||||
tdl->AddLine(
|
||||
ImVec2(posCenter+textSize.x*0.5+6.0f*dpiScale,posY+textSize.y),
|
||||
ImVec2(posMax,posY+textSize.y),
|
||||
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
|
||||
2.0f*dpiScale
|
||||
);
|
||||
pos=(patChanX[pairCh+1]+patChanX[pairCh])*0.5;
|
||||
posCenter+=pos;
|
||||
numPairs++;
|
||||
if (pos<posMin) posMin=pos;
|
||||
if (pos>posMax) posMax=pos;
|
||||
tdl->AddLine(
|
||||
ImVec2(pos,chanHeadBottom),
|
||||
ImVec2(pos,posY+textSize.y),
|
||||
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
|
||||
2.0f*dpiScale
|
||||
);
|
||||
}
|
||||
|
||||
delayedLabels.push_back(DelayedLabel(posCenter,posY,textSize,pairs.label));
|
||||
posCenter/=numPairs;
|
||||
|
||||
if (pair.label==NULL) {
|
||||
tdl->AddLine(
|
||||
ImVec2(posMin,posY+textSize.y),
|
||||
ImVec2(posMax,posY+textSize.y),
|
||||
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
|
||||
2.0f*dpiScale
|
||||
);
|
||||
} else {
|
||||
tdl->AddLine(
|
||||
ImVec2(posMin,posY+textSize.y),
|
||||
ImVec2(posCenter-textSize.x*0.5-6.0f*dpiScale,posY+textSize.y),
|
||||
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
|
||||
2.0f*dpiScale
|
||||
);
|
||||
tdl->AddLine(
|
||||
ImVec2(posCenter+textSize.x*0.5+6.0f*dpiScale,posY+textSize.y),
|
||||
ImVec2(posMax,posY+textSize.y),
|
||||
ImGui::GetColorU32(uiColors[GUI_COLOR_PATTERN_PAIR]),
|
||||
2.0f*dpiScale
|
||||
);
|
||||
|
||||
delayedLabels.push_back(DelayedLabel(posCenter,posY,textSize,pair.label));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ void PlotNoLerp(const char* label, const float* values, int values_count, int va
|
|||
PlotNoLerpEx(ImGuiPlotType_Lines, label, &Plot_ArrayGetter, (void*)&data, values_count, values_offset, overlay_text, scale_min, scale_max, graph_size);
|
||||
}
|
||||
|
||||
int PlotBitfieldEx(const char* label, int (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char** overlay_text, int bits, ImVec2 frame_size, const bool* values_highlight, ImVec4 highlightColor, ImVec4 color)
|
||||
int PlotBitfieldEx(const char* label, int (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char** overlay_text, int bits, ImVec2 frame_size, const bool* values_highlight, ImVec4 highlightColor, ImVec4 color, std::string (*hoverFunc)(int,float,void*), void* hoverFuncUser)
|
||||
{
|
||||
ImGuiContext& g = *GImGui;
|
||||
ImGuiWindow* window = ImGui::GetCurrentWindow();
|
||||
|
|
@ -225,8 +225,18 @@ int PlotBitfieldEx(const char* label, int (*values_getter)(void* data, int idx),
|
|||
const int v_idx = (int)(t * item_count);
|
||||
IM_ASSERT(v_idx >= 0 && v_idx < values_count);
|
||||
|
||||
//const float v0 = values_getter(data, (v_idx + values_offset) % values_count);
|
||||
const float v0 = values_getter(data, (v_idx + values_offset) % values_count);
|
||||
//ImGui::SetTooltip("%d: %8.4g", v_idx, v0);
|
||||
|
||||
if (hoverFunc) {
|
||||
std::string hoverText=hoverFunc(v_idx,v0,hoverFuncUser);
|
||||
if (!hoverText.empty()) {
|
||||
ImGui::SetTooltip("%s",hoverText.c_str());
|
||||
}
|
||||
} else {
|
||||
ImGui::SetTooltip("%d: %d (%X)", v_idx, (int)v0, (int)v0);
|
||||
}
|
||||
|
||||
idx_hovered = v_idx;
|
||||
}
|
||||
|
||||
|
|
@ -290,10 +300,10 @@ int PlotBitfieldEx(const char* label, int (*values_getter)(void* data, int idx),
|
|||
return idx_hovered;
|
||||
}
|
||||
|
||||
void PlotBitfield(const char* label, const int* values, int values_count, int values_offset, const char** overlay_text, int bits, ImVec2 graph_size, int stride, const bool* values_highlight, ImVec4 highlightColor, ImVec4 color)
|
||||
void PlotBitfield(const char* label, const int* values, int values_count, int values_offset, const char** overlay_text, int bits, ImVec2 graph_size, int stride, const bool* values_highlight, ImVec4 highlightColor, ImVec4 color, std::string (*hoverFunc)(int,float,void*), void* hoverFuncUser)
|
||||
{
|
||||
FurnacePlotIntArrayGetterData data(values, stride);
|
||||
PlotBitfieldEx(label, &Plot_IntArrayGetter, (void*)&data, values_count, values_offset, overlay_text, bits, graph_size, values_highlight, highlightColor, color);
|
||||
PlotBitfieldEx(label, &Plot_IntArrayGetter, (void*)&data, values_count, values_offset, overlay_text, bits, graph_size, values_highlight, highlightColor, color, hoverFunc, hoverFuncUser);
|
||||
}
|
||||
|
||||
int PlotCustomEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_display_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 frame_size, ImVec4 color, int highlight, std::string (*hoverFunc)(int,float,void*), void* hoverFuncUser, bool blockMode, std::string (*guideFunc)(float), const bool* values_highlight, ImVec4 highlightColor)
|
||||
|
|
|
|||
|
|
@ -21,5 +21,5 @@
|
|||
#include "../pch.h"
|
||||
|
||||
void PlotNoLerp(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0), int stride = sizeof(float));
|
||||
void PlotBitfield(const char* label, const int* values, int values_count, int values_offset = 0, const char** overlay_text = NULL, int bits = 8, ImVec2 graph_size = ImVec2(0, 0), int stride = sizeof(float), const bool* values_highlight = NULL, ImVec4 highlightColor = ImVec4(1.0f,1.0f,1.0f,1.0f), ImVec4 color = ImVec4(1.0f,1.0f,1.0f,1.0f));
|
||||
void PlotBitfield(const char* label, const int* values, int values_count, int values_offset = 0, const char** overlay_text = NULL, int bits = 8, ImVec2 graph_size = ImVec2(0, 0), int stride = sizeof(float), const bool* values_highlight = NULL, ImVec4 highlightColor = ImVec4(1.0f,1.0f,1.0f,1.0f), ImVec4 color = ImVec4(1.0f,1.0f,1.0f,1.0f), std::string (*hoverFunc)(int,float,void*) = NULL, void* hoverFuncUser = NULL);
|
||||
void PlotCustom(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0, 0), int stride = sizeof(float), ImVec4 fgColor = ImVec4(1.0f,1.0f,1.0f,1.0f), int highlight = 0, std::string (*hoverFunc)(int,float,void*) = NULL, void* hoverFuncUser=NULL, bool blockMode=false, std::string (*guideFunc)(float) = NULL, const bool* values_highlight = NULL, ImVec4 highlightColor = ImVec4(1.0f,1.0f,1.0f,1.0f));
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -83,7 +83,7 @@ const char* locales[][3]={
|
|||
//{"Nederlands (4%)", "nl_NL", "start Furnace opnieuw op om deze instelling effectief te maken."},
|
||||
{"Polski (95%)", "pl_PL", "aby to ustawienie było skuteczne, należy ponownie uruchomić program."},
|
||||
{"Português (Brasil) (90%)", "pt_BR", "reinicie o Furnace para que essa configuração entre em vigor."},
|
||||
{"Русский (90%)", "ru_RU", "перезапустите программу, чтобы эта настройка вступила в силу."},
|
||||
{"Русский", "ru_RU", "перезапустите программу, чтобы эта настройка вступила в силу."},
|
||||
{"Slovenčina (15%)", "sk_SK", "???"},
|
||||
{"Svenska", "sv_SE", "starta om programmet för att denna inställning ska träda i kraft."},
|
||||
//{"ไทย (0%)", "th_TH", "???"},
|
||||
|
|
@ -4167,6 +4167,7 @@ void FurnaceGUI::drawSettings() {
|
|||
UI_COLOR_CONFIG(GUI_COLOR_INSTR_SID2,_("SID2"));
|
||||
UI_COLOR_CONFIG(GUI_COLOR_INSTR_SUPERVISION,_("Supervision"));
|
||||
UI_COLOR_CONFIG(GUI_COLOR_INSTR_UPD1771C,_("μPD1771C"));
|
||||
UI_COLOR_CONFIG(GUI_COLOR_INSTR_SID3,_("SID3"));
|
||||
UI_COLOR_CONFIG(GUI_COLOR_INSTR_UNKNOWN,_("Other/Unknown"));
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
|
@ -4900,7 +4901,7 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
|
|||
|
||||
settings.selectAssetOnLoad=conf.getInt("selectAssetOnLoad",1);
|
||||
|
||||
settings.inputRepeat=conf.getInt("inputRepeat",0);
|
||||
settings.inputRepeat=conf.getInt("inputRepeat",1);
|
||||
}
|
||||
|
||||
if (groups&GUI_SETTINGS_FONT) {
|
||||
|
|
|
|||
|
|
@ -2619,6 +2619,28 @@ bool FurnaceGUI::drawSysConf(int chan, int sysPos, DivSystem type, DivConfig& fl
|
|||
supportsCustomRate=false;
|
||||
ImGui::Text(_("nothing to configure"));
|
||||
break;
|
||||
case DIV_SYSTEM_SID3: {
|
||||
bool quarterClock=flags.getBool("quarterClock",false);
|
||||
if (ImGui::Checkbox(_("Quarter clock speed"),&quarterClock)) {
|
||||
altered=true;
|
||||
}
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip(_("Decreases clock speed and CPU audio load by 4 times.\nCan be used if your CPU is too slow for the chip."
|
||||
"\nDoes not affect clock speed during export!\n\n"
|
||||
|
||||
"Warning! Filters may become unstable at high cutoff and resonance\nif this option or lower clock speed are used!\n"
|
||||
"Also filters' timbre may be different near these values.\n\n"
|
||||
|
||||
"Default clock speed is 1MHz (1000000Hz)."));
|
||||
}
|
||||
|
||||
if (altered) {
|
||||
e->lockSave([&]() {
|
||||
flags.set("quarterClock",(int)quarterClock);
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
bool sysPal=flags.getInt("clockSel",0);
|
||||
|
||||
|
|
|
|||
106
src/gui/util.cpp
106
src/gui/util.cpp
|
|
@ -112,3 +112,109 @@ String getKeyName(int key, bool emptyNone) {
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
double sinus(double x) {
|
||||
return sin(x);
|
||||
}
|
||||
double rectSin(double x) {
|
||||
return sin(x) > 0 ? sin(x) : 0;
|
||||
}
|
||||
double absSin(double x) {
|
||||
return fabs(sin(x));
|
||||
}
|
||||
|
||||
double square(double x) {
|
||||
return fmod(x, (2 * M_PI)) >= M_PI ? -1 : 1;
|
||||
}
|
||||
double rectSquare(double x) {
|
||||
return square(x) > 0 ? square(x) : 0;
|
||||
}
|
||||
|
||||
double quartSin(double x) {
|
||||
return absSin(x) * rectSquare(2 * x);
|
||||
}
|
||||
double squiSin(double x) {
|
||||
return sin(x) >= 0 ? sin(2 * x) : 0;
|
||||
}
|
||||
double squiAbsSin(double x) {
|
||||
return fabs(squiSin(x));
|
||||
}
|
||||
|
||||
double saw(double x) {
|
||||
return atan(tan(x / 2)) / (M_PI / 2);
|
||||
}
|
||||
double rectSaw(double x) {
|
||||
return saw(x) > 0 ? saw(x) : 0;
|
||||
}
|
||||
double absSaw(double x) {
|
||||
return saw(x) < 0 ? saw(x) + 1 : saw(x);
|
||||
}
|
||||
|
||||
|
||||
double cubSaw(double x) {
|
||||
return pow(saw(x), 3);
|
||||
}
|
||||
double rectCubSaw(double x) {
|
||||
return pow(rectSaw(x), 3);
|
||||
}
|
||||
double absCubSaw(double x) {
|
||||
return pow(absSaw(x), 3);
|
||||
}
|
||||
|
||||
double cubSine(double x) {
|
||||
return pow(sin(x), 3);
|
||||
}
|
||||
double rectCubSin(double x) {
|
||||
return pow(rectSin(x), 3);
|
||||
}
|
||||
double absCubSin(double x) {
|
||||
return pow(absSin(x), 3);
|
||||
}
|
||||
double quartCubSin(double x) {
|
||||
return pow(quartSin(x), 3);
|
||||
}
|
||||
double squishCubSin(double x) {
|
||||
return pow(squiSin(x), 3);
|
||||
}
|
||||
double squishAbsCubSin(double x) {
|
||||
return pow(squiAbsSin(x), 3);
|
||||
}
|
||||
|
||||
double triangle(double x) {
|
||||
return asin(sin(x)) / (M_PI / 2);
|
||||
}
|
||||
double rectTri(double x) {
|
||||
return triangle(x) > 0 ? triangle(x) : 0;
|
||||
}
|
||||
double absTri(double x) {
|
||||
return fabs(triangle(x));
|
||||
}
|
||||
double quartTri(double x) {
|
||||
return absTri(x) * rectSquare(2 * x);
|
||||
}
|
||||
double squiTri(double x) {
|
||||
return sin(x) >= 0 ? triangle(2 * x) : 0;
|
||||
}
|
||||
double absSquiTri(double x) {
|
||||
return fabs(squiTri(x));
|
||||
}
|
||||
|
||||
double cubTriangle(double x) {
|
||||
return pow(triangle(x), 3);
|
||||
}
|
||||
double cubRectTri(double x) {
|
||||
return pow(rectTri(x), 3);
|
||||
}
|
||||
double cubAbsTri(double x) {
|
||||
return pow(absTri(x), 3);
|
||||
}
|
||||
double cubQuartTri(double x) {
|
||||
return pow(quartTri(x), 3);
|
||||
}
|
||||
double cubSquiTri(double x) {
|
||||
return pow(squiTri(x), 3);
|
||||
}
|
||||
double absCubSquiTri(double x) {
|
||||
return fabs(cubSquiTri(x));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,4 +30,37 @@
|
|||
#endif
|
||||
|
||||
String getHomeDir();
|
||||
String getKeyName(int key, bool emptyNone=false);
|
||||
String getKeyName(int key, bool emptyNone=false);
|
||||
|
||||
double sinus(double x);
|
||||
double rectSin(double x);
|
||||
double absSin(double x);
|
||||
double square(double x);
|
||||
double rectSquare(double x);
|
||||
double quartSin(double x);
|
||||
double squiSin(double x);
|
||||
double squiAbsSin(double x);
|
||||
double saw(double x);
|
||||
double rectSaw(double x);
|
||||
double absSaw(double x);
|
||||
double cubSaw(double x);
|
||||
double rectCubSaw(double x);
|
||||
double absCubSaw(double x);
|
||||
double cubSine(double x);
|
||||
double rectCubSin(double x);
|
||||
double absCubSin(double x);
|
||||
double quartCubSin(double x);
|
||||
double squishCubSin(double x);
|
||||
double squishAbsCubSin(double x);
|
||||
double triangle(double x);
|
||||
double rectTri(double x);
|
||||
double absTri(double x);
|
||||
double quartTri(double x);
|
||||
double squiTri(double x);
|
||||
double absSquiTri(double x);
|
||||
double cubTriangle(double x);
|
||||
double cubRectTri(double x);
|
||||
double cubAbsTri(double x);
|
||||
double cubQuartTri(double x);
|
||||
double cubSquiTri(double x);
|
||||
double absCubSquiTri(double x);
|
||||
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
#define _USE_MATH_DEFINES
|
||||
#include "gui.h"
|
||||
#include "util.h"
|
||||
#include "plot_nolerp.h"
|
||||
#include "IconsFontAwesome4.h"
|
||||
#include "misc/cpp/imgui_stdlib.h"
|
||||
|
|
@ -40,111 +41,6 @@ const char* waveInterpolations[4]={
|
|||
_N("Cubic")
|
||||
};
|
||||
|
||||
double sinus(double x) {
|
||||
return sin(x);
|
||||
}
|
||||
double rectSin(double x) {
|
||||
return sin(x) > 0 ? sin(x) : 0;
|
||||
}
|
||||
double absSin(double x) {
|
||||
return fabs(sin(x));
|
||||
}
|
||||
|
||||
double square(double x) {
|
||||
return fmod(x, (2 * M_PI)) >= M_PI ? -1 : 1;
|
||||
}
|
||||
double rectSquare(double x) {
|
||||
return square(x) > 0 ? square(x) : 0;
|
||||
}
|
||||
|
||||
double quartSin(double x) {
|
||||
return absSin(x) * rectSquare(2 * x);
|
||||
}
|
||||
double squiSin(double x) {
|
||||
return sin(x) >= 0 ? sin(2 * x) : 0;
|
||||
}
|
||||
double squiAbsSin(double x) {
|
||||
return fabs(squiSin(x));
|
||||
}
|
||||
|
||||
double saw(double x) {
|
||||
return atan(tan(x / 2)) / (M_PI / 2);
|
||||
}
|
||||
double rectSaw(double x) {
|
||||
return saw(x) > 0 ? saw(x) : 0;
|
||||
}
|
||||
double absSaw(double x) {
|
||||
return saw(x) < 0 ? saw(x) + 1 : saw(x);
|
||||
}
|
||||
|
||||
|
||||
double cubSaw(double x) {
|
||||
return pow(saw(x), 3);
|
||||
}
|
||||
double rectCubSaw(double x) {
|
||||
return pow(rectSaw(x), 3);
|
||||
}
|
||||
double absCubSaw(double x) {
|
||||
return pow(absSaw(x), 3);
|
||||
}
|
||||
|
||||
double cubSine(double x) {
|
||||
return pow(sin(x), 3);
|
||||
}
|
||||
double rectCubSin(double x) {
|
||||
return pow(rectSin(x), 3);
|
||||
}
|
||||
double absCubSin(double x) {
|
||||
return pow(absSin(x), 3);
|
||||
}
|
||||
double quartCubSin(double x) {
|
||||
return pow(quartSin(x), 3);
|
||||
}
|
||||
double squishCubSin(double x) {
|
||||
return pow(squiSin(x), 3);
|
||||
}
|
||||
double squishAbsCubSin(double x) {
|
||||
return pow(squiAbsSin(x), 3);
|
||||
}
|
||||
|
||||
double triangle(double x) {
|
||||
return asin(sin(x)) / (M_PI / 2);
|
||||
}
|
||||
double rectTri(double x) {
|
||||
return triangle(x) > 0 ? triangle(x) : 0;
|
||||
}
|
||||
double absTri(double x) {
|
||||
return fabs(triangle(x));
|
||||
}
|
||||
double quartTri(double x) {
|
||||
return absTri(x) * rectSquare(2 * x);
|
||||
}
|
||||
double squiTri(double x) {
|
||||
return sin(x) >= 0 ? triangle(2 * x) : 0;
|
||||
}
|
||||
double absSquiTri(double x) {
|
||||
return fabs(squiTri(x));
|
||||
}
|
||||
|
||||
double cubTriangle(double x) {
|
||||
return pow(triangle(x), 3);
|
||||
}
|
||||
double cubRectTri(double x) {
|
||||
return pow(rectTri(x), 3);
|
||||
}
|
||||
double cubAbsTri(double x) {
|
||||
return pow(absTri(x), 3);
|
||||
}
|
||||
double cubQuartTri(double x) {
|
||||
return pow(quartTri(x), 3);
|
||||
}
|
||||
double cubSquiTri(double x) {
|
||||
return pow(squiTri(x), 3);
|
||||
}
|
||||
double absCubSquiTri(double x) {
|
||||
return fabs(cubSquiTri(x));
|
||||
}
|
||||
|
||||
typedef double (*WaveFunc) (double a);
|
||||
|
||||
WaveFunc waveFuncs[]={
|
||||
|
|
@ -495,7 +391,7 @@ void FurnaceGUI::drawWaveEdit() {
|
|||
ImGui::TableNextColumn();
|
||||
ImGui::Text(_("Width"));
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip(_("use a width of:\n- any on Amiga/N163\n- 32 on Game Boy, PC Engine, SCC, Konami Bubble System, Namco WSG, Virtual Boy and WonderSwan\n- 64 on FDS\n- 128 on X1-010\nany other widths will be scaled during playback."));
|
||||
ImGui::SetTooltip(_("use a width of:\n- any on Amiga/N163\n- 32 on Game Boy, PC Engine, SCC, Konami Bubble System, Namco WSG, Virtual Boy and WonderSwan\n- 64 on FDS\n- 128 on X1-010\n- 256 on SID3\nany other widths will be scaled during playback."));
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(96.0f*dpiScale);
|
||||
|
|
@ -509,7 +405,7 @@ void FurnaceGUI::drawWaveEdit() {
|
|||
ImGui::SameLine();
|
||||
ImGui::Text(_("Height"));
|
||||
if (ImGui::IsItemHovered()) {
|
||||
ImGui::SetTooltip(_("use a height of:\n- 16 for Game Boy, WonderSwan, Namco WSG, Konami Bubble System, X1-010 Envelope shape and N163\n- 32 for PC Engine\n- 64 for FDS and Virtual Boy\n- 256 for X1-010 and SCC\nany other heights will be scaled during playback."));
|
||||
ImGui::SetTooltip(_("use a height of:\n- 16 for Game Boy, WonderSwan, Namco WSG, Konami Bubble System, X1-010 Envelope shape and N163\n- 32 for PC Engine\n- 64 for FDS and Virtual Boy\n- 256 for X1-010, SCC and SID3\nany other heights will be scaled during playback."));
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(96.0f*dpiScale);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// not auto-generated. update every time you change icons.ttf!
|
||||
|
||||
#define ICON_MIN_FUR 0xe0f0
|
||||
#define ICON_MAX_FUR 0xe161
|
||||
#define ICON_MAX_FUR 0xe164
|
||||
|
||||
// test
|
||||
#define ICON_FUR_TEST0 u8"\ue0f0"
|
||||
|
|
@ -73,10 +73,11 @@
|
|||
#define ICON_FUR_INS_NDS u8"\ue15d"
|
||||
#define ICON_FUR_INS_GBA_DMA u8"\ue15e"
|
||||
#define ICON_FUR_INS_GBA_MINMOD u8"\ue15f"
|
||||
#define ICON_FUR_INS_BIFURCATOR u8"\ue160"
|
||||
#define ICON_FUR_INS_BIFURCATOR u8"\ue160"
|
||||
#define ICON_FUR_INS_SID2 u8"\ue161"
|
||||
#define ICON_FUR_INS_SUPERVISION u8"\ue162"
|
||||
#define ICON_FUR_INS_UPD1771C u8"\ue163"
|
||||
#define ICON_FUR_INS_SID3 u8"\ue164"
|
||||
|
||||
// sample editor
|
||||
#define ICON_FUR_SAMPLE_APPLY_SILENCE u8"\ue136"
|
||||
|
|
|
|||
|
|
@ -339,6 +339,8 @@ TAParamResult pVersion(String) {
|
|||
printf("- PowerNoise emulator by scratchminer (MIT)\n");
|
||||
printf("- ep128emu by Istvan Varga (GPLv2)\n");
|
||||
printf("- NDS sound emulator by cam900 (zlib license)\n");
|
||||
printf("- SID2 emulator by LTVA (GPLv2, modification of reSID emulator)\n");
|
||||
printf("- SID3 emulator by LTVA (MIT)\n");
|
||||
printf("- openMSX YMF278 emulator (modified version) by the openMSX developers (GPLv2)\n");
|
||||
return TA_PARAM_QUIT;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue