diff options
Diffstat (limited to 'src/citra')
-rw-r--r-- | src/citra/CMakeLists.txt | 11 | ||||
-rw-r--r-- | src/citra/citra.cpp | 40 | ||||
-rw-r--r-- | src/citra/citra.rc | 2 | ||||
-rw-r--r-- | src/citra/emu_window/emu_window_sdl2.cpp | 2 | ||||
-rw-r--r-- | src/citra/emu_window/emu_window_sdl2.h | 2 |
5 files changed, 23 insertions, 34 deletions
diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt index f9c488a1a..ecb5d2dfe 100644 --- a/src/citra/CMakeLists.txt +++ b/src/citra/CMakeLists.txt @@ -1,3 +1,5 @@ +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) + set(SRCS emu_window/emu_window_sdl2.cpp citra.cpp @@ -28,11 +30,6 @@ if(UNIX AND NOT APPLE) endif() if (MSVC) - include(WindowsCopyFiles) - - set(DLL_DEST "${CMAKE_BINARY_DIR}/bin/$<CONFIG>/") - - windows_copy_files(citra ${SDL2_DLL_DIR} ${DLL_DEST} SDL2.dll) - - unset(DLL_DEST) + include(CopyCitraSDLDeps) + copy_citra_SDL_deps(citra) endif() diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index f9387e61c..99c096ac7 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp @@ -18,7 +18,7 @@ #endif #ifdef _WIN32 -#include <Windows.h> +#include <windows.h> #endif #include "citra/config.h" @@ -33,7 +33,6 @@ #include "core/gdbstub/gdbstub.h" #include "core/loader/loader.h" #include "core/settings.h" -#include "core/system.h" #include "video_core/video_core.h" static void PrintHelp(const char* argv0) { @@ -64,7 +63,7 @@ int main(int argc, char** argv) { return -1; } #endif - std::string boot_filename; + std::string filepath; static struct option long_options[] = { {"gdbport", required_argument, 0, 'g'}, @@ -97,9 +96,9 @@ int main(int argc, char** argv) { } } else { #ifdef _WIN32 - boot_filename = Common::UTF16ToUTF8(argv_w[optind]); + filepath = Common::UTF16ToUTF8(argv_w[optind]); #else - boot_filename = argv[optind]; + filepath = argv[optind]; #endif optind++; } @@ -115,7 +114,7 @@ int main(int argc, char** argv) { MicroProfileOnThreadCreate("EmuThread"); SCOPE_EXIT({ MicroProfileShutdown(); }); - if (boot_filename.empty()) { + if (filepath.empty()) { LOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified"); return -1; } @@ -127,32 +126,25 @@ int main(int argc, char** argv) { Settings::values.use_gdbstub = use_gdbstub; Settings::Apply(); - std::unique_ptr<EmuWindow_SDL2> emu_window = std::make_unique<EmuWindow_SDL2>(); + std::unique_ptr<EmuWindow_SDL2> emu_window{std::make_unique<EmuWindow_SDL2>()}; - std::unique_ptr<Loader::AppLoader> loader = Loader::GetLoader(boot_filename); - if (!loader) { - LOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", boot_filename.c_str()); - return -1; - } - - boost::optional<u32> system_mode = loader->LoadKernelSystemMode(); + Core::System& system{Core::System::GetInstance()}; - if (!system_mode) { - LOG_CRITICAL(Frontend, "Failed to load ROM (Could not determine system mode)!"); - return -1; - } + SCOPE_EXIT({ system.Shutdown(); }); - System::Init(emu_window.get(), system_mode.get()); - SCOPE_EXIT({ System::Shutdown(); }); + const Core::System::ResultStatus load_result{system.Load(emu_window.get(), filepath)}; - Loader::ResultStatus load_result = loader->Load(); - if (Loader::ResultStatus::Success != load_result) { - LOG_CRITICAL(Frontend, "Failed to load ROM (Error %i)!", load_result); + switch (load_result) { + case Core::System::ResultStatus::ErrorGetLoader: + LOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", filepath.c_str()); + return -1; + case Core::System::ResultStatus::ErrorLoader: + LOG_CRITICAL(Frontend, "Failed to load ROM!"); return -1; } while (emu_window->IsOpen()) { - Core::RunLoop(); + system.RunLoop(); } return 0; diff --git a/src/citra/citra.rc b/src/citra/citra.rc index b0edb2e6b..fea603004 100644 --- a/src/citra/citra.rc +++ b/src/citra/citra.rc @@ -5,5 +5,5 @@ // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -GLFW_ICON ICON "..\\..\\dist\\citra.ico" +CITRA_ICON ICON "../../dist/citra.ico" diff --git a/src/citra/emu_window/emu_window_sdl2.cpp b/src/citra/emu_window/emu_window_sdl2.cpp index 8abe48984..b0d82b670 100644 --- a/src/citra/emu_window/emu_window_sdl2.cpp +++ b/src/citra/emu_window/emu_window_sdl2.cpp @@ -9,10 +9,10 @@ #include <SDL.h> #include <glad/glad.h> #include "citra/emu_window/emu_window_sdl2.h" -#include "common/key_map.h" #include "common/logging/log.h" #include "common/scm_rev.h" #include "common/string_util.h" +#include "core/frontend/key_map.h" #include "core/hle/service/hid/hid.h" #include "core/settings.h" #include "video_core/video_core.h" diff --git a/src/citra/emu_window/emu_window_sdl2.h b/src/citra/emu_window/emu_window_sdl2.h index e4d14ef12..c8cd919c6 100644 --- a/src/citra/emu_window/emu_window_sdl2.h +++ b/src/citra/emu_window/emu_window_sdl2.h @@ -5,7 +5,7 @@ #pragma once #include <utility> -#include "common/emu_window.h" +#include "core/frontend/emu_window.h" struct SDL_Window; |