another uninitialized variable

This commit is contained in:
tildearrow 2021-12-21 16:02:31 -05:00
parent 48f4f5835b
commit 726b457ae7
12 changed files with 15 additions and 2 deletions

View file

@ -1251,6 +1251,8 @@ void DivEngine::renderSamplesP() {
} }
void DivEngine::renderSamples() { void DivEngine::renderSamples() {
sPreview.sample=-1;
sPreview.pos=0;
if (jediTable==NULL) { if (jediTable==NULL) {
jediTable=new int[16*49]; jediTable=new int[16*49];
for (int step=0; step<49; step++) { for (int step=0; step<49; step++) {
@ -1441,7 +1443,9 @@ void DivEngine::playSub(bool preserveDrift) {
if (nextTick(preserveDrift)) break; if (nextTick(preserveDrift)) break;
} }
dispatch->setSkipRegisterWrites(false); dispatch->setSkipRegisterWrites(false);
dispatch->forceIns(); if (goal>0) {
dispatch->forceIns();
}
if (preserveDrift) { if (preserveDrift) {
clockDrift=prevDrift; clockDrift=prevDrift;
} else { } else {

View file

@ -476,6 +476,7 @@ void DivPlatformArcade::setYMFM(bool use) {
int DivPlatformArcade::init(DivEngine* p, int channels, int sugRate, bool pal) { int DivPlatformArcade::init(DivEngine* p, int channels, int sugRate, bool pal) {
parent=p; parent=p;
skipRegisterWrites=false;
for (int i=0; i<13; i++) { for (int i=0; i<13; i++) {
isMuted[i]=false; isMuted[i]=false;
} }

View file

@ -326,6 +326,7 @@ void DivPlatformC64::setPAL(bool pal) {
int DivPlatformC64::init(DivEngine* p, int channels, int sugRate, bool pal) { int DivPlatformC64::init(DivEngine* p, int channels, int sugRate, bool pal) {
parent=p; parent=p;
skipRegisterWrites=false;
for (int i=0; i<3; i++) { for (int i=0; i<3; i++) {
isMuted[i]=false; isMuted[i]=false;
} }

View file

@ -74,6 +74,7 @@ void DivPlatformDummy::reset() {
int DivPlatformDummy::init(DivEngine* p, int channels, int sugRate, bool pal) { int DivPlatformDummy::init(DivEngine* p, int channels, int sugRate, bool pal) {
parent=p; parent=p;
skipRegisterWrites=false;
for (int i=0; i<17; i++) { for (int i=0; i<17; i++) {
isMuted[i]=false; isMuted[i]=false;
} }

View file

@ -317,6 +317,7 @@ int DivPlatformGB::init(DivEngine* p, int channels, int sugRate, bool pal) {
isMuted[i]=false; isMuted[i]=false;
} }
parent=p; parent=p;
skipRegisterWrites=false;
rate=262144; rate=262144;
gb=new GB_gameboy_t; gb=new GB_gameboy_t;
reset(); reset();

View file

@ -432,6 +432,7 @@ void DivPlatformGenesis::setPAL(bool pal) {
int DivPlatformGenesis::init(DivEngine* p, int channels, int sugRate, bool pal) { int DivPlatformGenesis::init(DivEngine* p, int channels, int sugRate, bool pal) {
parent=p; parent=p;
skipRegisterWrites=false;
for (int i=0; i<10; i++) { for (int i=0; i<10; i++) {
isMuted[i]=false; isMuted[i]=false;
} }

View file

@ -327,6 +327,7 @@ void DivPlatformNES::setPAL(bool pal) {
int DivPlatformNES::init(DivEngine* p, int channels, int sugRate, bool pal) { int DivPlatformNES::init(DivEngine* p, int channels, int sugRate, bool pal) {
parent=p; parent=p;
skipRegisterWrites=false;
for (int i=0; i<5; i++) { for (int i=0; i<5; i++) {
isMuted[i]=false; isMuted[i]=false;
} }

View file

@ -37,7 +37,6 @@ class DivPlatformNES: public DivDispatch {
unsigned int dacPos; unsigned int dacPos;
int dacSample; int dacSample;
unsigned char sampleBank; unsigned char sampleBank;
unsigned char lastPan;
float freqBase; float freqBase;

View file

@ -318,6 +318,7 @@ void DivPlatformPCE::setPAL(bool pal) {
int DivPlatformPCE::init(DivEngine* p, int channels, int sugRate, bool pal) { int DivPlatformPCE::init(DivEngine* p, int channels, int sugRate, bool pal) {
parent=p; parent=p;
skipRegisterWrites=false;
for (int i=0; i<6; i++) { for (int i=0; i<6; i++) {
isMuted[i]=false; isMuted[i]=false;
} }

View file

@ -187,6 +187,7 @@ void DivPlatformSMS::setPAL(bool pal) {
int DivPlatformSMS::init(DivEngine* p, int channels, int sugRate, bool pal) { int DivPlatformSMS::init(DivEngine* p, int channels, int sugRate, bool pal) {
parent=p; parent=p;
skipRegisterWrites=false;
for (int i=0; i<4; i++) { for (int i=0; i<4; i++) {
isMuted[i]=false; isMuted[i]=false;
} }

View file

@ -565,6 +565,7 @@ bool DivPlatformYM2610::keyOffAffectsArp(int ch) {
int DivPlatformYM2610::init(DivEngine* p, int channels, int sugRate, bool pal) { int DivPlatformYM2610::init(DivEngine* p, int channels, int sugRate, bool pal) {
parent=p; parent=p;
skipRegisterWrites=false;
for (int i=0; i<13; i++) { for (int i=0; i<13; i++) {
isMuted[i]=false; isMuted[i]=false;
} }

View file

@ -816,6 +816,7 @@ void DivEngine::nextBuf(float** in, float** out, int inChans, int outChans, unsi
} else { } else {
temp[2]=s->rendData[sPreview.pos++]; temp[2]=s->rendData[sPreview.pos++];
} }
if (s->depth==8) temp[2]<<=8;
blip_add_delta(bb[2],i,temp[2]-prevSample[2]); blip_add_delta(bb[2],i,temp[2]-prevSample[2]);
prevSample[2]=temp[2]; prevSample[2]=temp[2];
} }