more LFO fix code
This commit is contained in:
		
							parent
							
								
									59cbfdcad9
								
							
						
					
					
						commit
						026b232c02
					
				| 
						 | 
					@ -294,10 +294,14 @@ int DivPlatformPCE::dispatch(DivCommand c) {
 | 
				
			||||||
      chan[c.chan].keyOn=true;
 | 
					      chan[c.chan].keyOn=true;
 | 
				
			||||||
      break;
 | 
					      break;
 | 
				
			||||||
    case DIV_CMD_PCE_LFO_MODE:
 | 
					    case DIV_CMD_PCE_LFO_MODE:
 | 
				
			||||||
      rWrite(0x09,c.value);
 | 
					      lfoMode=c.value;
 | 
				
			||||||
 | 
					      rWrite(0x08,lfoSpeed);
 | 
				
			||||||
 | 
					      rWrite(0x09,lfoMode);
 | 
				
			||||||
      break;
 | 
					      break;
 | 
				
			||||||
    case DIV_CMD_PCE_LFO_SPEED:
 | 
					    case DIV_CMD_PCE_LFO_SPEED:
 | 
				
			||||||
      rWrite(0x08,255-c.value);
 | 
					      lfoSpeed=255-c.value;
 | 
				
			||||||
 | 
					      rWrite(0x08,lfoSpeed);
 | 
				
			||||||
 | 
					      rWrite(0x09,lfoMode);
 | 
				
			||||||
      break;
 | 
					      break;
 | 
				
			||||||
    case DIV_CMD_NOTE_PORTA: {
 | 
					    case DIV_CMD_NOTE_PORTA: {
 | 
				
			||||||
      int destFreq=NOTE_PERIODIC(c.value2);
 | 
					      int destFreq=NOTE_PERIODIC(c.value2);
 | 
				
			||||||
| 
						 | 
					@ -394,9 +398,14 @@ void DivPlatformPCE::reset() {
 | 
				
			||||||
  cycles=0;
 | 
					  cycles=0;
 | 
				
			||||||
  curChan=-1;
 | 
					  curChan=-1;
 | 
				
			||||||
  sampleBank=0;
 | 
					  sampleBank=0;
 | 
				
			||||||
 | 
					  lfoMode=0x80;
 | 
				
			||||||
 | 
					  lfoSpeed=255;
 | 
				
			||||||
  // set global volume
 | 
					  // set global volume
 | 
				
			||||||
  rWrite(0,0);
 | 
					  rWrite(0,0);
 | 
				
			||||||
  rWrite(0x01,0xff);
 | 
					  rWrite(0x01,0xff);
 | 
				
			||||||
 | 
					  // set LFO
 | 
				
			||||||
 | 
					  rWrite(0x08,lfoSpeed);
 | 
				
			||||||
 | 
					  rWrite(0x09,lfoMode);
 | 
				
			||||||
  // set per-channel initial panning
 | 
					  // set per-channel initial panning
 | 
				
			||||||
  for (int i=0; i<6; i++) {
 | 
					  for (int i=0; i<6; i++) {
 | 
				
			||||||
    chWrite(i,0x05,isMuted[i]?0:chan[i].pan);
 | 
					    chWrite(i,0x05,isMuted[i]?0:chan[i].pan);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -53,7 +53,7 @@ class DivPlatformPCE: public DivDispatch {
 | 
				
			||||||
  int cycles, curChan, delay;
 | 
					  int cycles, curChan, delay;
 | 
				
			||||||
  int tempL[32];
 | 
					  int tempL[32];
 | 
				
			||||||
  int tempR[32];
 | 
					  int tempR[32];
 | 
				
			||||||
  unsigned char sampleBank;
 | 
					  unsigned char sampleBank, lfoMode, lfoSpeed;
 | 
				
			||||||
  PCE_PSG* pce;
 | 
					  PCE_PSG* pce;
 | 
				
			||||||
  void updateWave(int ch);
 | 
					  void updateWave(int ch);
 | 
				
			||||||
  friend void putDispatchChan(void*,int,int);
 | 
					  friend void putDispatchChan(void*,int,int);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue