> -----Original Message----- > From: Stas Sergeev [mailto:[EMAIL PROTECTED]] > Sent: Sunday, November 25, 2001 1:37 PM > To: [EMAIL PROTECTED] > Subject: RE: DMA-Sound support in dosemu > > Hello. > > "Vlad Romascanu (LMC)" wrote: > > If interrupts have been > > disabled for more than a certain amount of time (easy to > detect from within > > the emulated IRQ0 generator, maybe coupled with the CLI/STI > trap handler), > > DosEmu could force the enabling of interrupts. Then Doom > should then get > OK, after some messing around DMA code, I managed Doom to > work with sound > this way... > > > past the "Initializing timer..." lockup and work properly. > Can someone test > > that? > Tested, not good. Doom uses cli/popf not only on startup but > each time it > produces the sound. So, if the delay is 1 sec and you are > running with a > chainsaw which always produces sound, you will see a frequent pauses - > slideshow. And if the delay is reduced to several msecs, Doom > works fine > but the workaround triggers also for other apps compromissing > the stability.
Then the following variation on the 1sec trick *could* work with Doom & Co. without breaking other apps: - have a variable that remembers when (e.g. time()) and where (CS:IP/EIP) the last CLI was executed. - reset the variable whenever a or trapped equivalent (e.g. IRET?) is executed. - if interrupts have been disabled for more than one second (can also check the "when" in the CLI variable to make things simpler) then force the enabling of interrupts as done before; also replace the CLI at the stored IP (see above) with a NOP (like CLI2NOP, except that the "CLI2NOP"'ing would be, in this case, precisely targeted at the problematic CLI's and should not break other code). Does this make any sense? It should not break regular apps (which do not have the habit of staying 1 sec. with interrupts disabled), and the first time Doom screws up with CLI it would automatically patch it (so the chainsaw would sound smooth... or at least so I hope). :) Unless Doom would break because of the disappearance of the CLI. I know Doom is very tolerant of CLI2NOP, but other games (Blood 3D?) always crash with CLI2NOP (wonder if they'd work with the above trick... I suspect CLI2NOP replaces to many CLI's, but the above approach should be more conservative). Cheers, Vlad. - To unsubscribe from this list: send the line "unsubscribe linux-msdos" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
