private static void OPL_initalize() { int i; OPL.freqbase = (OPL.rate != 0) ? ((double)OPL.clock / 72.0) / OPL.rate : 0; OPL.TimerBase = Attotime.attotime_mul(Attotime.ATTOTIME_IN_HZ((int)OPL.clock),72); for (i = 0; i < 1024; i++) { OPL.fn_tab[i] = (uint)((double)i * 64 * OPL.freqbase * (1 << (16 - 10))); } OPL.lfo_am_inc = (uint)(0x40000 * OPL.freqbase); OPL.lfo_pm_inc = (uint)(0x4000 * OPL.freqbase); OPL.noise_f = (uint)(0x10000 * OPL.freqbase); OPL.eg_timer_add = (uint)(0x10000 * OPL.freqbase); OPL.eg_timer_overflow = 0x10000; }