Jump to navigation Jump to search


59 bytes added, 10:25, 4 January 2009
Syntax highlighing
The actual frequency produced is the 10-bit frequency divisor given by F0 to F9 divided into 1/32 of the system clock frequency (3.579 MHz) which turns out to be 111,860 Hz. Keeping all this in mind, the following is the formula for calculating the frequency:
<syntax type="C++">
f = 111860 / (((Byte2 & 0x3F) << 4) + (Byte1 & 0x0F))
Note: The order of the bytes are reversed for AGI sound data.
My program reads in the duration as a 16 bit word. It then loads the two following bytes and calculates the frequency as follows:
<syntax type="C++">
f = 111860 / (((Byte2 & 0x3F) << 4) + (Byte3 & 0x0F))
The 111860 comes from the PCjr discussion above. Note that the bytes are in the opposite order from that mentioned in the PCjr information.

Navigation menu