S3M import: fix Bxx effect
This commit is contained in:
parent
5cec39587c
commit
26b72eb348
|
@ -61,12 +61,21 @@ bool DivEngine::loadS3M(unsigned char* file, size_t len) {
|
||||||
unsigned char chanPan[16];
|
unsigned char chanPan[16];
|
||||||
unsigned char defVol[256];
|
unsigned char defVol[256];
|
||||||
|
|
||||||
|
unsigned char orders[256];
|
||||||
|
|
||||||
bool doesPitchSlide[32];
|
bool doesPitchSlide[32];
|
||||||
bool doesVibrato[32];
|
bool doesVibrato[32];
|
||||||
bool doesPanning[32];
|
bool doesPanning[32];
|
||||||
bool doesVolSlide[32];
|
bool doesVolSlide[32];
|
||||||
bool doesArp[32];
|
bool doesArp[32];
|
||||||
|
|
||||||
|
memset(chanSettings,0,32);
|
||||||
|
memset(insPtr,0,256*sizeof(unsigned int));
|
||||||
|
memset(patPtr,0,256*sizeof(unsigned int));
|
||||||
|
memset(chanPan,0,16);
|
||||||
|
memset(defVol,0,256);
|
||||||
|
memset(orders,0,256);
|
||||||
|
|
||||||
memset(doesPitchSlide,0,32*sizeof(bool));
|
memset(doesPitchSlide,0,32*sizeof(bool));
|
||||||
memset(doesVibrato,0,32*sizeof(bool));
|
memset(doesVibrato,0,32*sizeof(bool));
|
||||||
memset(doesPanning,0,32*sizeof(bool));
|
memset(doesPanning,0,32*sizeof(bool));
|
||||||
|
@ -183,6 +192,8 @@ bool DivEngine::loadS3M(unsigned char* file, size_t len) {
|
||||||
ds.subsong[curSubSong]->ordersLen=0;
|
ds.subsong[curSubSong]->ordersLen=0;
|
||||||
for (int i=0; i<ordersLen; i++) {
|
for (int i=0; i<ordersLen; i++) {
|
||||||
unsigned char nextOrder=reader.readC();
|
unsigned char nextOrder=reader.readC();
|
||||||
|
orders[i]=curOrder;
|
||||||
|
|
||||||
// skip +++ order
|
// skip +++ order
|
||||||
if (nextOrder==254) {
|
if (nextOrder==254) {
|
||||||
logV("- +++");
|
logV("- +++");
|
||||||
|
@ -205,6 +216,7 @@ bool DivEngine::loadS3M(unsigned char* file, size_t len) {
|
||||||
ds.subsong[curSubSong]->orders.ord[j][ds.subsong[curSubSong]->ordersLen]=nextOrder;
|
ds.subsong[curSubSong]->orders.ord[j][ds.subsong[curSubSong]->ordersLen]=nextOrder;
|
||||||
}
|
}
|
||||||
ds.subsong[curSubSong]->ordersLen++;
|
ds.subsong[curSubSong]->ordersLen++;
|
||||||
|
curOrder++;
|
||||||
}
|
}
|
||||||
|
|
||||||
logD("reading ins pointers...");
|
logD("reading ins pointers...");
|
||||||
|
@ -763,9 +775,8 @@ bool DivEngine::loadS3M(unsigned char* file, size_t len) {
|
||||||
p->data[curRow][effectCol[chan]++]=effectVal;
|
p->data[curRow][effectCol[chan]++]=effectVal;
|
||||||
break;
|
break;
|
||||||
case 'B': // go to order
|
case 'B': // go to order
|
||||||
// TODO: handle subsongs and spacing
|
|
||||||
p->data[curRow][effectCol[chan]++]=0x0b;
|
p->data[curRow][effectCol[chan]++]=0x0b;
|
||||||
p->data[curRow][effectCol[chan]++]=effectVal;
|
p->data[curRow][effectCol[chan]++]=orders[effectVal];
|
||||||
break;
|
break;
|
||||||
case 'C': // next order
|
case 'C': // next order
|
||||||
p->data[curRow][effectCol[chan]++]=0x0d;
|
p->data[curRow][effectCol[chan]++]=0x0d;
|
||||||
|
|
Loading…
Reference in a new issue