fix 09xx, 0Bxx, 0Dxx and 0Fxx being ignored on ED
This commit is contained in:
		
							parent
							
								
									955cd48fcf
								
							
						
					
					
						commit
						431b6b5957
					
				| 
						 | 
					@ -268,26 +268,53 @@ void DivEngine::processRow(int i, bool afterDelay) {
 | 
				
			||||||
  int whatRow=afterDelay?chan[i].delayRow:curRow;
 | 
					  int whatRow=afterDelay?chan[i].delayRow:curRow;
 | 
				
			||||||
  DivPattern* pat=song.pat[i].getPattern(song.orders.ord[i][whatOrder],false);
 | 
					  DivPattern* pat=song.pat[i].getPattern(song.orders.ord[i][whatOrder],false);
 | 
				
			||||||
  // pre effects
 | 
					  // pre effects
 | 
				
			||||||
  if (!afterDelay) for (int j=0; j<song.pat[i].effectCols; j++) {
 | 
					  if (!afterDelay) {
 | 
				
			||||||
    short effect=pat->data[whatRow][4+(j<<1)];
 | 
					    bool returnAfterPre=false;
 | 
				
			||||||
    short effectVal=pat->data[whatRow][5+(j<<1)];
 | 
					    for (int j=0; j<song.pat[i].effectCols; j++) {
 | 
				
			||||||
 | 
					      short effect=pat->data[whatRow][4+(j<<1)];
 | 
				
			||||||
 | 
					      short effectVal=pat->data[whatRow][5+(j<<1)];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (effectVal==-1) effectVal=0;
 | 
					      if (effectVal==-1) effectVal=0;
 | 
				
			||||||
    if (effect==0xed && effectVal!=0) {
 | 
					
 | 
				
			||||||
      if (effectVal<=nextSpeed) {
 | 
					      switch (effect) {
 | 
				
			||||||
        chan[i].rowDelay=effectVal+1;
 | 
					        case 0x09: // speed 1
 | 
				
			||||||
        chan[i].delayOrder=whatOrder;
 | 
					          if (effectVal>0) speed1=effectVal;
 | 
				
			||||||
        chan[i].delayRow=whatRow;
 | 
					          break;
 | 
				
			||||||
        if (effectVal==nextSpeed) {
 | 
					        case 0x0f: // speed 2
 | 
				
			||||||
          //if (sysOfChan[i]!=DIV_SYSTEM_YM2610 && sysOfChan[i]!=DIV_SYSTEM_YM2610_EXT) chan[i].delayLocked=true;
 | 
					          if (effectVal>0) speed2=effectVal;
 | 
				
			||||||
        } else {
 | 
					          break;
 | 
				
			||||||
          chan[i].delayLocked=false;
 | 
					        case 0x0b: // change order
 | 
				
			||||||
        }
 | 
					          if (changeOrd==-1) {
 | 
				
			||||||
        return;
 | 
					            changeOrd=effectVal;
 | 
				
			||||||
      } else {
 | 
					            changePos=0;
 | 
				
			||||||
        chan[i].delayLocked=false;
 | 
					          }
 | 
				
			||||||
 | 
					          break;
 | 
				
			||||||
 | 
					        case 0x0d: // next order
 | 
				
			||||||
 | 
					          if (changeOrd<0 && (curOrder<(song.ordersLen-1) || !song.ignoreJumpAtEnd)) {
 | 
				
			||||||
 | 
					            changeOrd=-2;
 | 
				
			||||||
 | 
					            changePos=effectVal;
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					          break;
 | 
				
			||||||
 | 
					        case 0xed: // delay
 | 
				
			||||||
 | 
					          if (effectVal!=0) {
 | 
				
			||||||
 | 
					            if (effectVal<=nextSpeed) {
 | 
				
			||||||
 | 
					              chan[i].rowDelay=effectVal+1;
 | 
				
			||||||
 | 
					              chan[i].delayOrder=whatOrder;
 | 
				
			||||||
 | 
					              chan[i].delayRow=whatRow;
 | 
				
			||||||
 | 
					              if (effectVal==nextSpeed) {
 | 
				
			||||||
 | 
					                //if (sysOfChan[i]!=DIV_SYSTEM_YM2610 && sysOfChan[i]!=DIV_SYSTEM_YM2610_EXT) chan[i].delayLocked=true;
 | 
				
			||||||
 | 
					              } else {
 | 
				
			||||||
 | 
					                chan[i].delayLocked=false;
 | 
				
			||||||
 | 
					              }
 | 
				
			||||||
 | 
					              returnAfterPre=true;
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					              chan[i].delayLocked=false;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					          break;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    if (returnAfterPre) return;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (chan[i].delayLocked) return;
 | 
					  if (chan[i].delayLocked) return;
 | 
				
			||||||
| 
						 | 
					@ -386,24 +413,6 @@ void DivEngine::processRow(int i, bool afterDelay) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // per-system effect
 | 
					    // per-system effect
 | 
				
			||||||
    if (!perSystemEffect(i,effect,effectVal)) switch (effect) {
 | 
					    if (!perSystemEffect(i,effect,effectVal)) switch (effect) {
 | 
				
			||||||
      case 0x09: // speed 1
 | 
					 | 
				
			||||||
        if (effectVal>0) speed1=effectVal;
 | 
					 | 
				
			||||||
        break;
 | 
					 | 
				
			||||||
      case 0x0f: // speed 2
 | 
					 | 
				
			||||||
        if (effectVal>0) speed2=effectVal;
 | 
					 | 
				
			||||||
        break;
 | 
					 | 
				
			||||||
      case 0x0b: // change order
 | 
					 | 
				
			||||||
        if (changeOrd==-1) {
 | 
					 | 
				
			||||||
          changeOrd=effectVal;
 | 
					 | 
				
			||||||
          changePos=0;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        break;
 | 
					 | 
				
			||||||
      case 0x0d: // next order
 | 
					 | 
				
			||||||
        if (changeOrd<0 && (curOrder<(song.ordersLen-1) || !song.ignoreJumpAtEnd)) {
 | 
					 | 
				
			||||||
          changeOrd=-2;
 | 
					 | 
				
			||||||
          changePos=effectVal;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        break;
 | 
					 | 
				
			||||||
      case 0x08: // panning (split 4-bit)
 | 
					      case 0x08: // panning (split 4-bit)
 | 
				
			||||||
        chan[i].panL=(effectVal>>4)|(effectVal&0xf0);
 | 
					        chan[i].panL=(effectVal>>4)|(effectVal&0xf0);
 | 
				
			||||||
        chan[i].panR=(effectVal&15)|((effectVal&15)<<4);
 | 
					        chan[i].panR=(effectVal&15)|((effectVal&15)<<4);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue