Virtual Boy: envelope bug status
This commit is contained in:
parent
7fbe9c01a5
commit
38e4245ee0
13 changed files with 62 additions and 1 deletions
|
|
@ -156,8 +156,9 @@ void VSU::Write(int timestamp, unsigned int A, unsigned char V)
|
|||
|
||||
WavePos[ch] = 0;
|
||||
|
||||
if(ch == 5) // Not sure if this is correct.
|
||||
if(ch == 5) { // Not sure if this is correct.
|
||||
lfsr = 1;
|
||||
}
|
||||
|
||||
EnvelopeModMask[ch] = 0;
|
||||
if(!(EnvControl[ch] & 0x200) && (
|
||||
|
|
|
|||
|
|
@ -92,10 +92,12 @@ class VSU
|
|||
int EnvelopeClockDivider[6];
|
||||
int SweepModClockDivider;
|
||||
|
||||
public:
|
||||
int EnvelopeModMask[6];
|
||||
int ModState;
|
||||
int ModLock;
|
||||
|
||||
private:
|
||||
int NoiseLatcherClockDivider;
|
||||
unsigned int NoiseLatcher;
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@
|
|||
|
||||
#include "vb.h"
|
||||
#include "../engine.h"
|
||||
#include "IconsFontAwesome4.h"
|
||||
#include "furIcons.h"
|
||||
#include <math.h>
|
||||
|
||||
//#define rWrite(a,v) pendingWrites[a]=v;
|
||||
|
|
@ -252,6 +254,27 @@ void DivPlatformVB::tick(bool sysTick) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<6; i++) {
|
||||
if ((chan[i].envHigh&3)==0) {
|
||||
chan[i].hasEnvWarning=0;
|
||||
} else {
|
||||
switch (vb->EnvelopeModMask[i]) {
|
||||
case 0: // envelope OK
|
||||
chan[i].hasEnvWarning=0;
|
||||
break;
|
||||
case 1: // envelope has finished
|
||||
chan[i].hasEnvWarning=21;
|
||||
break;
|
||||
case 2: // can't envelope
|
||||
chan[i].hasEnvWarning=22;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*if (vb->ModLock) {
|
||||
chan[4].hasEnvWarning=4;
|
||||
}*/
|
||||
}
|
||||
|
||||
int DivPlatformVB::dispatch(DivCommand c) {
|
||||
|
|
@ -477,6 +500,16 @@ unsigned short DivPlatformVB::getPan(int ch) {
|
|||
return ((chan[ch].pan&0xf0)<<4)|(chan[ch].pan&15);
|
||||
}
|
||||
|
||||
DivChannelModeHints DivPlatformVB::getModeHints(int ch) {
|
||||
DivChannelModeHints ret;
|
||||
//if (ch>4) return ret;
|
||||
ret.count=1;
|
||||
ret.hint[0]=ICON_FA_EXCLAMATION_TRIANGLE;
|
||||
ret.type[0]=chan[ch].hasEnvWarning;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
DivDispatchOscBuffer* DivPlatformVB::getOscBuffer(int ch) {
|
||||
return oscBuf[ch];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ class DivPlatformVB: public DivDispatch {
|
|||
int antiClickPeriodCount, antiClickWavePos;
|
||||
unsigned char pan, envLow, envHigh;
|
||||
bool noise, deferredWaveUpdate, intWritten;
|
||||
unsigned char hasEnvWarning;
|
||||
signed short wave;
|
||||
DivWaveSynth ws;
|
||||
Channel():
|
||||
|
|
@ -42,6 +43,7 @@ class DivPlatformVB: public DivDispatch {
|
|||
noise(false),
|
||||
deferredWaveUpdate(false),
|
||||
intWritten(false),
|
||||
hasEnvWarning(0),
|
||||
wave(-1) {}
|
||||
};
|
||||
Channel chan[6];
|
||||
|
|
@ -78,6 +80,7 @@ class DivPlatformVB: public DivDispatch {
|
|||
void* getChanState(int chan);
|
||||
DivMacroInt* getChanMacroInt(int ch);
|
||||
unsigned short getPan(int chan);
|
||||
DivChannelModeHints getModeHints(int chan);
|
||||
DivDispatchOscBuffer* getOscBuffer(int chan);
|
||||
unsigned char* getRegisterPool();
|
||||
int getRegisterPoolSize();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue