Game Boy: fix Synchronize

This commit is contained in:
tildearrow 2022-10-02 00:06:06 -05:00
parent bcc94fd459
commit 92d5525692
4 changed files with 13 additions and 0 deletions

View file

@ -313,6 +313,9 @@ void DivPlatformGB::tick(bool sysTick) {
rWrite(16+i*5+3,(2048-chan[i].freq)&0xff);
rWrite(16+i*5+4,(((2048-chan[i].freq)>>8)&7)|((chan[i].keyOn||chan[i].keyOff)?0x80:0x00)|((chan[i].soundLen<63)<<6));
}
if (enoughAlready) { // more compat garbage
rWrite(16+i*5+1,((chan[i].duty&3)<<6)|(63-(chan[i].soundLen&63)));
}
if (chan[i].keyOn) chan[i].keyOn=false;
if (chan[i].keyOff) chan[i].keyOff=false;
chan[i].freqChanged=false;
@ -645,6 +648,7 @@ void DivPlatformGB::setFlags(const DivConfig& flags) {
model=GB_MODEL_AGB;
break;
}
enoughAlready=flags.getBool("enoughAlready",false);
}
int DivPlatformGB::init(DivEngine* p, int channels, int sugRate, const DivConfig& flags) {

View file

@ -76,6 +76,7 @@ class DivPlatformGB: public DivDispatch {
DivDispatchOscBuffer* oscBuf[4];
bool isMuted[4];
bool antiClickEnabled;
bool enoughAlready;
unsigned char lastPan;
DivWaveSynth ws;
struct QueuedWrite {