citra.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2
  3. // Refer to the license.txt file included.
  4. #include "common/common.h"
  5. #include "common/log_manager.h"
  6. #include "core/settings.h"
  7. #include "core/system.h"
  8. #include "core/core.h"
  9. #include "core/loader/loader.h"
  10. #include "citra/config.h"
  11. #include "citra/emu_window/emu_window_glfw.h"
  12. /// Application entry point
  13. int __cdecl main(int argc, char **argv) {
  14. LogManager::Init();
  15. if (argc < 2) {
  16. ERROR_LOG(BOOT, "Failed to load ROM: No ROM specified");
  17. return -1;
  18. }
  19. Config config;
  20. if (!Settings::values.enable_log)
  21. LogManager::Shutdown();
  22. std::string boot_filename = argv[1];
  23. EmuWindow_GLFW* emu_window = new EmuWindow_GLFW;
  24. System::Init(emu_window);
  25. Loader::ResultStatus load_result = Loader::LoadFile(boot_filename);
  26. if (Loader::ResultStatus::Success != load_result) {
  27. ERROR_LOG(BOOT, "Failed to load ROM (Error %i)!", load_result);
  28. return -1;
  29. }
  30. while (emu_window->IsOpen()) {
  31. Core::RunLoop();
  32. }
  33. delete emu_window;
  34. return 0;
  35. }