citra.cpp 991 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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/system.h"
  7. #include "core/core.h"
  8. #include "core/loader/loader.h"
  9. #include "citra/config.h"
  10. #include "citra/emu_window/emu_window_glfw.h"
  11. /// Application entry point
  12. int __cdecl main(int argc, char **argv) {
  13. LogManager::Init();
  14. if (argc < 2) {
  15. ERROR_LOG(BOOT, "Failed to load ROM: No ROM specified");
  16. return -1;
  17. }
  18. Config config;
  19. std::string boot_filename = argv[1];
  20. EmuWindow_GLFW* emu_window = new EmuWindow_GLFW;
  21. System::Init(emu_window);
  22. Loader::ResultStatus load_result = Loader::LoadFile(boot_filename);
  23. if (Loader::ResultStatus::Success != load_result) {
  24. ERROR_LOG(BOOT, "Failed to load ROM (Error %i)!", load_result);
  25. return -1;
  26. }
  27. while(true) {
  28. Core::RunLoop();
  29. }
  30. delete emu_window;
  31. return 0;
  32. }