mirror of
https://github.com/tildearrow/furnace.git
synced 2025-01-03 22:21:09 +00:00
more work
This commit is contained in:
parent
8d9cddde37
commit
0b4ad13858
2 changed files with 12 additions and 18 deletions
|
@ -433,7 +433,7 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ds.system[0]==DIV_SYSTEM_YMU759 && ds.version<0x10) { // TODO
|
if (ds.system[0]==DIV_SYSTEM_YMU759 && ds.version<0x10) {
|
||||||
ds.vendor=reader.readString((unsigned char)reader.readC());
|
ds.vendor=reader.readString((unsigned char)reader.readC());
|
||||||
ds.carrier=reader.readString((unsigned char)reader.readC());
|
ds.carrier=reader.readString((unsigned char)reader.readC());
|
||||||
ds.category=reader.readString((unsigned char)reader.readC());
|
ds.category=reader.readString((unsigned char)reader.readC());
|
||||||
|
@ -493,7 +493,6 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO
|
|
||||||
if (ds.version>0x17) {
|
if (ds.version>0x17) {
|
||||||
ds.patLen=reader.readI();
|
ds.patLen=reader.readI();
|
||||||
} else {
|
} else {
|
||||||
|
@ -582,7 +581,7 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
|
||||||
ins->fm.op[j].dvb=reader.readC();
|
ins->fm.op[j].dvb=reader.readC();
|
||||||
ins->fm.op[j].egt=reader.readC();
|
ins->fm.op[j].egt=reader.readC();
|
||||||
ins->fm.op[j].ksl=reader.readC();
|
ins->fm.op[j].ksl=reader.readC();
|
||||||
if (ds.version<0x11) { // TODO: don't know when did this change
|
if (ds.version<0x11) { // don't know when did this change
|
||||||
ins->fm.op[j].ksr=reader.readC();
|
ins->fm.op[j].ksr=reader.readC();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -653,7 +652,7 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
|
||||||
if (ins->std.arpMacroLen>0) {
|
if (ins->std.arpMacroLen>0) {
|
||||||
ins->std.arpMacroLoop=reader.readC();
|
ins->std.arpMacroLoop=reader.readC();
|
||||||
}
|
}
|
||||||
if (ds.version>0x0f) { // TODO
|
if (ds.version>0x0f) {
|
||||||
ins->std.arpMacroMode=reader.readC();
|
ins->std.arpMacroMode=reader.readC();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1401,6 +1400,15 @@ SafeWriter* DivEngine::saveDMF() {
|
||||||
w->writeC(song.ins.size());
|
w->writeC(song.ins.size());
|
||||||
for (DivInstrument* i: song.ins) {
|
for (DivInstrument* i: song.ins) {
|
||||||
w->writeString(i->name,true);
|
w->writeString(i->name,true);
|
||||||
|
|
||||||
|
// safety check
|
||||||
|
if (!isFMSystem(song.system[0]) && i->mode) {
|
||||||
|
i->mode=0;
|
||||||
|
}
|
||||||
|
if (!isSTDSystem(song.system[0]) && i->mode==0) {
|
||||||
|
i->mode=1;
|
||||||
|
}
|
||||||
|
|
||||||
w->writeC(i->mode);
|
w->writeC(i->mode);
|
||||||
if (i->mode) { // FM
|
if (i->mode) { // FM
|
||||||
w->writeC(i->fm.alg);
|
w->writeC(i->fm.alg);
|
||||||
|
@ -1838,15 +1846,6 @@ void DivEngine::changeSystem(int index, DivSystem which) {
|
||||||
isBusy.lock();
|
isBusy.lock();
|
||||||
song.system[index]=which;
|
song.system[index]=which;
|
||||||
recalcChans();
|
recalcChans();
|
||||||
// instrument safety check (TODO: rewrite for multi-system)
|
|
||||||
for (DivInstrument* i: song.ins) {
|
|
||||||
if (!isFMSystem(song.system[index]) && i->mode) {
|
|
||||||
i->mode=false;
|
|
||||||
}
|
|
||||||
if (!isSTDSystem(song.system[index]) && !i->mode) {
|
|
||||||
i->mode=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
isBusy.unlock();
|
isBusy.unlock();
|
||||||
initDispatch();
|
initDispatch();
|
||||||
isBusy.lock();
|
isBusy.lock();
|
||||||
|
@ -2519,7 +2518,6 @@ void DivEngine::quitDispatch() {
|
||||||
#include "winStuff.h"
|
#include "winStuff.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TODO: all of this!
|
|
||||||
bool DivEngine::init(String outName) {
|
bool DivEngine::init(String outName) {
|
||||||
// init config
|
// init config
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
|
@ -9,10 +9,6 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
|
|
||||||
// TODO;
|
|
||||||
// - prepare for multi-chip support
|
|
||||||
// - implement the .fur format
|
|
||||||
|
|
||||||
#define DIV_VERSION "0.2.2"
|
#define DIV_VERSION "0.2.2"
|
||||||
#define DIV_ENGINE_VERSION 14
|
#define DIV_ENGINE_VERSION 14
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue