mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-26 14:33:01 +00:00
remove unused old ins format saving code
This commit is contained in:
parent
9d32aeda4d
commit
f80d3f9eb5
3 changed files with 5 additions and 673 deletions
|
@ -1320,646 +1320,6 @@ void DivInstrument::putInsData2(SafeWriter* w, bool fui, const DivSong* song, bo
|
|||
w->seek(0,SEEK_END);
|
||||
}
|
||||
|
||||
void DivInstrument::putInsData(SafeWriter* w) {
|
||||
size_t blockStartSeek, blockEndSeek;
|
||||
|
||||
w->write("INST",4);
|
||||
blockStartSeek=w->tell();
|
||||
w->writeI(0);
|
||||
|
||||
w->writeS(DIV_ENGINE_VERSION);
|
||||
|
||||
w->writeC(type);
|
||||
w->writeC(0);
|
||||
|
||||
w->writeString(name,false);
|
||||
|
||||
// FM
|
||||
w->writeC(fm.alg);
|
||||
w->writeC(fm.fb);
|
||||
w->writeC(fm.fms);
|
||||
w->writeC(fm.ams);
|
||||
w->writeC(fm.ops);
|
||||
w->writeC(fm.opllPreset);
|
||||
w->writeC(0); // reserved
|
||||
w->writeC(0);
|
||||
|
||||
for (int j=0; j<4; j++) {
|
||||
DivInstrumentFM::Operator& op=fm.op[j];
|
||||
w->writeC(op.am);
|
||||
w->writeC(op.ar);
|
||||
w->writeC(op.dr);
|
||||
w->writeC(op.mult);
|
||||
w->writeC(op.rr);
|
||||
w->writeC(op.sl);
|
||||
w->writeC(op.tl);
|
||||
w->writeC(op.dt2);
|
||||
w->writeC(op.rs);
|
||||
w->writeC(op.dt);
|
||||
w->writeC(op.d2r);
|
||||
w->writeC(op.ssgEnv);
|
||||
|
||||
w->writeC(op.dam);
|
||||
w->writeC(op.dvb);
|
||||
w->writeC(op.egt);
|
||||
w->writeC(op.ksl);
|
||||
w->writeC(op.sus);
|
||||
w->writeC(op.vib);
|
||||
w->writeC(op.ws);
|
||||
w->writeC(op.ksr);
|
||||
|
||||
w->writeC(op.enable);
|
||||
w->writeC(op.kvs);
|
||||
|
||||
// reserved
|
||||
for (int k=0; k<10; k++) {
|
||||
w->writeC(0);
|
||||
}
|
||||
}
|
||||
|
||||
// GB
|
||||
w->writeC(gb.envVol);
|
||||
w->writeC(gb.envDir);
|
||||
w->writeC(gb.envLen);
|
||||
w->writeC(gb.soundLen);
|
||||
|
||||
// C64
|
||||
w->writeC(c64.triOn);
|
||||
w->writeC(c64.sawOn);
|
||||
w->writeC(c64.pulseOn);
|
||||
w->writeC(c64.noiseOn);
|
||||
w->writeC(c64.a);
|
||||
w->writeC(c64.d);
|
||||
w->writeC(c64.s);
|
||||
w->writeC(c64.r);
|
||||
w->writeS(c64.duty);
|
||||
w->writeC(c64.ringMod);
|
||||
w->writeC(c64.oscSync);
|
||||
w->writeC(c64.toFilter);
|
||||
w->writeC(c64.initFilter);
|
||||
w->writeC(0); // this was volIsCutoff
|
||||
w->writeC(c64.res);
|
||||
w->writeC(c64.lp);
|
||||
w->writeC(c64.bp);
|
||||
w->writeC(c64.hp);
|
||||
w->writeC(c64.ch3off);
|
||||
w->writeS(c64.cut);
|
||||
w->writeC(c64.dutyIsAbs);
|
||||
w->writeC(c64.filterIsAbs);
|
||||
|
||||
// Amiga
|
||||
w->writeS(amiga.initSample);
|
||||
w->writeC(amiga.useWave);
|
||||
w->writeC(amiga.waveLen);
|
||||
for (int j=0; j<12; j++) { // reserved
|
||||
w->writeC(0);
|
||||
}
|
||||
|
||||
// standard
|
||||
w->writeI(std.volMacro.len);
|
||||
w->writeI(std.arpMacro.len);
|
||||
w->writeI(std.dutyMacro.len);
|
||||
w->writeI(std.waveMacro.len);
|
||||
w->writeI(std.pitchMacro.len);
|
||||
w->writeI(std.ex1Macro.len);
|
||||
w->writeI(std.ex2Macro.len);
|
||||
w->writeI(std.ex3Macro.len);
|
||||
w->writeI(std.volMacro.loop);
|
||||
w->writeI(std.arpMacro.loop);
|
||||
w->writeI(std.dutyMacro.loop);
|
||||
w->writeI(std.waveMacro.loop);
|
||||
w->writeI(std.pitchMacro.loop);
|
||||
w->writeI(std.ex1Macro.loop);
|
||||
w->writeI(std.ex2Macro.loop);
|
||||
w->writeI(std.ex3Macro.loop);
|
||||
w->writeC(0); // this was arp macro mode
|
||||
w->writeC(0); // reserved
|
||||
w->writeC(0);
|
||||
w->writeC(0);
|
||||
for (int j=0; j<std.volMacro.len; j++) {
|
||||
w->writeI(std.volMacro.val[j]);
|
||||
}
|
||||
for (int j=0; j<std.arpMacro.len; j++) {
|
||||
w->writeI(std.arpMacro.val[j]);
|
||||
}
|
||||
for (int j=0; j<std.dutyMacro.len; j++) {
|
||||
w->writeI(std.dutyMacro.val[j]);
|
||||
}
|
||||
for (int j=0; j<std.waveMacro.len; j++) {
|
||||
w->writeI(std.waveMacro.val[j]);
|
||||
}
|
||||
for (int j=0; j<std.pitchMacro.len; j++) {
|
||||
w->writeI(std.pitchMacro.val[j]);
|
||||
}
|
||||
for (int j=0; j<std.ex1Macro.len; j++) {
|
||||
w->writeI(std.ex1Macro.val[j]);
|
||||
}
|
||||
for (int j=0; j<std.ex2Macro.len; j++) {
|
||||
w->writeI(std.ex2Macro.val[j]);
|
||||
}
|
||||
for (int j=0; j<std.ex3Macro.len; j++) {
|
||||
w->writeI(std.ex3Macro.val[j]);
|
||||
}
|
||||
|
||||
// FM macros and open status
|
||||
w->writeI(std.algMacro.len);
|
||||
w->writeI(std.fbMacro.len);
|
||||
w->writeI(std.fmsMacro.len);
|
||||
w->writeI(std.amsMacro.len);
|
||||
w->writeI(std.algMacro.loop);
|
||||
w->writeI(std.fbMacro.loop);
|
||||
w->writeI(std.fmsMacro.loop);
|
||||
w->writeI(std.amsMacro.loop);
|
||||
|
||||
w->writeC(std.volMacro.open);
|
||||
w->writeC(std.arpMacro.open);
|
||||
w->writeC(std.dutyMacro.open);
|
||||
w->writeC(std.waveMacro.open);
|
||||
w->writeC(std.pitchMacro.open);
|
||||
w->writeC(std.ex1Macro.open);
|
||||
w->writeC(std.ex2Macro.open);
|
||||
w->writeC(std.ex3Macro.open);
|
||||
w->writeC(std.algMacro.open);
|
||||
w->writeC(std.fbMacro.open);
|
||||
w->writeC(std.fmsMacro.open);
|
||||
w->writeC(std.amsMacro.open);
|
||||
|
||||
for (int j=0; j<std.algMacro.len; j++) {
|
||||
w->writeI(std.algMacro.val[j]);
|
||||
}
|
||||
for (int j=0; j<std.fbMacro.len; j++) {
|
||||
w->writeI(std.fbMacro.val[j]);
|
||||
}
|
||||
for (int j=0; j<std.fmsMacro.len; j++) {
|
||||
w->writeI(std.fmsMacro.val[j]);
|
||||
}
|
||||
for (int j=0; j<std.amsMacro.len; j++) {
|
||||
w->writeI(std.amsMacro.val[j]);
|
||||
}
|
||||
|
||||
for (int i=0; i<4; i++) {
|
||||
DivInstrumentSTD::OpMacro& op=std.opMacros[i];
|
||||
|
||||
w->writeI(op.amMacro.len);
|
||||
w->writeI(op.arMacro.len);
|
||||
w->writeI(op.drMacro.len);
|
||||
w->writeI(op.multMacro.len);
|
||||
w->writeI(op.rrMacro.len);
|
||||
w->writeI(op.slMacro.len);
|
||||
w->writeI(op.tlMacro.len);
|
||||
w->writeI(op.dt2Macro.len);
|
||||
w->writeI(op.rsMacro.len);
|
||||
w->writeI(op.dtMacro.len);
|
||||
w->writeI(op.d2rMacro.len);
|
||||
w->writeI(op.ssgMacro.len);
|
||||
w->writeI(op.amMacro.loop);
|
||||
w->writeI(op.arMacro.loop);
|
||||
w->writeI(op.drMacro.loop);
|
||||
w->writeI(op.multMacro.loop);
|
||||
w->writeI(op.rrMacro.loop);
|
||||
w->writeI(op.slMacro.loop);
|
||||
w->writeI(op.tlMacro.loop);
|
||||
w->writeI(op.dt2Macro.loop);
|
||||
w->writeI(op.rsMacro.loop);
|
||||
w->writeI(op.dtMacro.loop);
|
||||
w->writeI(op.d2rMacro.loop);
|
||||
w->writeI(op.ssgMacro.loop);
|
||||
w->writeC(op.amMacro.open);
|
||||
w->writeC(op.arMacro.open);
|
||||
w->writeC(op.drMacro.open);
|
||||
w->writeC(op.multMacro.open);
|
||||
w->writeC(op.rrMacro.open);
|
||||
w->writeC(op.slMacro.open);
|
||||
w->writeC(op.tlMacro.open);
|
||||
w->writeC(op.dt2Macro.open);
|
||||
w->writeC(op.rsMacro.open);
|
||||
w->writeC(op.dtMacro.open);
|
||||
w->writeC(op.d2rMacro.open);
|
||||
w->writeC(op.ssgMacro.open);
|
||||
}
|
||||
|
||||
for (int i=0; i<4; i++) {
|
||||
DivInstrumentSTD::OpMacro& op=std.opMacros[i];
|
||||
for (int j=0; j<op.amMacro.len; j++) {
|
||||
w->writeC(op.amMacro.val[j]&0xff);
|
||||
}
|
||||
for (int j=0; j<op.arMacro.len; j++) {
|
||||
w->writeC(op.arMacro.val[j]&0xff);
|
||||
}
|
||||
for (int j=0; j<op.drMacro.len; j++) {
|
||||
w->writeC(op.drMacro.val[j]&0xff);
|
||||
}
|
||||
for (int j=0; j<op.multMacro.len; j++) {
|
||||
w->writeC(op.multMacro.val[j]&0xff);
|
||||
}
|
||||
for (int j=0; j<op.rrMacro.len; j++) {
|
||||
w->writeC(op.rrMacro.val[j]&0xff);
|
||||
}
|
||||
for (int j=0; j<op.slMacro.len; j++) {
|
||||
w->writeC(op.slMacro.val[j]&0xff);
|
||||
}
|
||||
for (int j=0; j<op.tlMacro.len; j++) {
|
||||
w->writeC(op.tlMacro.val[j]&0xff);
|
||||
}
|
||||
for (int j=0; j<op.dt2Macro.len; j++) {
|
||||
w->writeC(op.dt2Macro.val[j]&0xff);
|
||||
}
|
||||
for (int j=0; j<op.rsMacro.len; j++) {
|
||||
w->writeC(op.rsMacro.val[j]&0xff);
|
||||
}
|
||||
for (int j=0; j<op.dtMacro.len; j++) {
|
||||
w->writeC(op.dtMacro.val[j]&0xff);
|
||||
}
|
||||
for (int j=0; j<op.d2rMacro.len; j++) {
|
||||
w->writeC(op.d2rMacro.val[j]&0xff);
|
||||
}
|
||||
for (int j=0; j<op.ssgMacro.len; j++) {
|
||||
w->writeC(op.ssgMacro.val[j]&0xff);
|
||||
}
|
||||
}
|
||||
|
||||
// release points
|
||||
w->writeI(std.volMacro.rel);
|
||||
w->writeI(std.arpMacro.rel);
|
||||
w->writeI(std.dutyMacro.rel);
|
||||
w->writeI(std.waveMacro.rel);
|
||||
w->writeI(std.pitchMacro.rel);
|
||||
w->writeI(std.ex1Macro.rel);
|
||||
w->writeI(std.ex2Macro.rel);
|
||||
w->writeI(std.ex3Macro.rel);
|
||||
w->writeI(std.algMacro.rel);
|
||||
w->writeI(std.fbMacro.rel);
|
||||
w->writeI(std.fmsMacro.rel);
|
||||
w->writeI(std.amsMacro.rel);
|
||||
for (int i=0; i<4; i++) {
|
||||
DivInstrumentSTD::OpMacro& op=std.opMacros[i];
|
||||
|
||||
w->writeI(op.amMacro.rel);
|
||||
w->writeI(op.arMacro.rel);
|
||||
w->writeI(op.drMacro.rel);
|
||||
w->writeI(op.multMacro.rel);
|
||||
w->writeI(op.rrMacro.rel);
|
||||
w->writeI(op.slMacro.rel);
|
||||
w->writeI(op.tlMacro.rel);
|
||||
w->writeI(op.dt2Macro.rel);
|
||||
w->writeI(op.rsMacro.rel);
|
||||
w->writeI(op.dtMacro.rel);
|
||||
w->writeI(op.d2rMacro.rel);
|
||||
w->writeI(op.ssgMacro.rel);
|
||||
}
|
||||
|
||||
// extended op macros
|
||||
for (int i=0; i<4; i++) {
|
||||
DivInstrumentSTD::OpMacro& op=std.opMacros[i];
|
||||
|
||||
w->writeI(op.damMacro.len);
|
||||
w->writeI(op.dvbMacro.len);
|
||||
w->writeI(op.egtMacro.len);
|
||||
w->writeI(op.kslMacro.len);
|
||||
w->writeI(op.susMacro.len);
|
||||
w->writeI(op.vibMacro.len);
|
||||
w->writeI(op.wsMacro.len);
|
||||
w->writeI(op.ksrMacro.len);
|
||||
|
||||
w->writeI(op.damMacro.loop);
|
||||
w->writeI(op.dvbMacro.loop);
|
||||
w->writeI(op.egtMacro.loop);
|
||||
w->writeI(op.kslMacro.loop);
|
||||
w->writeI(op.susMacro.loop);
|
||||
w->writeI(op.vibMacro.loop);
|
||||
w->writeI(op.wsMacro.loop);
|
||||
w->writeI(op.ksrMacro.loop);
|
||||
|
||||
w->writeI(op.damMacro.rel);
|
||||
w->writeI(op.dvbMacro.rel);
|
||||
w->writeI(op.egtMacro.rel);
|
||||
w->writeI(op.kslMacro.rel);
|
||||
w->writeI(op.susMacro.rel);
|
||||
w->writeI(op.vibMacro.rel);
|
||||
w->writeI(op.wsMacro.rel);
|
||||
w->writeI(op.ksrMacro.rel);
|
||||
|
||||
w->writeC(op.damMacro.open);
|
||||
w->writeC(op.dvbMacro.open);
|
||||
w->writeC(op.egtMacro.open);
|
||||
w->writeC(op.kslMacro.open);
|
||||
w->writeC(op.susMacro.open);
|
||||
w->writeC(op.vibMacro.open);
|
||||
w->writeC(op.wsMacro.open);
|
||||
w->writeC(op.ksrMacro.open);
|
||||
}
|
||||
|
||||
for (int i=0; i<4; i++) {
|
||||
DivInstrumentSTD::OpMacro& op=std.opMacros[i];
|
||||
for (int j=0; j<op.damMacro.len; j++) {
|
||||
w->writeC(op.damMacro.val[j]);
|
||||
}
|
||||
for (int j=0; j<op.dvbMacro.len; j++) {
|
||||
w->writeC(op.dvbMacro.val[j]);
|
||||
}
|
||||
for (int j=0; j<op.egtMacro.len; j++) {
|
||||
w->writeC(op.egtMacro.val[j]);
|
||||
}
|
||||
for (int j=0; j<op.kslMacro.len; j++) {
|
||||
w->writeC(op.kslMacro.val[j]);
|
||||
}
|
||||
for (int j=0; j<op.susMacro.len; j++) {
|
||||
w->writeC(op.susMacro.val[j]);
|
||||
}
|
||||
for (int j=0; j<op.vibMacro.len; j++) {
|
||||
w->writeC(op.vibMacro.val[j]);
|
||||
}
|
||||
for (int j=0; j<op.wsMacro.len; j++) {
|
||||
w->writeC(op.wsMacro.val[j]);
|
||||
}
|
||||
for (int j=0; j<op.ksrMacro.len; j++) {
|
||||
w->writeC(op.ksrMacro.val[j]);
|
||||
}
|
||||
}
|
||||
|
||||
// OPL drum data
|
||||
w->writeC(fm.fixedDrums);
|
||||
w->writeC(0); // reserved
|
||||
w->writeS(fm.kickFreq);
|
||||
w->writeS(fm.snareHatFreq);
|
||||
w->writeS(fm.tomTopFreq);
|
||||
|
||||
// sample map
|
||||
w->writeC(amiga.useNoteMap);
|
||||
if (amiga.useNoteMap) {
|
||||
for (int note=0; note<120; note++) {
|
||||
w->writeI(amiga.noteMap[note].freq);
|
||||
}
|
||||
for (int note=0; note<120; note++) {
|
||||
w->writeS(amiga.noteMap[note].map);
|
||||
}
|
||||
}
|
||||
|
||||
// N163
|
||||
w->writeI(n163.wave);
|
||||
w->writeC(n163.wavePos);
|
||||
w->writeC(n163.waveLen);
|
||||
w->writeC(n163.waveMode);
|
||||
w->writeC(0); // reserved
|
||||
|
||||
// more macros
|
||||
w->writeI(std.panLMacro.len);
|
||||
w->writeI(std.panRMacro.len);
|
||||
w->writeI(std.phaseResetMacro.len);
|
||||
w->writeI(std.ex4Macro.len);
|
||||
w->writeI(std.ex5Macro.len);
|
||||
w->writeI(std.ex6Macro.len);
|
||||
w->writeI(std.ex7Macro.len);
|
||||
w->writeI(std.ex8Macro.len);
|
||||
|
||||
w->writeI(std.panLMacro.loop);
|
||||
w->writeI(std.panRMacro.loop);
|
||||
w->writeI(std.phaseResetMacro.loop);
|
||||
w->writeI(std.ex4Macro.loop);
|
||||
w->writeI(std.ex5Macro.loop);
|
||||
w->writeI(std.ex6Macro.loop);
|
||||
w->writeI(std.ex7Macro.loop);
|
||||
w->writeI(std.ex8Macro.loop);
|
||||
|
||||
w->writeI(std.panLMacro.rel);
|
||||
w->writeI(std.panRMacro.rel);
|
||||
w->writeI(std.phaseResetMacro.rel);
|
||||
w->writeI(std.ex4Macro.rel);
|
||||
w->writeI(std.ex5Macro.rel);
|
||||
w->writeI(std.ex6Macro.rel);
|
||||
w->writeI(std.ex7Macro.rel);
|
||||
w->writeI(std.ex8Macro.rel);
|
||||
|
||||
w->writeC(std.panLMacro.open);
|
||||
w->writeC(std.panRMacro.open);
|
||||
w->writeC(std.phaseResetMacro.open);
|
||||
w->writeC(std.ex4Macro.open);
|
||||
w->writeC(std.ex5Macro.open);
|
||||
w->writeC(std.ex6Macro.open);
|
||||
w->writeC(std.ex7Macro.open);
|
||||
w->writeC(std.ex8Macro.open);
|
||||
|
||||
for (int j=0; j<std.panLMacro.len; j++) {
|
||||
w->writeI(std.panLMacro.val[j]);
|
||||
}
|
||||
for (int j=0; j<std.panRMacro.len; j++) {
|
||||
w->writeI(std.panRMacro.val[j]);
|
||||
}
|
||||
for (int j=0; j<std.phaseResetMacro.len; j++) {
|
||||
w->writeI(std.phaseResetMacro.val[j]);
|
||||
}
|
||||
for (int j=0; j<std.ex4Macro.len; j++) {
|
||||
w->writeI(std.ex4Macro.val[j]);
|
||||
}
|
||||
for (int j=0; j<std.ex5Macro.len; j++) {
|
||||
w->writeI(std.ex5Macro.val[j]);
|
||||
}
|
||||
for (int j=0; j<std.ex6Macro.len; j++) {
|
||||
w->writeI(std.ex6Macro.val[j]);
|
||||
}
|
||||
for (int j=0; j<std.ex7Macro.len; j++) {
|
||||
w->writeI(std.ex7Macro.val[j]);
|
||||
}
|
||||
for (int j=0; j<std.ex8Macro.len; j++) {
|
||||
w->writeI(std.ex8Macro.val[j]);
|
||||
}
|
||||
|
||||
// FDS
|
||||
w->writeI(fds.modSpeed);
|
||||
w->writeI(fds.modDepth);
|
||||
w->writeC(fds.initModTableWithFirstWave);
|
||||
w->writeC(0); // reserved
|
||||
w->writeC(0);
|
||||
w->writeC(0);
|
||||
w->write(fds.modTable,32);
|
||||
|
||||
// OPZ
|
||||
w->writeC(fm.fms2);
|
||||
w->writeC(fm.ams2);
|
||||
|
||||
// wave synth
|
||||
w->writeI(ws.wave1);
|
||||
w->writeI(ws.wave2);
|
||||
w->writeC(ws.rateDivider);
|
||||
w->writeC(ws.effect);
|
||||
w->writeC(ws.enabled);
|
||||
w->writeC(ws.global);
|
||||
w->writeC(ws.speed);
|
||||
w->writeC(ws.param1);
|
||||
w->writeC(ws.param2);
|
||||
w->writeC(ws.param3);
|
||||
w->writeC(ws.param4);
|
||||
|
||||
// other macro modes
|
||||
w->writeC(std.volMacro.mode);
|
||||
w->writeC(std.dutyMacro.mode);
|
||||
w->writeC(std.waveMacro.mode);
|
||||
w->writeC(std.pitchMacro.mode);
|
||||
w->writeC(std.ex1Macro.mode);
|
||||
w->writeC(std.ex2Macro.mode);
|
||||
w->writeC(std.ex3Macro.mode);
|
||||
w->writeC(std.algMacro.mode);
|
||||
w->writeC(std.fbMacro.mode);
|
||||
w->writeC(std.fmsMacro.mode);
|
||||
w->writeC(std.amsMacro.mode);
|
||||
w->writeC(std.panLMacro.mode);
|
||||
w->writeC(std.panRMacro.mode);
|
||||
w->writeC(std.phaseResetMacro.mode);
|
||||
w->writeC(std.ex4Macro.mode);
|
||||
w->writeC(std.ex5Macro.mode);
|
||||
w->writeC(std.ex6Macro.mode);
|
||||
w->writeC(std.ex7Macro.mode);
|
||||
w->writeC(std.ex8Macro.mode);
|
||||
|
||||
// C64 no test
|
||||
w->writeC(c64.noTest);
|
||||
|
||||
// MultiPCM
|
||||
w->writeC(multipcm.ar);
|
||||
w->writeC(multipcm.d1r);
|
||||
w->writeC(multipcm.dl);
|
||||
w->writeC(multipcm.d2r);
|
||||
w->writeC(multipcm.rr);
|
||||
w->writeC(multipcm.rc);
|
||||
w->writeC(multipcm.lfo);
|
||||
w->writeC(multipcm.vib);
|
||||
w->writeC(multipcm.am);
|
||||
for (int j=0; j<23; j++) { // reserved
|
||||
w->writeC(0);
|
||||
}
|
||||
|
||||
// Sound Unit
|
||||
w->writeC(amiga.useSample);
|
||||
w->writeC(su.switchRoles);
|
||||
|
||||
// GB hardware sequence
|
||||
w->writeC(gb.hwSeqLen);
|
||||
for (int i=0; i<gb.hwSeqLen; i++) {
|
||||
w->writeC(gb.hwSeq[i].cmd);
|
||||
w->writeS(gb.hwSeq[i].data);
|
||||
}
|
||||
|
||||
// GB additional flags
|
||||
w->writeC(gb.softEnv);
|
||||
w->writeC(gb.alwaysInit);
|
||||
|
||||
// ES5506
|
||||
w->writeC(es5506.filter.mode);
|
||||
w->writeS(es5506.filter.k1);
|
||||
w->writeS(es5506.filter.k2);
|
||||
w->writeS(es5506.envelope.ecount);
|
||||
w->writeC(es5506.envelope.lVRamp);
|
||||
w->writeC(es5506.envelope.rVRamp);
|
||||
w->writeC(es5506.envelope.k1Ramp);
|
||||
w->writeC(es5506.envelope.k2Ramp);
|
||||
w->writeC(es5506.envelope.k1Slow);
|
||||
w->writeC(es5506.envelope.k2Slow);
|
||||
|
||||
// SNES
|
||||
w->writeC(snes.useEnv);
|
||||
w->writeC(snes.gainMode);
|
||||
w->writeC(snes.gain);
|
||||
w->writeC(snes.a);
|
||||
w->writeC(snes.d);
|
||||
w->writeC((snes.s&7)|(snes.sus?8:0));
|
||||
w->writeC(snes.r);
|
||||
|
||||
// macro speed/delay
|
||||
w->writeC(std.volMacro.speed);
|
||||
w->writeC(std.arpMacro.speed);
|
||||
w->writeC(std.dutyMacro.speed);
|
||||
w->writeC(std.waveMacro.speed);
|
||||
w->writeC(std.pitchMacro.speed);
|
||||
w->writeC(std.ex1Macro.speed);
|
||||
w->writeC(std.ex2Macro.speed);
|
||||
w->writeC(std.ex3Macro.speed);
|
||||
w->writeC(std.algMacro.speed);
|
||||
w->writeC(std.fbMacro.speed);
|
||||
w->writeC(std.fmsMacro.speed);
|
||||
w->writeC(std.amsMacro.speed);
|
||||
w->writeC(std.panLMacro.speed);
|
||||
w->writeC(std.panRMacro.speed);
|
||||
w->writeC(std.phaseResetMacro.speed);
|
||||
w->writeC(std.ex4Macro.speed);
|
||||
w->writeC(std.ex5Macro.speed);
|
||||
w->writeC(std.ex6Macro.speed);
|
||||
w->writeC(std.ex7Macro.speed);
|
||||
w->writeC(std.ex8Macro.speed);
|
||||
|
||||
w->writeC(std.volMacro.delay);
|
||||
w->writeC(std.arpMacro.delay);
|
||||
w->writeC(std.dutyMacro.delay);
|
||||
w->writeC(std.waveMacro.delay);
|
||||
w->writeC(std.pitchMacro.delay);
|
||||
w->writeC(std.ex1Macro.delay);
|
||||
w->writeC(std.ex2Macro.delay);
|
||||
w->writeC(std.ex3Macro.delay);
|
||||
w->writeC(std.algMacro.delay);
|
||||
w->writeC(std.fbMacro.delay);
|
||||
w->writeC(std.fmsMacro.delay);
|
||||
w->writeC(std.amsMacro.delay);
|
||||
w->writeC(std.panLMacro.delay);
|
||||
w->writeC(std.panRMacro.delay);
|
||||
w->writeC(std.phaseResetMacro.delay);
|
||||
w->writeC(std.ex4Macro.delay);
|
||||
w->writeC(std.ex5Macro.delay);
|
||||
w->writeC(std.ex6Macro.delay);
|
||||
w->writeC(std.ex7Macro.delay);
|
||||
w->writeC(std.ex8Macro.delay);
|
||||
|
||||
// op macro speed/delay
|
||||
for (int i=0; i<4; i++) {
|
||||
DivInstrumentSTD::OpMacro& op=std.opMacros[i];
|
||||
|
||||
w->writeC(op.amMacro.speed);
|
||||
w->writeC(op.arMacro.speed);
|
||||
w->writeC(op.drMacro.speed);
|
||||
w->writeC(op.multMacro.speed);
|
||||
w->writeC(op.rrMacro.speed);
|
||||
w->writeC(op.slMacro.speed);
|
||||
w->writeC(op.tlMacro.speed);
|
||||
w->writeC(op.dt2Macro.speed);
|
||||
w->writeC(op.rsMacro.speed);
|
||||
w->writeC(op.dtMacro.speed);
|
||||
w->writeC(op.d2rMacro.speed);
|
||||
w->writeC(op.ssgMacro.speed);
|
||||
w->writeC(op.damMacro.speed);
|
||||
w->writeC(op.dvbMacro.speed);
|
||||
w->writeC(op.egtMacro.speed);
|
||||
w->writeC(op.kslMacro.speed);
|
||||
w->writeC(op.susMacro.speed);
|
||||
w->writeC(op.vibMacro.speed);
|
||||
w->writeC(op.wsMacro.speed);
|
||||
w->writeC(op.ksrMacro.speed);
|
||||
|
||||
w->writeC(op.amMacro.delay);
|
||||
w->writeC(op.arMacro.delay);
|
||||
w->writeC(op.drMacro.delay);
|
||||
w->writeC(op.multMacro.delay);
|
||||
w->writeC(op.rrMacro.delay);
|
||||
w->writeC(op.slMacro.delay);
|
||||
w->writeC(op.tlMacro.delay);
|
||||
w->writeC(op.dt2Macro.delay);
|
||||
w->writeC(op.rsMacro.delay);
|
||||
w->writeC(op.dtMacro.delay);
|
||||
w->writeC(op.d2rMacro.delay);
|
||||
w->writeC(op.ssgMacro.delay);
|
||||
w->writeC(op.damMacro.delay);
|
||||
w->writeC(op.dvbMacro.delay);
|
||||
w->writeC(op.egtMacro.delay);
|
||||
w->writeC(op.kslMacro.delay);
|
||||
w->writeC(op.susMacro.delay);
|
||||
w->writeC(op.vibMacro.delay);
|
||||
w->writeC(op.wsMacro.delay);
|
||||
w->writeC(op.ksrMacro.delay);
|
||||
}
|
||||
|
||||
blockEndSeek=w->tell();
|
||||
w->seek(blockStartSeek,SEEK_SET);
|
||||
w->writeI(blockEndSeek-blockStartSeek-4);
|
||||
w->seek(0,SEEK_END);
|
||||
}
|
||||
|
||||
#define READ_FEAT_BEGIN \
|
||||
unsigned short featLen=reader.readS(); \
|
||||
size_t endOfFeat=reader.tell()+featLen;
|
||||
|
@ -3627,32 +2987,11 @@ void DivInstrument::convertC64SpecialMacro() {
|
|||
std.ex3Macro=DivInstrumentMacro(DIV_MACRO_EX3);
|
||||
}
|
||||
|
||||
bool DivInstrument::save(const char* path, bool oldFormat, DivSong* song, bool writeInsName) {
|
||||
bool DivInstrument::save(const char* path, DivSong* song, bool writeInsName) {
|
||||
SafeWriter* w=new SafeWriter();
|
||||
w->init();
|
||||
|
||||
if (oldFormat) {
|
||||
// write magic
|
||||
w->write("-Furnace instr.-",16);
|
||||
|
||||
// write version
|
||||
w->writeS(DIV_ENGINE_VERSION);
|
||||
|
||||
// reserved
|
||||
w->writeS(0);
|
||||
|
||||
// pointer to data
|
||||
w->writeI(32);
|
||||
|
||||
// reserved
|
||||
w->writeS(0);
|
||||
w->writeS(0);
|
||||
w->writeI(0);
|
||||
|
||||
putInsData(w);
|
||||
} else {
|
||||
putInsData2(w,true,song,writeInsName);
|
||||
}
|
||||
|
||||
FILE* outFile=ps_fopen(path,"wb");
|
||||
if (outFile==NULL) {
|
||||
|
|
|
@ -912,12 +912,6 @@ struct DivInstrument {
|
|||
* save the instrument to a SafeWriter.
|
||||
* @param w the SafeWriter in question.
|
||||
*/
|
||||
void putInsData(SafeWriter* w);
|
||||
|
||||
/**
|
||||
* save the instrument to a SafeWriter using new format.
|
||||
* @param w the SafeWriter in question.
|
||||
*/
|
||||
void putInsData2(SafeWriter* w, bool fui=false, const DivSong* song=NULL, bool insName=true);
|
||||
|
||||
/**
|
||||
|
@ -931,12 +925,11 @@ struct DivInstrument {
|
|||
/**
|
||||
* save this instrument to a file.
|
||||
* @param path file path.
|
||||
* @param oldFormat whether to save in legacy Furnace ins format.
|
||||
* @param song if new format, a DivSong to read wavetables and samples.
|
||||
* @param writeInsName whether to write the instrument name or not. ignored if old format.
|
||||
* @return whether it was successful.
|
||||
*/
|
||||
bool save(const char* path, bool oldFormat=false, DivSong* song=NULL, bool writeInsName=true);
|
||||
bool save(const char* path, DivSong* song=NULL, bool writeInsName=true);
|
||||
|
||||
/**
|
||||
* save this instrument to a file in .dmp format.
|
||||
|
|
|
@ -4962,7 +4962,7 @@ bool FurnaceGUI::loop() {
|
|||
break;
|
||||
case GUI_FILE_INS_SAVE:
|
||||
if (curIns>=0 && curIns<(int)e->song.ins.size()) {
|
||||
if (e->song.ins[curIns]->save(copyOfName.c_str(),false,&e->song,settings.writeInsNames)) {
|
||||
if (e->song.ins[curIns]->save(copyOfName.c_str(),&e->song,settings.writeInsNames)) {
|
||||
pushRecentSys(copyOfName.c_str());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue