* General WinUAE fixes, 11-Sep-1998 * Author: Mathias Ortmann Changes (both mere bugfixes and conceptual modifications) to the core WinUAE code are described below. 1. Sound Sound output has always been one of WinUAE's Achilles' heels. Neither of the official Win32 sound APIs (waveOut and DirectSound) make it particularly easy to output a contiguous stream of sound data with a reasonably low latency. In WinUAE 0.6.9, I implemented a hack that worked surprisingly well for the majority of the existing sound card/driver combinations. Although not quite within the legal bounds of the official API documentation, it would provide acceptable latency in the range of 100 to 200 ms at a very low CPU overhead. A small bug in the 0.7.x and 0.8.x WinUAE releases prevented that hack from operating correctly, which I fixed in this release. If you have a sufficiently fast machine, you are invited to beta test the new old sound code. Some things to be aware of: * If your machine is too slow or the CPU is too loaded, sound will not simply stop playing, but loop/scratch. It should, however, recover quickly as WinUAE receives enough CPU time again. * Due to the low latency, actions that halt the emulation for extended periods of time (50+ ms) will inevitably cause audible problems. This currently includes many larger Picasso96 operations. * If you have a fast machine and don't get proper sound even when disabling frame refresh using Scroll Lock, this feature is probably not compatible with your sound card/driver. Please email me in this case, stating your CPU/clock speed, operating system, type of sound card and driver version. NEW: An additional "delta" parameter (you must specify sound prefs as -S level:stereo:bits:rate:0:delta) can fix such problems. Try 1000 and 2000. You can also specify negative values to reduce latency even more. On my machine, I can go as low as -2000. Just experiment a little. * Make sure that you are using the latest driver for your sound card, particularly if you are using a SoundBlaster card (any type) under Windows NT. The latest Creative Labs drivers (August 1998) work fine. Older versions may have problems. The following sound cards are known to be compatible: - SoundBlaster AWE32 and AWE64/AWE64Gold - Ensoniq AudioPCI - Terratec EWS64 series - YAMAHA OPL3-SAx Sound System (requires a delta value of at least 800) If you have a card not listed here, please email me with your results. 2. CPU Timing Since running without the frame rate hack does not make sense in real life, it is now enabled for all -w settings. If you really want to disable it (e.g. for benchmarking purposes), you can do so by using -S -1. The two important -w settings are: -w -1 ... run the emulated M68K at maximum speed -w 0 .... try to maintain original Amiga CPU speed (roughly 68000/7) Higher values can help with certain timing-induced incompatibilities, but are usually not very useful on current PCs. UAE now attempts to be a "system-friendly" application. If the emulated M68K is idle, CPU usage will decrease to around 20% of a 300 MHz PII with sound enabled, or as little as 10% with sound disabled. This feature is in a highly experimental stage. If you notice any unusual phenomena, please notify me. History ======= 980911 - Windows 95 doesn't support TIME_CALLBACK_EVENT_SET in timeSetEvent(). Fixed. - Implemented delta parameter for waveout_looping sound output to adjust latency/fix driver problems. -S parameter format is now: -S level:stereo:bits:rate:0:delta If your sound is scratchy, try values of 1000 or 2000 for the delta parameter. 980907 - CPU usage reduction when emulated M68K is idle - Reverted default priority class to NORMAL - Removed -w 0 CPU speed halving 980906 - Made 68000/7 speed independent of the sound setting 980905 - Until windowed Picasso96 supports clipping, P96 windows are opened with WS_EX_TOPMOST. This is intended as a stop-gap measure to reduce display thrashing. 980904 - Sanitized m68k_speed/frame rate hack logic - Re-introduced -S -1 setting for disabling frame rate hack - Fixed stereo-related waveout_looping bug. Made waveout_looping the default sound output mode - Fixed ADZ decompression - Fixed CPU frequency measuring (clock frequency is retrieved from the registry under real operating systems) 980903 - Changed default base priority back to IDLE_PRIORITY_CLASS Open Issues =========== - pause sound output while the emulation is halted (e.g. while selecting an ADF file or using the GUI). - make dynamic frame dropping work with waveout_looping - fix drawing not to read from display memory any more when performing line doubling - fix some ancient sprite bugs - fix frozen main window while emulation is paused