update format to store OPLL preset number

This commit is contained in:
tildearrow 2022-02-25 23:59:08 -05:00
parent 60688d8ddb
commit c52258f943
4 changed files with 19 additions and 10 deletions

View file

@ -25,6 +25,7 @@ furthermore, an `or reserved` indicates this field is always present, but is res
the format versions are: the format versions are:
- 60: Furnace dev60
- 59: Furnace dev59 - 59: Furnace dev59
- 58: Furnace dev58 - 58: Furnace dev58
- 57: Furnace dev57 - 57: Furnace dev57
@ -228,7 +229,11 @@ size | description
1 | fms 1 | fms
1 | ams 1 | ams
1 | operator count (always 4) 1 | operator count (always 4)
3 | reserved 1 | OPLL preset (>=60) or reserved
| - 0: custom
| - 1-15: pre-defined patches
| - 16: drums (compatibility only!)
2 | reserved
--- | **FM operator data** × 4 --- | **FM operator data** × 4
1 | am 1 | am
1 | ar 1 | ar

View file

@ -37,8 +37,8 @@
warnings+=(String("\n")+x); \ warnings+=(String("\n")+x); \
} }
#define DIV_VERSION "dev59" #define DIV_VERSION "dev60"
#define DIV_ENGINE_VERSION 59 #define DIV_ENGINE_VERSION 60
enum DivStatusView { enum DivStatusView {
DIV_STATUS_NOTHING=0, DIV_STATUS_NOTHING=0,

View file

@ -40,9 +40,9 @@ void DivInstrument::putInsData(SafeWriter* w) {
w->writeC(fm.fms); w->writeC(fm.fms);
w->writeC(fm.ams); w->writeC(fm.ams);
w->writeC(4); // operator count; always 4 w->writeC(4); // operator count; always 4
w->writeC(fm.opllPreset);
w->writeC(0); // reserved w->writeC(0); // reserved
w->writeC(0); w->writeC(0);
w->writeC(0);
for (int j=0; j<4; j++) { for (int j=0; j<4; j++) {
DivInstrumentFM::Operator& op=fm.op[j]; DivInstrumentFM::Operator& op=fm.op[j];
@ -325,7 +325,11 @@ DivDataErrors DivInstrument::readInsData(SafeReader& reader, short version) {
fm.fms=reader.readC(); fm.fms=reader.readC();
fm.ams=reader.readC(); fm.ams=reader.readC();
fm.ops=reader.readC(); fm.ops=reader.readC();
reader.readC(); if (version>=60) {
fm.opllPreset=reader.readC();
} else {
reader.readC();
}
reader.readC(); reader.readC();
reader.readC(); reader.readC();

View file

@ -88,13 +88,13 @@ void DivPlatformOPLL::acquire_nuked(short* bufL, short* bufR, size_t start, size
printf("write: %x = %.2x\n",w.addr,w.val); printf("write: %x = %.2x\n",w.addr,w.val);
regPool[w.addr&0xff]=w.val; regPool[w.addr&0xff]=w.val;
writes.pop(); writes.pop();
delay=84; delay=21;
} else { } else {
//printf("busycounter: %d\n",lastBusy); //printf("busycounter: %d\n",lastBusy);
//w.addr=rand()&0x3f; //w.addr=rand()&0x3f;
OPLL_Write(&fm,0,w.addr); OPLL_Write(&fm,0,w.addr);
w.addrOrVal=true; w.addrOrVal=true;
delay=12; delay=3;
} }
} }
@ -267,7 +267,7 @@ void DivPlatformOPLL::tick() {
} }
if (chan[i].keyOn) { if (chan[i].keyOn) {
//immWrite(0x28,0xf0|konOffs[i]); //immWrite(0x28,0xf0|konOffs[i]);
immWrite(0x20+i,(chan[i].freqH)|(chan[i].active<<4)); immWrite(0x20+i,(chan[i].freqH)|(chan[i].active<<4)|0x20);
chan[i].keyOn=false; chan[i].keyOn=false;
} }
} }
@ -657,9 +657,9 @@ void DivPlatformOPLL::setFlags(unsigned int flags) {
} else if (flags==2) { } else if (flags==2) {
chipClock=8000000.0; chipClock=8000000.0;
} else if (flags==1) { } else if (flags==1) {
chipClock=COLOR_PAL*4.0/5.0; chipClock=COLOR_PAL*1.0/5.0;
} else { } else {
chipClock=COLOR_NTSC; chipClock=COLOR_NTSC/4.0;
} }
rate=chipClock; rate=chipClock;
} }