mirror of
https://github.com/tildearrow/furnace.git
synced 2024-12-17 22:10:12 +00:00
better YMU759 support
time base now loaded as rate and timer no longer bugs out also you can save YMU759 songs as .fur now, even if it is pointless
This commit is contained in:
parent
9b6db75d4f
commit
7568f1a1b9
2 changed files with 34 additions and 47 deletions
|
@ -506,6 +506,34 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
|
|||
ds.arpLen=1;
|
||||
}
|
||||
|
||||
if (ds.system[0]==DIV_SYSTEM_YMU759) {
|
||||
switch (ds.timeBase) {
|
||||
case 0:
|
||||
ds.hz=248;
|
||||
break;
|
||||
case 1:
|
||||
ds.hz=200;
|
||||
break;
|
||||
case 2:
|
||||
ds.hz=100;
|
||||
break;
|
||||
case 3:
|
||||
ds.hz=50;
|
||||
break;
|
||||
case 4:
|
||||
ds.hz=25;
|
||||
break;
|
||||
case 5:
|
||||
ds.hz=20;
|
||||
break;
|
||||
default:
|
||||
ds.hz=248;
|
||||
break;
|
||||
}
|
||||
ds.customTempo=true;
|
||||
ds.timeBase=0;
|
||||
}
|
||||
|
||||
logI("reading pattern matrix (%d)...\n",ds.ordersLen);
|
||||
for (int i=0; i<getChannelCount(ds.system[0]); i++) {
|
||||
for (int j=0; j<ds.ordersLen; j++) {
|
||||
|
@ -1344,13 +1372,6 @@ SafeWriter* DivEngine::saveFur() {
|
|||
std::vector<int> patPtr;
|
||||
size_t ptrSeek;
|
||||
|
||||
// fail if this is an YMU759 song
|
||||
if (song.system[0]==DIV_SYSTEM_YMU759) {
|
||||
logE("cannot save YMU759 song!\n");
|
||||
lastError="YMU759 song saving is not supported";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SafeWriter* w=new SafeWriter;
|
||||
w->init();
|
||||
/// HEADER
|
||||
|
|
|
@ -643,22 +643,12 @@ void DivEngine::nextRow() {
|
|||
}
|
||||
}
|
||||
|
||||
if (song.system[0]==DIV_SYSTEM_YMU759) {
|
||||
if (speedAB) {
|
||||
ticks=speed2;
|
||||
nextSpeed=speed1;
|
||||
} else {
|
||||
ticks=speed1;
|
||||
nextSpeed=speed2;
|
||||
}
|
||||
if (speedAB) {
|
||||
ticks=speed2*(song.timeBase+1);
|
||||
nextSpeed=speed1;
|
||||
} else {
|
||||
if (speedAB) {
|
||||
ticks=speed2*(song.timeBase+1);
|
||||
nextSpeed=speed1;
|
||||
} else {
|
||||
ticks=speed1*(song.timeBase+1);
|
||||
nextSpeed=speed2;
|
||||
}
|
||||
ticks=speed1*(song.timeBase+1);
|
||||
nextSpeed=speed2;
|
||||
}
|
||||
speedAB=!speedAB;
|
||||
|
||||
|
@ -679,31 +669,7 @@ bool DivEngine::nextTick(bool noAccum) {
|
|||
if (song.customTempo) {
|
||||
divider=song.hz;
|
||||
} else {
|
||||
if (song.system[0]==DIV_SYSTEM_YMU759) {
|
||||
switch (song.timeBase) {
|
||||
case 0:
|
||||
divider=248;
|
||||
break;
|
||||
case 1:
|
||||
divider=210;
|
||||
break;
|
||||
case 2:
|
||||
divider=100;
|
||||
break;
|
||||
case 3:
|
||||
divider=50;
|
||||
break;
|
||||
case 4:
|
||||
divider=25;
|
||||
break;
|
||||
case 5:
|
||||
divider=20;
|
||||
break;
|
||||
default:
|
||||
divider=248;
|
||||
break;
|
||||
}
|
||||
} else if (song.pal) {
|
||||
if (song.pal) {
|
||||
divider=60;
|
||||
} else {
|
||||
divider=50;
|
||||
|
|
Loading…
Reference in a new issue