citra.cpp 899 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 "common/file_util.h"
  7. #include "core/system.h"
  8. #include "core/core.h"
  9. #include "core/loader/loader.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. std::string boot_filename = argv[1];
  19. EmuWindow_GLFW* emu_window = new EmuWindow_GLFW;
  20. System::Init(emu_window);
  21. if (Loader::ResultStatus::Success != Loader::LoadFile(boot_filename)) {
  22. ERROR_LOG(BOOT, "Failed to load ROM!");
  23. return -1;
  24. }
  25. while(true) {
  26. Core::RunLoop();
  27. }
  28. delete emu_window;
  29. return 0;
  30. }