summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/citra/CMakeLists.txt5
-rw-r--r--src/citra/citra.cpp40
-rw-r--r--src/core/hle/kernel/kernel.h1
3 files changed, 43 insertions, 3 deletions
diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt
index 5e8cbfa35..918687312 100644
--- a/src/citra/CMakeLists.txt
+++ b/src/citra/CMakeLists.txt
@@ -16,8 +16,11 @@ create_directory_groups(${SRCS} ${HEADERS})
16add_executable(citra ${SRCS} ${HEADERS}) 16add_executable(citra ${SRCS} ${HEADERS})
17target_link_libraries(citra core common video_core) 17target_link_libraries(citra core common video_core)
18target_link_libraries(citra ${GLFW_LIBRARIES} ${OPENGL_gl_LIBRARY} inih) 18target_link_libraries(citra ${GLFW_LIBRARIES} ${OPENGL_gl_LIBRARY} inih)
19if (MSVC)
20 target_link_libraries(citra getopt)
21endif()
19target_link_libraries(citra ${PLATFORM_LIBRARIES}) 22target_link_libraries(citra ${PLATFORM_LIBRARIES})
20 23
21if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD|NetBSD") 24if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD|OpenBSD|NetBSD")
22 install(TARGETS citra RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") 25 install(TARGETS citra RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
23endif() 26endif() \ No newline at end of file
diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp
index a59726c78..182646f4c 100644
--- a/src/citra/citra.cpp
+++ b/src/citra/citra.cpp
@@ -3,6 +3,15 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <string> 5#include <string>
6#include <thread>
7#include <iostream>
8
9#ifdef _MSC_VER
10#include <getopt.h>
11#else
12#include <unistd.h>
13#include <getopt.h>
14#endif
6 15
7#include "common/logging/log.h" 16#include "common/logging/log.h"
8#include "common/logging/backend.h" 17#include "common/logging/backend.h"
@@ -18,12 +27,39 @@
18 27
19#include "video_core/video_core.h" 28#include "video_core/video_core.h"
20 29
30
31static void PrintHelp()
32{
33 std::cout << "Usage: citra <filename>" << std::endl;
34}
35
21/// Application entry point 36/// Application entry point
22int main(int argc, char **argv) { 37int main(int argc, char **argv) {
38 int option_index = 0;
39 std::string boot_filename;
40 static struct option long_options[] = {
41 { "help", no_argument, 0, 'h' },
42 { 0, 0, 0, 0 }
43 };
44
45 while (optind < argc) {
46 char arg = getopt_long(argc, argv, ":h", long_options, &option_index);
47 if (arg != -1) {
48 switch (arg) {
49 case 'h':
50 PrintHelp();
51 return 0;
52 }
53 } else {
54 boot_filename = argv[optind];
55 optind++;
56 }
57 }
58
23 Log::Filter log_filter(Log::Level::Debug); 59 Log::Filter log_filter(Log::Level::Debug);
24 Log::SetFilter(&log_filter); 60 Log::SetFilter(&log_filter);
25 61
26 if (argc < 2) { 62 if (boot_filename.empty()) {
27 LOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified"); 63 LOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified");
28 return -1; 64 return -1;
29 } 65 }
@@ -31,7 +67,7 @@ int main(int argc, char **argv) {
31 Config config; 67 Config config;
32 log_filter.ParseFilterString(Settings::values.log_filter); 68 log_filter.ParseFilterString(Settings::values.log_filter);
33 69
34 std::string boot_filename = argv[1]; 70
35 EmuWindow_GLFW* emu_window = new EmuWindow_GLFW; 71 EmuWindow_GLFW* emu_window = new EmuWindow_GLFW;
36 72
37 VideoCore::g_hw_renderer_enabled = Settings::values.use_hw_renderer; 73 VideoCore::g_hw_renderer_enabled = Settings::values.use_hw_renderer;
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h
index 4c4486c19..4d4276f7a 100644
--- a/src/core/hle/kernel/kernel.h
+++ b/src/core/hle/kernel/kernel.h
@@ -86,6 +86,7 @@ public:
86 case HandleType::Process: 86 case HandleType::Process:
87 case HandleType::AddressArbiter: 87 case HandleType::AddressArbiter:
88 case HandleType::ResourceLimit: 88 case HandleType::ResourceLimit:
89 case HandleType::CodeSet:
89 return false; 90 return false;
90 } 91 }
91 } 92 }