void retro_init() { struct retro_log_callback log; if (environ_cb(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, &log)) log_cb = log.log; else log_cb = NULL; // Using uint_least32_t in an audio interface expecting you to cast to short*? :( Weird stuff. assert(sizeof(gambatte::uint_least32_t) == sizeof(uint32_t)); gb.setInputGetter(&gb_input); double fps = 4194304.0 / 70224.0; double sample_rate = fps * 35112; #ifdef CC_RESAMPLER CC_init(); if (environ_cb) { g_timing.fps = fps; g_timing.sample_rate = sample_rate / CC_DECIMATION_RATE; // ~64k } #else resampler_l = blipper_new(32, 0.85, 6.5, 64, 1024, NULL); resampler_r = blipper_new(32, 0.85, 6.5, 64, 1024, NULL); if (environ_cb) { g_timing.fps = fps; g_timing.sample_rate = sample_rate / 64; // ~32k } #endif }
LFCC LFCC_create (double tmin, double tmax, long nt, double dt, double t1, long maximumNumberOfCoefficients, double fmin, double fmax) { try { autoLFCC me = Thing_new (LFCC); CC_init (me.peek(), tmin, tmax, nt, dt, t1, maximumNumberOfCoefficients, fmin, fmax); return me.transfer(); } catch (MelderError) { Melder_throw (U"LFCC not created."); } }
class_methods_end LFCC LFCC_create (double tmin, double tmax, long nt, double dt, double t1, long maximumNumberOfCoefficients, double fmin, double fmax) { LFCC me = Thing_new (LFCC); if (! me || ! CC_init (me, tmin, tmax, nt, dt, t1, maximumNumberOfCoefficients, fmin, fmax)) forget (me); return me; }
int main(int argc, char *argv[]) { ATerm bottomOfStack; ATinit(argc, argv, &bottomOfStack); CC_init(); test_chars(); test_sets(); return 0; }