i'm trying to init the ym2612 w/a clock of 7670448 and a rate of 1.0 (i want the core to run at 1x speed, so i assume this would do it). having basically copied eke's work piece by piece, my YM2612Init sets OPN.ST.clock to the clock above and OPN.ST.rate to the rate above, then calls OPNSetPres(144) (6 fm channels * 24 fm clocks; i'll abstract these to variables later); BUT the problem i'm having lies in OPNSetPres, and at the same time init_timetables.
so OPNSetPres calculates freqbase as the following:
Code: Select all
double freqbase = ym2612.OPN.ST.clock/ym2612.OPN.ST.rate/pres;
Code: Select all
if (config.hq_fm) freqbase = 1.0;
BUT WHAT IS freqbase SUPPOSED TO BE???
is it a ratio (which would validate the hi-quality toggle's usage) or is it supposed to be the absolute frequency (which would validate the 53267)? or maybe i passed the wrong value as rate? if i leave freqbase as 53267, things run entirely too slow and the timetables have insanely large values (and so do the EG timer, timer_add, and timer_overflow) as a result of the *freqbase*(1<<(FREQ_SH-10)) portion of calculation, but if i normalize it to a ratio of 53267 (making it 1.0), i'm not positive the timetables are generated correctly, but things run at an acceptable speed and generate no output.
i must be misunderstanding the table generation portion of the code or something; please help!