mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-27 06:53:01 +00:00
OPL/OPNA/OPNB: fix ADPCM-B freq not being clamped
This commit is contained in:
parent
8d365a2faf
commit
bb4de6fcb0
4 changed files with 8 additions and 0 deletions
|
@ -549,6 +549,8 @@ void DivPlatformOPL::tick(bool sysTick) {
|
|||
chan[adpcmChan].freq=5461; // 4KHz
|
||||
}
|
||||
}
|
||||
if (chan[adpcmChan].freq<0) chan[adpcmChan].freq=0;
|
||||
if (chan[adpcmChan].freq>65535) chan[adpcmChan].freq=65535;
|
||||
immWrite(16,chan[adpcmChan].freq&0xff);
|
||||
immWrite(17,(chan[adpcmChan].freq>>8)&0xff);
|
||||
if (chan[adpcmChan].keyOn || chan[adpcmChan].keyOff) {
|
||||
|
|
|
@ -783,6 +783,8 @@ void DivPlatformYM2608::tick(bool sysTick) {
|
|||
chan[15].freq=0;
|
||||
}
|
||||
}
|
||||
if (chan[adpcmBChanOffs].freq<0) chan[adpcmBChanOffs].freq=0;
|
||||
if (chan[adpcmBChanOffs].freq>65535) chan[adpcmBChanOffs].freq=65535;
|
||||
immWrite(0x109,chan[15].freq&0xff);
|
||||
immWrite(0x10a,(chan[15].freq>>8)&0xff);
|
||||
hardResetElapsed+=2;
|
||||
|
|
|
@ -717,6 +717,8 @@ void DivPlatformYM2610::tick(bool sysTick) {
|
|||
} else {
|
||||
chan[adpcmBChanOffs].freq=0;
|
||||
}
|
||||
if (chan[adpcmBChanOffs].freq<0) chan[adpcmBChanOffs].freq=0;
|
||||
if (chan[adpcmBChanOffs].freq>65535) chan[adpcmBChanOffs].freq=65535;
|
||||
immWrite(0x19,chan[adpcmBChanOffs].freq&0xff);
|
||||
immWrite(0x1a,(chan[adpcmBChanOffs].freq>>8)&0xff);
|
||||
hardResetElapsed+=2;
|
||||
|
|
|
@ -784,6 +784,8 @@ void DivPlatformYM2610B::tick(bool sysTick) {
|
|||
} else {
|
||||
chan[adpcmBChanOffs].freq=0;
|
||||
}
|
||||
if (chan[adpcmBChanOffs].freq<0) chan[adpcmBChanOffs].freq=0;
|
||||
if (chan[adpcmBChanOffs].freq>65535) chan[adpcmBChanOffs].freq=65535;
|
||||
immWrite(0x19,chan[adpcmBChanOffs].freq&0xff);
|
||||
immWrite(0x1a,(chan[adpcmBChanOffs].freq>>8)&0xff);
|
||||
hardResetElapsed+=2;
|
||||
|
|
Loading…
Reference in a new issue