Fix panning
This commit is contained in:
		
							parent
							
								
									fca4bdc1ee
								
							
						
					
					
						commit
						d0c32a56be
					
				|  | @ -306,7 +306,7 @@ void DivPlatformX1_010::updateEnvelope(int ch) { | ||||||
|         for (int i=0; i<128; i++) { |         for (int i=0; i<128; i++) { | ||||||
|           if (wt->max<1 || wt->len<1) { |           if (wt->max<1 || wt->len<1) { | ||||||
|             envFill(ch,i); |             envFill(ch,i); | ||||||
|           } else if (stereo&&(chan[ch].env.flag.envHinv||chan[ch].env.flag.envSplit||chan[ch].env.flag.envVinv)) { // Stereo config 
 |           } else if (chan[ch].env.flag.envHinv||chan[ch].env.flag.envSplit||chan[ch].env.flag.envVinv) { // Stereo config 
 | ||||||
|             int la = i, ra = i; |             int la = i, ra = i; | ||||||
|             int lo, ro; |             int lo, ro; | ||||||
|             if (chan[ch].env.flag.envHinv) { ra = 127-i; } // horizontal invert right envelope
 |             if (chan[ch].env.flag.envHinv) { ra = 127-i; } // horizontal invert right envelope
 | ||||||
|  | @ -386,7 +386,6 @@ void DivPlatformX1_010::tick() { | ||||||
|           refreshControl(i); |           refreshControl(i); | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
| 	  if (stereo) { |  | ||||||
| 	  bool nextSplit=(chan[i].std.ex1&4); | 	  bool nextSplit=(chan[i].std.ex1&4); | ||||||
|       if (nextSplit!=(chan[i].env.flag.envSplit)) { |       if (nextSplit!=(chan[i].env.flag.envSplit)) { | ||||||
|         chan[i].env.flag.envSplit=nextSplit; |         chan[i].env.flag.envSplit=nextSplit; | ||||||
|  | @ -409,7 +408,6 @@ void DivPlatformX1_010::tick() { | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|     } |  | ||||||
|     if (chan[i].std.hadEx2) { |     if (chan[i].std.hadEx2) { | ||||||
|       if (chan[i].env.shape!=chan[i].std.ex2) { |       if (chan[i].env.shape!=chan[i].std.ex2) { | ||||||
|         chan[i].env.shape=chan[i].std.ex2; |         chan[i].env.shape=chan[i].std.ex2; | ||||||
|  | @ -437,12 +435,8 @@ void DivPlatformX1_010::tick() { | ||||||
|     } |     } | ||||||
|     if (chan[i].envChanged) { |     if (chan[i].envChanged) { | ||||||
|       if (!isMuted[i]) { |       if (!isMuted[i]) { | ||||||
| 		if (stereo) { |  | ||||||
| 		chan[i].lvol=((chan[i].outVol&0xf)*((chan[i].pan>>4)&0xf))/15; | 		chan[i].lvol=((chan[i].outVol&0xf)*((chan[i].pan>>4)&0xf))/15; | ||||||
|         chan[i].rvol=((chan[i].outVol&0xf)*((chan[i].pan>>0)&0xf))/15; |         chan[i].rvol=((chan[i].outVol&0xf)*((chan[i].pan>>0)&0xf))/15; | ||||||
| 		} else { |  | ||||||
|           chan[i].lvol=chan[i].rvol=chan[i].outVol; |  | ||||||
| 		} |  | ||||||
|       } |       } | ||||||
|       updateEnvelope(i); |       updateEnvelope(i); | ||||||
|       chan[i].envChanged=false; |       chan[i].envChanged=false; | ||||||
|  | @ -654,7 +648,7 @@ int DivPlatformX1_010::dispatch(DivCommand c) { | ||||||
|       } |       } | ||||||
|       break; |       break; | ||||||
|     case DIV_CMD_PANNING: { |     case DIV_CMD_PANNING: { | ||||||
|       if (stereo&&(chan[c.chan].pan!=c.value)) { |       if (chan[c.chan].pan!=c.value) { | ||||||
|         chan[c.chan].pan=c.value; |         chan[c.chan].pan=c.value; | ||||||
|         if (!isMuted[c.chan]) { |         if (!isMuted[c.chan]) { | ||||||
|           chan[c.chan].envChanged=true; |           chan[c.chan].envChanged=true; | ||||||
|  | @ -700,7 +694,6 @@ int DivPlatformX1_010::dispatch(DivCommand c) { | ||||||
|           refreshControl(c.chan); |           refreshControl(c.chan); | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
| 	  if (stereo) { |  | ||||||
| 	  bool nextSplit=c.value&4; | 	  bool nextSplit=c.value&4; | ||||||
|       if (nextSplit!=(chan[c.chan].env.flag.envSplit)) { |       if (nextSplit!=(chan[c.chan].env.flag.envSplit)) { | ||||||
|         chan[c.chan].env.flag.envSplit=nextSplit; |         chan[c.chan].env.flag.envSplit=nextSplit; | ||||||
|  | @ -722,7 +715,6 @@ int DivPlatformX1_010::dispatch(DivCommand c) { | ||||||
|           chan[c.chan].envChanged=true; |           chan[c.chan].envChanged=true; | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
| 	  } |  | ||||||
|       break; |       break; | ||||||
| 	} | 	} | ||||||
|     case DIV_CMD_X1_010_ENVELOPE_PERIOD: |     case DIV_CMD_X1_010_ENVELOPE_PERIOD: | ||||||
|  |  | ||||||
|  | @ -260,6 +260,8 @@ bool DivEngine::perSystemEffect(int ch, unsigned char effect, unsigned char effe | ||||||
|         case 0x17: // PCM enable
 |         case 0x17: // PCM enable
 | ||||||
|           dispatchCmd(DivCommand(DIV_CMD_SAMPLE_MODE,ch,(effectVal>0))); |           dispatchCmd(DivCommand(DIV_CMD_SAMPLE_MODE,ch,(effectVal>0))); | ||||||
|           break; |           break; | ||||||
|  |         default: | ||||||
|  |           return false; | ||||||
|       } |       } | ||||||
|       break; |       break; | ||||||
|     default: |     default: | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 cam900
						cam900