Exemplo n.º 1
0
void Init()
{
	if (s_handle != nullptr)
		return;

	if (Core::GetState() != Core::CORE_UNINITIALIZED)
	{
		if ((CoreTiming::GetTicks() - s_last_init) < SystemTimers::GetTicksPerSecond())
			return;

		s_last_init = CoreTiming::GetTicks();
	}

	s_libusb_driver_not_supported = false;

	int ret = libusb_init(&s_libusb_context);

	if (ret)
	{
		ERROR_LOG(SERIALINTERFACE, "libusb_init failed with error: %d", ret);
		Shutdown();
	}
	else
	{
		StartScanThread();
	}
}
Exemplo n.º 2
0
void Init()
{
  if (s_fd)
    return;

  if (Core::GetState() != Core::State::Uninitialized)
  {
    if ((CoreTiming::GetTicks() - s_last_init) < SystemTimers::GetTicksPerSecond())
      return;

    s_last_init = CoreTiming::GetTicks();
  }

  JNIEnv* env;
  g_java_vm->AttachCurrentThread(&env, NULL);

  jclass adapter_class = env->FindClass("org/dolphinemu/dolphinemu/utils/Java_GCAdapter");
  s_adapter_class = reinterpret_cast<jclass>(env->NewGlobalRef(adapter_class));

  if (UseAdapter())
    StartScanThread();
}