(c)  Copyright 1989 Commodore-Amiga, Inc.   All rights reserved.
The information contained herein is subject to change without notice, and 
is provided "as is" without warranty of any kind, either expressed or implied.  
The entire risk as to the use of this information is assumed by the user.


#define NTSC_CLOCK (3579545)
#define PAL_CLOCK  (3546895)

ULONG clock, clockx100, periodx10, period, hertzx10, sampleBytes;

/* Check GfxBase->DisplayFlags and set clock to appropriate value
 * Set hertzx10 to 10 * desired frequency in hertz
 * Set sampleBytes to number of bytes in the one cycle waveform sample
 */

clockx100 = 100 * clock;
periodx10 = (clockx100 / hertzx10) / sampleBytes;
/* round off */
period = (periodx10 + 5) / 10;

     

