Iconoclast says (12:10 PM): *actually the DAC rate is calculated before the frequency, so a PAL game requesting 32 kHz would use an approximate DAC rate of 1551. but it could still be a different DAC rate than that even for PAL if the resulting requested frequency is different
Iconoclast says (12:11 PM): *and originally I used High School algebra to solve for the "correct" video clock numerator to divide by (DAC_rate + 1) to return 32,000 Hertz, but this only worked for games requesting just that frequency
Iconoclast says (12:12 PM): *in fact some of Nintendo's documentation suggests through the use of a function, that the game developer requests the "requested frequency" while the function returns the "actual frequency", so there is a chance that offbeat freqs like 32006 and 31995 might be correct in that context
Iconoclast says (12:14 PM): *currently, as an experiment just in case the correct behavior is to never have weird frequencies like that, I define a modulo base of fifty for rounding to the nearest frequency *from what I've seen, 50 is the greatest common factor of every requested Nintendo frequency I've seen written down, such as the min. and max. frequency limits Nintendo documented
Iconoclast says (12:15 PM): *there is another formula to calculate the frequency based on the audio bus half-period register, but it doesn't seem to be updated nearly enough as much as Nintendo says...the register is usually set to either 0 or 15, for a bitrate of 1 or 16 b/sample