ECL_EXPORT bool Init(bool cgb, const uint8_t *spc, int spclen) { if (spc) { GB_init_sgb(&GB); if (!sgb_init(spc, spclen)) return false; sgb = true; } else if (cgb) { GB_init_cgb(&GB); } else { GB_init(&GB); } if (GB_load_boot_rom(&GB, "boot.rom") != 0) return false; if (GB_load_rom(&GB, "game.rom") != 0) return false; GB_set_pixels_output(&GB, GBPixels); GB_set_vblank_callback(&GB, VBlankCallback); GB_set_log_callback(&GB, LogCallback); GB_set_rgb_encode_callback(&GB, RgbEncodeCallback); GB_set_infrared_callback(&GB, InfraredCallback); GB_set_rumble_callback(&GB, RumbleCallback); GB_set_sample_callback(&GB, SampleCallback); leftblip = blip_new(1024); rightblip = blip_new(1024); blip_set_rates(leftblip, sgb ? SOUND_RATE_SGB : SOUND_RATE_GB, 44100); blip_set_rates(rightblip, sgb ? SOUND_RATE_SGB : SOUND_RATE_GB, 44100); return true; }
/** * Returns a pointer to a new GeneralBuffer<LongInt> */ GBuffer GB_initLongInt(const int size) { return GB_init(size, _GB_LONG_INT); }
/** * Returns a pointer to a new GeneralBuffer<Double> */ GBuffer GB_initDouble(const int size) { return GB_init(size, _GB_DOUBLE); }