Fine tune autoturn algorithm a bit. Let's hope games are smart enough to turn the keys off if they don't use the adlib anymore. (ripsaw)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3501
This commit is contained in:
parent
c4053d3d98
commit
e0f2a469db
1 changed files with 4 additions and 1 deletions
|
@ -549,7 +549,10 @@ static void OPL_CallBack(Bitu len) {
|
|||
module->handler->Generate( module->mixerChan, len );
|
||||
//Disable the sound generation after 30 seconds of silence
|
||||
if ((PIC_Ticks - module->lastUsed) > 30000) {
|
||||
module->mixerChan->Enable(false);
|
||||
Bitu i;
|
||||
for (i=0xb0;i<0xb9;i++) if (module->cache[i]&0x20||module->cache[i+0x100]&0x20) break;
|
||||
if (i==0xb9) module->mixerChan->Enable(false);
|
||||
else module->lastUsed = PIC_Ticks;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue