GilbertClaus commited on
Commit
034d0a2
·
1 Parent(s): 5bd88c4

Tambah Data

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. Releases/Citra/android.zip +3 -0
  2. Releases/Citra/linux.zip +3 -0
  3. Releases/Citra/macos.zip +3 -0
  4. Releases/Citra/source-code.tar.gz +3 -0
  5. Releases/Citra/source-code.zip +3 -0
  6. Releases/Citra/unified.zip +3 -0
  7. Releases/Citra/windows.zip +3 -0
  8. Source Code/Citra/CMakeLists.txt +485 -0
  9. Source Code/Citra/CMakeModules/AndroidNdkModules.cmake +58 -0
  10. Source Code/Citra/CMakeModules/BuildInstaller.cmake +26 -0
  11. Source Code/Citra/CMakeModules/BundleTarget.cmake +374 -0
  12. Source Code/Citra/CMakeModules/DownloadExternals.cmake +198 -0
  13. Source Code/Citra/CMakeModules/GenerateBuildInfo.cmake +65 -0
  14. Source Code/Citra/CMakeModules/GenerateSCMRev.cmake +44 -0
  15. Source Code/Citra/CMakeModules/aqt_config.ini +29 -0
  16. Source Code/Citra/CONTRIBUTING.md +1 -0
  17. Source Code/Citra/Doxyfile +0 -0
  18. Source Code/Citra/README.md +36 -0
  19. Source Code/Citra/dist/apple/Info.plist.in +84 -0
  20. Source Code/Citra/dist/apple/LaunchScreen.storyboard +42 -0
  21. Source Code/Citra/dist/apple/citra.icns +0 -0
  22. Source Code/Citra/dist/apple/launch_logo.png +0 -0
  23. Source Code/Citra/dist/citra-qt.6 +40 -0
  24. Source Code/Citra/dist/citra-qt.desktop +15 -0
  25. Source Code/Citra/dist/citra-room.desktop +10 -0
  26. Source Code/Citra/dist/citra.6 +49 -0
  27. Source Code/Citra/dist/citra.desktop +15 -0
  28. Source Code/Citra/dist/citra.ico +0 -0
  29. Source Code/Citra/dist/citra.manifest +58 -0
  30. Source Code/Citra/dist/citra.svg +2 -0
  31. Source Code/Citra/dist/citra.xml +59 -0
  32. Source Code/Citra/dist/compatibility_list/compatibility_list.qrc +5 -0
  33. Source Code/Citra/dist/doc-icon.png +0 -0
  34. Source Code/Citra/dist/dumpkeys/DumpKeys.gm9 +299 -0
  35. Source Code/Citra/dist/dumpkeys/README.md +10 -0
  36. Source Code/Citra/dist/icon.png +0 -0
  37. Source Code/Citra/dist/installer/CMakeLists.txt +31 -0
  38. Source Code/Citra/dist/installer/README.md +9 -0
  39. Source Code/Citra/dist/installer/config/config_linux.xml +19 -0
  40. Source Code/Citra/dist/installer/config/config_mac.xml +18 -0
  41. Source Code/Citra/dist/installer/config/config_windows.xml +19 -0
  42. Source Code/Citra/dist/installer/config/icon.icns +0 -0
  43. Source Code/Citra/dist/installer/config/icon.ico +0 -0
  44. Source Code/Citra/dist/installer/config/icon.png +0 -0
  45. Source Code/Citra/dist/languages/.gitignore +3 -0
  46. Source Code/Citra/dist/languages/.tx/config +14 -0
  47. Source Code/Citra/dist/languages/README.md +1 -0
  48. Source Code/Citra/dist/languages/da_DK.ts +0 -0
  49. Source Code/Citra/dist/languages/de.ts +0 -0
  50. Source Code/Citra/dist/languages/el.ts +0 -0
Releases/Citra/android.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:af731e4d9756e3ad081f6e69685088eb6ea1cf611c7c57161e5c89bf458e02fe
3
+ size 181428024
Releases/Citra/linux.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a22aea34de89bd38f2796fc115c2c1716d48f750ff0ba05581f25fc68254c4d8
3
+ size 116882108
Releases/Citra/macos.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:370e12ac91b0edc0140ab9839fcecb7ececf2e42f2e134f4048379f5747116f1
3
+ size 151374726
Releases/Citra/source-code.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fc16e1474e7c7d0ca20a9b3861d17889698b99afd40a0e553dee34911392c244
3
+ size 7986303
Releases/Citra/source-code.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1393c47bb4292f134d5a67fbc88e28bb55d9f139e439234d14b8f714f484e6c3
3
+ size 9001010
Releases/Citra/unified.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ed1c72e5a187dd188d0c77b4fef3930111089871cf974730e11ccec413630120
3
+ size 37330457
Releases/Citra/windows.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5d0751691f476b059e1b2f84c5f2f20fc556680cd84de04d1b0d8fe344886614
3
+ size 146000007
Source Code/Citra/CMakeLists.txt ADDED
@@ -0,0 +1,485 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CMake 3.12 required for 20 to be a valid value for CXX_STANDARD
2
+ cmake_minimum_required(VERSION 3.15)
3
+
4
+ # Don't override the warning flags in MSVC:
5
+ cmake_policy(SET CMP0092 NEW)
6
+ # Enforce new LTO setting
7
+ cmake_policy(SET CMP0069 NEW)
8
+ # Honor visibility properties for all targets
9
+ # Set the default so subdirectory cmake_minimum_required calls won't unset the policy.
10
+ cmake_policy(SET CMP0063 NEW)
11
+ set(CMAKE_POLICY_DEFAULT_CMP0063 NEW)
12
+
13
+ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
14
+ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules")
15
+ include(DownloadExternals)
16
+ include(CMakeDependentOption)
17
+
18
+ project(citra LANGUAGES C CXX ASM)
19
+
20
+ # Some submodules like to pick their own default build type if not specified.
21
+ # Make sure we default to Release build type always, unless the generator has custom types.
22
+ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
23
+ set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE)
24
+ endif()
25
+
26
+ if (APPLE)
27
+ # Silence warnings on empty objects, for example when platform-specific code is #ifdef'd out.
28
+ set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
29
+ set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> Scr <TARGET> <LINK_FLAGS> <OBJECTS>")
30
+ set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
31
+ set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> -no_warning_for_no_symbols -c <TARGET>")
32
+
33
+ if (IOS)
34
+ # Minimum iOS 14
35
+ set(CMAKE_OSX_DEPLOYMENT_TARGET "14.0")
36
+
37
+ # Enable searching CMAKE_PREFIX_PATH for bundled dependencies.
38
+ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
39
+ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
40
+ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)
41
+ else()
42
+ # Minimum macOS 11
43
+ set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0")
44
+ endif()
45
+ endif()
46
+
47
+ if (CMAKE_BUILD_TYPE STREQUAL Debug)
48
+ set(IS_DEBUG_BUILD ON)
49
+ set(IS_RELEASE_BUILD OFF)
50
+ else()
51
+ set(IS_DEBUG_BUILD OFF)
52
+ set(IS_RELEASE_BUILD ON)
53
+ endif()
54
+
55
+ # LTO takes too much memory and time using MSVC.
56
+ if (NOT MSVC AND IS_RELEASE_BUILD)
57
+ set(DEFAULT_ENABLE_LTO ON)
58
+ else()
59
+ set(DEFAULT_ENABLE_LTO OFF)
60
+ endif()
61
+
62
+ option(ENABLE_SDL2 "Enable using SDL2" ON)
63
+ CMAKE_DEPENDENT_OPTION(ENABLE_SDL2_FRONTEND "Enable the SDL2 frontend" ON "ENABLE_SDL2;NOT ANDROID AND NOT IOS" OFF)
64
+ option(USE_SYSTEM_SDL2 "Use the system SDL2 lib (instead of the bundled one)" OFF)
65
+
66
+ # Set bundled qt as dependent options.
67
+ option(ENABLE_QT "Enable the Qt frontend" ON)
68
+ option(ENABLE_QT_TRANSLATION "Enable translations for the Qt frontend" OFF)
69
+ CMAKE_DEPENDENT_OPTION(ENABLE_QT_UPDATER "Enable built-in updater for the Qt frontend" ON "NOT IOS" OFF)
70
+
71
+ CMAKE_DEPENDENT_OPTION(ENABLE_TESTS "Enable generating tests executable" ON "NOT IOS" OFF)
72
+ CMAKE_DEPENDENT_OPTION(ENABLE_DEDICATED_ROOM "Enable generating dedicated room executable" ON "NOT ANDROID AND NOT IOS" OFF)
73
+
74
+ option(ENABLE_WEB_SERVICE "Enable web services (telemetry, etc.)" ON)
75
+ option(ENABLE_SCRIPTING "Enable RPC server for scripting" ON)
76
+
77
+ CMAKE_DEPENDENT_OPTION(ENABLE_CUBEB "Enables the cubeb audio backend" ON "NOT IOS" OFF)
78
+ option(ENABLE_OPENAL "Enables the OpenAL audio backend" ON)
79
+
80
+ CMAKE_DEPENDENT_OPTION(ENABLE_LIBUSB "Enable libusb for GameCube Adapter support" ON "NOT IOS" OFF)
81
+
82
+ CMAKE_DEPENDENT_OPTION(ENABLE_SOFTWARE_RENDERER "Enables the software renderer" ON "NOT ANDROID" OFF)
83
+ CMAKE_DEPENDENT_OPTION(ENABLE_OPENGL "Enables the OpenGL renderer" ON "NOT APPLE" OFF)
84
+ option(ENABLE_VULKAN "Enables the Vulkan renderer" ON)
85
+
86
+ option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF)
87
+
88
+ # Compile options
89
+ CMAKE_DEPENDENT_OPTION(COMPILE_WITH_DWARF "Add DWARF debugging information" ${IS_DEBUG_BUILD} "MINGW" OFF)
90
+ option(ENABLE_LTO "Enable link time optimization" ${DEFAULT_ENABLE_LTO})
91
+ option(CITRA_USE_PRECOMPILED_HEADERS "Use precompiled headers" ON)
92
+ option(CITRA_WARNINGS_AS_ERRORS "Enable warnings as errors" ON)
93
+
94
+ include(CitraHandleSystemLibs)
95
+
96
+ if (CITRA_USE_PRECOMPILED_HEADERS)
97
+ message(STATUS "Using Precompiled Headers.")
98
+ set(CMAKE_PCH_INSTANTIATE_TEMPLATES ON)
99
+
100
+ # This ensures that pre-compiled headers won't invalidate build caches for every fresh checkout.
101
+ if(NOT MSVC AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
102
+ list(APPEND CMAKE_CXX_COMPILE_OPTIONS_CREATE_PCH -Xclang -fno-pch-timestamp)
103
+ endif()
104
+ endif()
105
+
106
+ if(NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/hooks/pre-commit)
107
+ message(STATUS "Copying pre-commit hook")
108
+ file(COPY hooks/pre-commit
109
+ DESTINATION ${PROJECT_SOURCE_DIR}/.git/hooks)
110
+ endif()
111
+
112
+ # Use ccache for android if available
113
+ # =======================================================================
114
+ if (NOT $ENV{NDK_CCACHE} EQUAL "")
115
+ set(CCACHE_EXE $ENV{NDK_CCACHE})
116
+ set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_EXE})
117
+ set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_EXE})
118
+ endif()
119
+
120
+ # Check for LTO support
121
+ # =======================================================================
122
+ if (ENABLE_LTO)
123
+ include(CheckIPOSupported)
124
+ check_ipo_supported(RESULT supported OUTPUT error_msg)
125
+
126
+ if (supported)
127
+ message(STATUS "LTO enabled")
128
+ else()
129
+ message(STATUS "LTO enabled but is unavailable, disabling: ${error_msg}")
130
+ set(ENABLE_LTO OFF)
131
+ endif()
132
+ else()
133
+ message(STATUS "LTO disabled")
134
+ endif()
135
+
136
+ # Sanity check : Check that all submodules are present
137
+ # =======================================================================
138
+
139
+ function(check_submodules_present)
140
+ file(READ "${PROJECT_SOURCE_DIR}/.gitmodules" gitmodules)
141
+ string(REGEX MATCHALL "path *= *[^ \t\r\n]*" gitmodules ${gitmodules})
142
+ foreach(module ${gitmodules})
143
+ string(REGEX REPLACE "path *= *" "" module ${module})
144
+ if (NOT EXISTS "${PROJECT_SOURCE_DIR}/${module}/.git")
145
+ message(SEND_ERROR "Git submodule ${module} not found."
146
+ "Please run: git submodule update --init --recursive")
147
+ endif()
148
+ endforeach()
149
+ endfunction()
150
+ if (EXISTS "${PROJECT_SOURCE_DIR}/.git/objects")
151
+ # only check submodules when source is obtained via Git
152
+ check_submodules_present()
153
+ endif()
154
+
155
+ configure_file(${PROJECT_SOURCE_DIR}/dist/compatibility_list/compatibility_list.qrc
156
+ ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.qrc
157
+ COPYONLY)
158
+ if (ENABLE_COMPATIBILITY_LIST_DOWNLOAD AND NOT EXISTS ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.json)
159
+ message(STATUS "Downloading compatibility list for citra...")
160
+ file(DOWNLOAD
161
+ https://api.citra-emu.org/gamedb/
162
+ "${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.json" SHOW_PROGRESS)
163
+ endif()
164
+ if (EXISTS ${PROJECT_SOURCE_DIR}/dist/compatibility_list/compatibility_list.json)
165
+ file(COPY "${PROJECT_SOURCE_DIR}/dist/compatibility_list/compatibility_list.json"
166
+ DESTINATION "${PROJECT_BINARY_DIR}/dist/compatibility_list/")
167
+ endif()
168
+ if (NOT EXISTS ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.json)
169
+ file(WRITE ${PROJECT_BINARY_DIR}/dist/compatibility_list/compatibility_list.json "")
170
+ endif()
171
+
172
+ # Detect current compilation architecture and create standard definitions
173
+ # =======================================================================
174
+
175
+ include(CheckSymbolExists)
176
+ function(detect_architecture symbol arch)
177
+ if (NOT DEFINED ARCHITECTURE)
178
+ set(CMAKE_REQUIRED_QUIET 1)
179
+ check_symbol_exists("${symbol}" "" ARCHITECTURE_${arch})
180
+ unset(CMAKE_REQUIRED_QUIET)
181
+
182
+ # The output variable needs to be unique across invocations otherwise
183
+ # CMake's crazy scope rules will keep it defined
184
+ if (ARCHITECTURE_${arch})
185
+ set(ARCHITECTURE "${arch}" PARENT_SCOPE)
186
+ endif()
187
+ endif()
188
+ endfunction()
189
+
190
+ if (NOT ENABLE_GENERIC)
191
+ if (CMAKE_OSX_ARCHITECTURES)
192
+ set(ARCHITECTURE "${CMAKE_OSX_ARCHITECTURES}")
193
+ elseif (MSVC)
194
+ detect_architecture("_M_AMD64" x86_64)
195
+ detect_architecture("_M_IX86" x86)
196
+ detect_architecture("_M_ARM" arm)
197
+ detect_architecture("_M_ARM64" arm64)
198
+ else()
199
+ detect_architecture("__x86_64__" x86_64)
200
+ detect_architecture("__i386__" x86)
201
+ detect_architecture("__arm__" arm)
202
+ detect_architecture("__aarch64__" arm64)
203
+ endif()
204
+ endif()
205
+ if (NOT DEFINED ARCHITECTURE)
206
+ set(ARCHITECTURE "GENERIC")
207
+ endif()
208
+ message(STATUS "Target architecture: ${ARCHITECTURE}")
209
+
210
+
211
+ # Configure C++ standard
212
+ # ===========================
213
+
214
+ # boost asio's concept usage doesn't play nicely with some compilers yet.
215
+ add_definitions(-DBOOST_ASIO_DISABLE_CONCEPTS)
216
+ # boost can have issues compiling with C++17 and up on newer versions of Clang.
217
+ add_definitions(-DBOOST_NO_CXX98_FUNCTION_BASE)
218
+ set(CMAKE_CXX_STANDARD 20)
219
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
220
+
221
+ # Apply consistent visibility settings.
222
+ set(CMAKE_CXX_VISIBILITY_PRESET default)
223
+ set(CMAKE_VISIBILITY_INLINES_HIDDEN NO)
224
+
225
+ # set up output paths for executable binaries
226
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin/$<CONFIG>)
227
+
228
+
229
+ # System imported libraries
230
+ # ======================
231
+
232
+ # Prefer the -pthread flag on Linux.
233
+ set(THREADS_PREFER_PTHREAD_FLAG ON)
234
+ find_package(Threads REQUIRED)
235
+
236
+ if (ENABLE_QT)
237
+ if (NOT USE_SYSTEM_QT)
238
+ download_qt(6.6.0)
239
+ endif()
240
+
241
+ find_package(Qt6 REQUIRED COMPONENTS Widgets Multimedia Concurrent)
242
+
243
+ if (UNIX AND NOT APPLE)
244
+ find_package(Qt6 REQUIRED COMPONENTS DBus)
245
+ endif()
246
+
247
+ if (ENABLE_QT_TRANSLATION)
248
+ find_package(Qt6 REQUIRED COMPONENTS LinguistTools)
249
+ endif()
250
+
251
+ if (NOT DEFINED QT_TARGET_PATH)
252
+ # Determine the location of the compile target's Qt.
253
+ get_target_property(qtcore_path Qt6::Core LOCATION_Release)
254
+ string(FIND "${qtcore_path}" "/bin/" qtcore_path_bin_pos REVERSE)
255
+ string(FIND "${qtcore_path}" "/lib/" qtcore_path_lib_pos REVERSE)
256
+ if (qtcore_path_bin_pos GREATER qtcore_path_lib_pos)
257
+ string(SUBSTRING "${qtcore_path}" 0 ${qtcore_path_bin_pos} QT_TARGET_PATH)
258
+ else()
259
+ string(SUBSTRING "${qtcore_path}" 0 ${qtcore_path_lib_pos} QT_TARGET_PATH)
260
+ endif()
261
+ endif()
262
+
263
+ if (NOT DEFINED QT_HOST_PATH)
264
+ # Use the same for host Qt if none is defined.
265
+ set(QT_HOST_PATH "${QT_TARGET_PATH}")
266
+ endif()
267
+
268
+ message(STATUS "Using target Qt at ${QT_TARGET_PATH}")
269
+ message(STATUS "Using host Qt at ${QT_HOST_PATH}")
270
+ endif()
271
+
272
+ # Use system tsl::robin_map if available (otherwise we fallback to version bundled with dynarmic)
273
+ find_package(tsl-robin-map QUIET)
274
+
275
+ # Platform-specific library requirements
276
+ # ======================================
277
+
278
+ if (APPLE)
279
+ if (NOT IOS)
280
+ # Umbrella framework for everything GUI-related
281
+ find_library(COCOA_LIBRARY Cocoa REQUIRED)
282
+ endif()
283
+ find_library(AVFOUNDATION_LIBRARY AVFoundation REQUIRED)
284
+ find_library(IOSURFACE_LIBRARY IOSurface REQUIRED)
285
+ set(PLATFORM_LIBRARIES ${COCOA_LIBRARY} ${AVFOUNDATION_LIBRARY} ${IOSURFACE_LIBRARY} ${MOLTENVK_LIBRARY})
286
+
287
+ if (ENABLE_VULKAN)
288
+ if (NOT USE_SYSTEM_MOLTENVK)
289
+ download_moltenvk()
290
+ endif()
291
+ find_library(MOLTENVK_LIBRARY MoltenVK REQUIRED)
292
+ message(STATUS "Using MoltenVK at ${MOLTENVK_LIBRARY}.")
293
+ set(PLATFORM_LIBRARIES ${PLATFORM_LIBRARIES} ${MOLTENVK_LIBRARY})
294
+ endif()
295
+ elseif (WIN32)
296
+ set(PLATFORM_LIBRARIES winmm ws2_32)
297
+ if (MINGW)
298
+ # PSAPI is the Process Status API
299
+ set(PLATFORM_LIBRARIES ${PLATFORM_LIBRARIES} psapi imm32 version)
300
+ endif()
301
+ elseif (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU|SunOS)$")
302
+ set(PLATFORM_LIBRARIES rt)
303
+ endif()
304
+
305
+ # Setup a custom clang-format target (if clang-format can be found) that will run
306
+ # against all the src files. This should be used before making a pull request.
307
+ # =======================================================================
308
+
309
+ set(CLANG_FORMAT_POSTFIX "-15")
310
+ find_program(CLANG_FORMAT
311
+ NAMES clang-format${CLANG_FORMAT_POSTFIX}
312
+ clang-format
313
+ PATHS ${PROJECT_BINARY_DIR}/externals)
314
+ # if find_program doesn't find it, try to download from externals
315
+ if (NOT CLANG_FORMAT)
316
+ if (WIN32)
317
+ message(STATUS "Clang format not found! Downloading...")
318
+ set(CLANG_FORMAT "${PROJECT_BINARY_DIR}/externals/clang-format${CLANG_FORMAT_POSTFIX}.exe")
319
+ file(DOWNLOAD
320
+ https://github.com/citra-emu/ext-windows-bin/raw/master/clang-format${CLANG_FORMAT_POSTFIX}.exe
321
+ "${CLANG_FORMAT}" SHOW_PROGRESS
322
+ STATUS DOWNLOAD_SUCCESS)
323
+ if (NOT DOWNLOAD_SUCCESS EQUAL 0)
324
+ message(WARNING "Could not download clang format! Disabling the clang format target")
325
+ file(REMOVE ${CLANG_FORMAT})
326
+ unset(CLANG_FORMAT)
327
+ endif()
328
+ else()
329
+ message(WARNING "Clang format not found! Disabling the clang format target")
330
+ endif()
331
+ endif()
332
+
333
+ if (CLANG_FORMAT)
334
+ set(SRCS ${PROJECT_SOURCE_DIR}/src)
335
+ set(CCOMMENT "Running clang format against all the .h and .cpp files in src/")
336
+ if (WIN32)
337
+ if(MINGW)
338
+ add_custom_target(clang-format
339
+ COMMAND find `cygpath -u ${SRCS}` -iname *.h -o -iname *.cpp -o -iname *.mm | xargs `cygpath -u ${CLANG_FORMAT}` -i
340
+ COMMENT ${CCOMMENT})
341
+ else()
342
+ add_custom_target(clang-format
343
+ COMMAND powershell.exe -Command "Get-ChildItem '${SRCS}/*' -Include *.cpp,*.h,*.mm -Recurse | Foreach {&'${CLANG_FORMAT}' -i $_.fullname}"
344
+ COMMENT ${CCOMMENT})
345
+ endif()
346
+ else()
347
+ add_custom_target(clang-format
348
+ COMMAND find ${SRCS} -iname *.h -o -iname *.cpp -o -iname *.mm | xargs ${CLANG_FORMAT} -i
349
+ COMMENT ${CCOMMENT})
350
+ endif()
351
+ unset(SRCS)
352
+ unset(CCOMMENT)
353
+ endif()
354
+
355
+ # Include source code
356
+ # ===================
357
+
358
+ # This function should be passed a list of all files in a target. It will automatically generate
359
+ # file groups following the directory hierarchy, so that the layout of the files in IDEs matches the
360
+ # one in the filesystem.
361
+ function(create_target_directory_groups target_name)
362
+ # Place any files that aren't in the source list in a separate group so that they don't get in
363
+ # the way.
364
+ source_group("Other Files" REGULAR_EXPRESSION ".")
365
+
366
+ get_target_property(target_sources "${target_name}" SOURCES)
367
+
368
+ foreach(file_name IN LISTS target_sources)
369
+ get_filename_component(dir_name "${file_name}" PATH)
370
+ # Group names use '\' as a separator even though the entire rest of CMake uses '/'...
371
+ string(REPLACE "/" "\\" group_name "${dir_name}")
372
+ source_group("${group_name}" FILES "${file_name}")
373
+ endforeach()
374
+ endfunction()
375
+
376
+ # Gets a UTC timstamp and sets the provided variable to it
377
+ function(get_timestamp _var)
378
+ string(TIMESTAMP timestamp UTC)
379
+ set(${_var} "${timestamp}" PARENT_SCOPE)
380
+ endfunction()
381
+
382
+ # generate git/build information
383
+ include(GetGitRevisionDescription)
384
+ get_git_head_revision(GIT_REF_SPEC GIT_REV)
385
+ git_describe(GIT_DESC --always --long --dirty)
386
+ git_branch_name(GIT_BRANCH)
387
+ get_timestamp(BUILD_DATE)
388
+
389
+ # Boost
390
+ # Prevent boost from linking against libs when building
391
+ add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY
392
+ -DBOOST_SYSTEM_NO_LIB
393
+ -DBOOST_DATE_TIME_NO_LIB
394
+ -DBOOST_REGEX_NO_LIB
395
+ )
396
+ if (USE_SYSTEM_BOOST)
397
+ find_package(Boost 1.70.0 COMPONENTS container locale serialization iostreams REQUIRED)
398
+ endif()
399
+
400
+ enable_testing()
401
+ add_subdirectory(externals)
402
+
403
+ # Boost (bundled)
404
+ if (NOT USE_SYSTEM_BOOST)
405
+ add_definitions( -DBOOST_ALL_NO_LIB )
406
+ add_library(Boost::boost ALIAS boost)
407
+ add_library(Boost::serialization ALIAS boost_serialization)
408
+ add_library(Boost::iostreams ALIAS boost_iostreams)
409
+ endif()
410
+
411
+ # SDL2
412
+ if (ENABLE_SDL2 AND USE_SYSTEM_SDL2)
413
+ find_package(SDL2 REQUIRED)
414
+ add_library(SDL2 INTERFACE)
415
+ target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}")
416
+ target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}")
417
+ add_library(SDL2::SDL2 ALIAS SDL2)
418
+ endif()
419
+
420
+ if (ENABLE_LIBUSB AND USE_SYSTEM_LIBUSB)
421
+ include(FindPkgConfig)
422
+ find_package(LibUSB)
423
+ endif()
424
+
425
+ if (USE_SYSTEM_SOUNDTOUCH)
426
+ include(FindPkgConfig)
427
+ find_package(SoundTouch REQUIRED)
428
+ add_library(SoundTouch INTERFACE)
429
+ target_link_libraries(SoundTouch INTERFACE "${SOUNDTOUCH_LIBRARIES}")
430
+ target_include_directories(SoundTouch INTERFACE "${SOUNDTOUCH_INCLUDE_DIRS}")
431
+ endif()
432
+
433
+ add_subdirectory(src)
434
+ add_subdirectory(dist/installer)
435
+
436
+
437
+ # Set citra-qt project or citra project as default StartUp Project in Visual Studio depending on whether QT is enabled or not
438
+ if(ENABLE_QT)
439
+ set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT citra-qt)
440
+ else()
441
+ set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT citra)
442
+ endif()
443
+
444
+ # Create target for outputting distributable bundles.
445
+ # Not supported for mobile platforms as distributables are built differently.
446
+ if (NOT ANDROID AND NOT IOS)
447
+ include(BundleTarget)
448
+ if (ENABLE_SDL2_FRONTEND)
449
+ bundle_target(citra)
450
+ endif()
451
+ if (ENABLE_QT)
452
+ bundle_target(citra-qt)
453
+ endif()
454
+ if (ENABLE_DEDICATED_ROOM)
455
+ bundle_target(citra-room)
456
+ endif()
457
+ endif()
458
+
459
+ # Installation instructions
460
+ # =========================
461
+
462
+ # Install freedesktop.org metadata files, following those specifications:
463
+ # http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
464
+ # http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
465
+ # http://standards.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html
466
+ if(ENABLE_QT AND UNIX AND NOT APPLE)
467
+ install(FILES "${PROJECT_SOURCE_DIR}/dist/citra-qt.desktop"
468
+ DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications")
469
+ install(FILES "${PROJECT_SOURCE_DIR}/dist/citra.svg"
470
+ DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps")
471
+ install(FILES "${PROJECT_SOURCE_DIR}/dist/citra.xml"
472
+ DESTINATION "${CMAKE_INSTALL_PREFIX}/share/mime/packages")
473
+ endif()
474
+
475
+ if(UNIX)
476
+ if(ENABLE_SDL2)
477
+ install(FILES "${PROJECT_SOURCE_DIR}/dist/citra.6"
478
+ DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man6")
479
+ endif()
480
+
481
+ if (ENABLE_QT)
482
+ install(FILES "${PROJECT_SOURCE_DIR}/dist/citra-qt.6"
483
+ DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man6")
484
+ endif()
485
+ endif()
Source Code/Citra/CMakeModules/AndroidNdkModules.cmake ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (c) 2014, Pavel Rojtberg
2
+ # All rights reserved.
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without
5
+ # modification, are permitted provided that the following conditions are met:
6
+ #
7
+ # 1. Redistributions of source code must retain the above copyright notice,
8
+ # this list of conditions and the following disclaimer.
9
+ #
10
+ # 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ # this list of conditions and the following disclaimer in the documentation
12
+ # and/or other materials provided with the distribution.
13
+ #
14
+ # 3. Neither the name of the copyright holder nor the names of its
15
+ # contributors may be used to endorse or promote products derived from this
16
+ # software without specific prior written permission.
17
+ #
18
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
+ # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
+ # POSSIBILITY OF SUCH DAMAGE.
29
+
30
+ macro(android_ndk_import_module_cpufeatures)
31
+ if(ANDROID)
32
+ include_directories(${ANDROID_NDK}/sources/android/cpufeatures)
33
+ add_library(cpufeatures ${ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c)
34
+ target_link_libraries(cpufeatures dl)
35
+ endif()
36
+ endmacro()
37
+
38
+ macro(android_ndk_import_module_native_app_glue)
39
+ if(ANDROID)
40
+ include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
41
+ add_library(native_app_glue ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
42
+ target_link_libraries(native_app_glue log)
43
+ endif()
44
+ endmacro()
45
+
46
+ macro(android_ndk_import_module_ndk_helper)
47
+ if(ANDROID)
48
+ android_ndk_import_module_cpufeatures()
49
+ android_ndk_import_module_native_app_glue()
50
+
51
+ include_directories(${ANDROID_NDK}/sources/android/ndk_helper)
52
+ file(GLOB _NDK_HELPER_SRCS ${ANDROID_NDK}/sources/android/ndk_helper/*.cpp ${ANDROID_NDK}/sources/android/ndk_helper/gl3stub.c)
53
+ add_library(ndk_helper ${_NDK_HELPER_SRCS})
54
+ target_link_libraries(ndk_helper log android EGL GLESv2 cpufeatures native_app_glue)
55
+
56
+ unset(_NDK_HELPER_SRCS)
57
+ endif()
58
+ endmacro()
Source Code/Citra/CMakeModules/BuildInstaller.cmake ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # To use this as a script, make sure you pass in the variables BASE_DIR, SRC_DIR, BUILD_DIR, and TARGET_FILE
2
+ cmake_minimum_required(VERSION 3.15)
3
+
4
+ if(WIN32)
5
+ set(PLATFORM "windows")
6
+ elseif(APPLE)
7
+ set(PLATFORM "mac")
8
+ elseif(UNIX)
9
+ set(PLATFORM "linux")
10
+ else()
11
+ message(FATAL_ERROR "Cannot build installer for this unsupported platform")
12
+ endif()
13
+
14
+ list(APPEND CMAKE_MODULE_PATH "${BASE_DIR}/CMakeModules")
15
+ include(DownloadExternals)
16
+ download_qt(tools_ifw)
17
+ get_external_prefix(qt QT_PREFIX)
18
+
19
+ file(GLOB_RECURSE INSTALLER_BASE "${QT_PREFIX}/**/installerbase*")
20
+ file(GLOB_RECURSE BINARY_CREATOR "${QT_PREFIX}/**/binarycreator*")
21
+
22
+ set(CONFIG_FILE "${SRC_DIR}/config/config_${PLATFORM}.xml")
23
+ set(PACKAGES_DIR "${BUILD_DIR}/packages")
24
+ file(MAKE_DIRECTORY ${PACKAGES_DIR})
25
+
26
+ execute_process(COMMAND ${BINARY_CREATOR} -t ${INSTALLER_BASE} -n -c ${CONFIG_FILE} -p ${PACKAGES_DIR} ${TARGET_FILE})
Source Code/Citra/CMakeModules/BundleTarget.cmake ADDED
@@ -0,0 +1,374 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ if (BUNDLE_TARGET_EXECUTE)
3
+ # --- Bundling method logic ---
4
+
5
+ function(symlink_safe_copy from to)
6
+ if (WIN32)
7
+ # Use cmake copy for maximum compatibility.
8
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${from}" "${to}"
9
+ RESULT_VARIABLE cp_result)
10
+ else()
11
+ # Use native copy to turn symlinks into normal files.
12
+ execute_process(COMMAND cp -L "${from}" "${to}"
13
+ RESULT_VARIABLE cp_result)
14
+ endif()
15
+ if (NOT cp_result EQUAL "0")
16
+ message(FATAL_ERROR "cp \"${from}\" \"${to}\" failed: ${cp_result}")
17
+ endif()
18
+ endfunction()
19
+
20
+ function(bundle_qt executable_path)
21
+ if (WIN32)
22
+ # Perform standalone bundling first to copy over all used libraries, as windeployqt does not do this.
23
+ bundle_standalone("${executable_path}" "${EXECUTABLE_PATH}" "${BUNDLE_LIBRARY_PATHS}")
24
+
25
+ get_filename_component(executable_parent_dir "${executable_path}" DIRECTORY)
26
+
27
+ # Create a qt.conf file pointing to the app directory.
28
+ # This ensures Qt can find its plugins.
29
+ file(WRITE "${executable_parent_dir}/qt.conf" "[Paths]\nPrefix = .")
30
+
31
+ find_program(windeployqt_executable windeployqt6 PATHS "${QT_HOST_PATH}/bin")
32
+ find_program(qtpaths_executable qtpaths6 PATHS "${QT_HOST_PATH}/bin")
33
+
34
+ # TODO: Hack around windeployqt's poor cross-compilation support by
35
+ # TODO: making a local copy with a prefix pointing to the target Qt.
36
+ if (NOT "${QT_HOST_PATH}" STREQUAL "${QT_TARGET_PATH}")
37
+ set(windeployqt_dir "${BINARY_PATH}/windeployqt_copy")
38
+ file(MAKE_DIRECTORY "${windeployqt_dir}")
39
+ symlink_safe_copy("${windeployqt_executable}" "${windeployqt_dir}/windeployqt.exe")
40
+ symlink_safe_copy("${qtpaths_executable}" "${windeployqt_dir}/qtpaths.exe")
41
+ symlink_safe_copy("${QT_HOST_PATH}/bin/Qt6Core.dll" "${windeployqt_dir}")
42
+
43
+ if (EXISTS "${QT_TARGET_PATH}/share")
44
+ # Unix-style Qt; we need to wire up the paths manually.
45
+ file(WRITE "${windeployqt_dir}/qt.conf" "\
46
+ [Paths]\n
47
+ Prefix = ${QT_TARGET_PATH}\n \
48
+ ArchData = ${QT_TARGET_PATH}/share/qt6\n \
49
+ Binaries = ${QT_TARGET_PATH}/bin\n \
50
+ Data = ${QT_TARGET_PATH}/share/qt6\n \
51
+ Documentation = ${QT_TARGET_PATH}/share/qt6/doc\n \
52
+ Headers = ${QT_TARGET_PATH}/include/qt6\n \
53
+ Libraries = ${QT_TARGET_PATH}/lib\n \
54
+ LibraryExecutables = ${QT_TARGET_PATH}/share/qt6/bin\n \
55
+ Plugins = ${QT_TARGET_PATH}/share/qt6/plugins\n \
56
+ QmlImports = ${QT_TARGET_PATH}/share/qt6/qml\n \
57
+ Translations = ${QT_TARGET_PATH}/share/qt6/translations\n \
58
+ ")
59
+ else()
60
+ # Windows-style Qt; the defaults should suffice.
61
+ file(WRITE "${windeployqt_dir}/qt.conf" "[Paths]\nPrefix = ${QT_TARGET_PATH}")
62
+ endif()
63
+
64
+ set(windeployqt_executable "${windeployqt_dir}/windeployqt.exe")
65
+ set(qtpaths_executable "${windeployqt_dir}/qtpaths.exe")
66
+ endif()
67
+
68
+ message(STATUS "Executing windeployqt for executable ${executable_path}")
69
+ execute_process(COMMAND "${windeployqt_executable}" "${executable_path}"
70
+ --qtpaths "${qtpaths_executable}"
71
+ --no-compiler-runtime --no-system-d3d-compiler --no-opengl-sw --no-translations
72
+ --plugindir "${executable_parent_dir}/plugins"
73
+ RESULT_VARIABLE windeployqt_result)
74
+ if (NOT windeployqt_result EQUAL "0")
75
+ message(FATAL_ERROR "windeployqt failed: ${windeployqt_result}")
76
+ endif()
77
+
78
+ # Remove the FFmpeg multimedia plugin as we don't include FFmpeg.
79
+ # We want to use the Windows media plugin instead, which is also included.
80
+ file(REMOVE "${executable_parent_dir}/plugins/multimedia/ffmpegmediaplugin.dll")
81
+ elseif (APPLE)
82
+ get_filename_component(executable_name "${executable_path}" NAME_WE)
83
+ find_program(macdeployqt_executable macdeployqt6 PATHS "${QT_HOST_PATH}/bin")
84
+
85
+ message(STATUS "Executing macdeployqt at \"${macdeployqt_executable}\" for executable \"${executable_path}\"")
86
+ execute_process(
87
+ COMMAND "${macdeployqt_executable}"
88
+ "${executable_path}"
89
+ "-executable=${executable_path}/Contents/MacOS/${executable_name}"
90
+ -always-overwrite
91
+ RESULT_VARIABLE macdeployqt_result)
92
+ if (NOT macdeployqt_result EQUAL "0")
93
+ message(FATAL_ERROR "macdeployqt failed: ${macdeployqt_result}")
94
+ endif()
95
+
96
+ # Bundling libraries can rewrite path information and break code signatures of system libraries.
97
+ # Perform an ad-hoc re-signing on the whole app bundle to fix this.
98
+ execute_process(COMMAND codesign --deep -fs - "${executable_path}"
99
+ RESULT_VARIABLE codesign_result)
100
+ if (NOT codesign_result EQUAL "0")
101
+ message(FATAL_ERROR "codesign failed: ${codesign_result}")
102
+ endif()
103
+ else()
104
+ message(FATAL_ERROR "Unsupported OS for Qt bundling.")
105
+ endif()
106
+ endfunction()
107
+
108
+ function(bundle_appimage bundle_dir executable_path source_path binary_path linuxdeploy_executable enable_qt)
109
+ get_filename_component(executable_name "${executable_path}" NAME_WE)
110
+ set(appdir_path "${binary_path}/AppDir-${executable_name}")
111
+
112
+ if (enable_qt)
113
+ # Find qmake to make sure the plugin uses the right version of Qt.
114
+ find_program(qmake_executable qmake6 PATHS "${QT_HOST_PATH}/bin")
115
+
116
+ set(extra_linuxdeploy_env "QMAKE=${qmake_executable}")
117
+ set(extra_linuxdeploy_args --plugin qt)
118
+ endif()
119
+
120
+ message(STATUS "Creating AppDir for executable ${executable_path}")
121
+ execute_process(COMMAND ${CMAKE_COMMAND} -E env
122
+ ${extra_linuxdeploy_env}
123
+ "${linuxdeploy_executable}"
124
+ ${extra_linuxdeploy_args}
125
+ --plugin checkrt
126
+ --executable "${executable_path}"
127
+ --icon-file "${source_path}/dist/citra.svg"
128
+ --desktop-file "${source_path}/dist/${executable_name}.desktop"
129
+ --appdir "${appdir_path}"
130
+ RESULT_VARIABLE linuxdeploy_appdir_result)
131
+ if (NOT linuxdeploy_appdir_result EQUAL "0")
132
+ message(FATAL_ERROR "linuxdeploy failed to create AppDir: ${linuxdeploy_appdir_result}")
133
+ endif()
134
+
135
+ if (enable_qt)
136
+ set(qt_hook_file "${appdir_path}/apprun-hooks/linuxdeploy-plugin-qt-hook.sh")
137
+ file(READ "${qt_hook_file}" qt_hook_contents)
138
+ # Add Cinnamon to list of DEs for GTK3 theming.
139
+ string(REPLACE
140
+ "*XFCE*"
141
+ "*X-Cinnamon*|*XFCE*"
142
+ qt_hook_contents "${qt_hook_contents}")
143
+ # Wayland backend crashes due to changed schemas in Gnome 40.
144
+ string(REPLACE
145
+ "export QT_QPA_PLATFORMTHEME=gtk3"
146
+ "export QT_QPA_PLATFORMTHEME=gtk3; export GDK_BACKEND=x11"
147
+ qt_hook_contents "${qt_hook_contents}")
148
+ file(WRITE "${qt_hook_file}" "${qt_hook_contents}")
149
+ endif()
150
+
151
+ message(STATUS "Creating AppImage for executable ${executable_path}")
152
+ execute_process(COMMAND ${CMAKE_COMMAND} -E env
153
+ "OUTPUT=${bundle_dir}/${executable_name}.AppImage"
154
+ "${linuxdeploy_executable}"
155
+ --output appimage
156
+ --appdir "${appdir_path}"
157
+ RESULT_VARIABLE linuxdeploy_appimage_result)
158
+ if (NOT linuxdeploy_appimage_result EQUAL "0")
159
+ message(FATAL_ERROR "linuxdeploy failed to create AppImage: ${linuxdeploy_appimage_result}")
160
+ endif()
161
+ endfunction()
162
+
163
+ function(bundle_standalone executable_path original_executable_path bundle_library_paths)
164
+ get_filename_component(executable_parent_dir "${executable_path}" DIRECTORY)
165
+
166
+ # Resolve dependent library files if they were not passed in.
167
+ message(STATUS "Determining runtime dependencies of ${executable_path} using library paths ${bundle_library_paths}")
168
+ file(GET_RUNTIME_DEPENDENCIES
169
+ EXECUTABLES ${original_executable_path}
170
+ RESOLVED_DEPENDENCIES_VAR resolved_deps
171
+ UNRESOLVED_DEPENDENCIES_VAR unresolved_deps
172
+ DIRECTORIES ${bundle_library_paths}
173
+ POST_EXCLUDE_REGEXES ".*system32.*")
174
+
175
+ if (WIN32)
176
+ # Same directory since we don't have rpath.
177
+ set(lib_dir "${executable_parent_dir}")
178
+ else()
179
+ set(lib_dir "${executable_parent_dir}/libs")
180
+ endif()
181
+
182
+ # Copy files to bundled output.
183
+ if (resolved_deps)
184
+ file(MAKE_DIRECTORY ${lib_dir})
185
+ foreach (lib_file IN LISTS resolved_deps)
186
+ message(STATUS "Bundling library ${lib_file}")
187
+ symlink_safe_copy("${lib_file}" "${lib_dir}")
188
+ endforeach()
189
+ endif()
190
+
191
+ # Add libs directory to executable rpath where applicable.
192
+ if (APPLE)
193
+ execute_process(COMMAND install_name_tool -add_rpath "@loader_path/libs" "${executable_path}"
194
+ RESULT_VARIABLE install_name_tool_result)
195
+ if (NOT install_name_tool_result EQUAL "0")
196
+ message(FATAL_ERROR "install_name_tool failed: ${install_name_tool_result}")
197
+ endif()
198
+ elseif (UNIX)
199
+ execute_process(COMMAND patchelf --set-rpath '$ORIGIN/../libs' "${executable_path}"
200
+ RESULT_VARIABLE patchelf_result)
201
+ if (NOT patchelf_result EQUAL "0")
202
+ message(FATAL_ERROR "patchelf failed: ${patchelf_result}")
203
+ endif()
204
+ endif()
205
+ endfunction()
206
+
207
+ # --- Root bundling logic ---
208
+
209
+ set(bundle_dir ${BINARY_PATH}/bundle)
210
+
211
+ # On Linux, always bundle an AppImage.
212
+ if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
213
+ if (IN_PLACE)
214
+ message(FATAL_ERROR "Cannot bundle for Linux in-place.")
215
+ endif()
216
+
217
+ bundle_appimage("${bundle_dir}" "${EXECUTABLE_PATH}" "${SOURCE_PATH}" "${BINARY_PATH}" "${LINUXDEPLOY}" ${BUNDLE_QT})
218
+ else()
219
+ if (IN_PLACE)
220
+ message(STATUS "Bundling dependencies in-place")
221
+ set(bundled_executable_path "${EXECUTABLE_PATH}")
222
+ else()
223
+ message(STATUS "Copying base executable ${EXECUTABLE_PATH} to output directory ${bundle_dir}")
224
+ file(COPY ${EXECUTABLE_PATH} DESTINATION ${bundle_dir})
225
+ get_filename_component(bundled_executable_name "${EXECUTABLE_PATH}" NAME)
226
+ set(bundled_executable_path "${bundle_dir}/${bundled_executable_name}")
227
+ endif()
228
+
229
+ if (BUNDLE_QT)
230
+ bundle_qt("${bundled_executable_path}")
231
+ else()
232
+ bundle_standalone("${bundled_executable_path}" "${EXECUTABLE_PATH}" "${BUNDLE_LIBRARY_PATHS}")
233
+ endif()
234
+ endif()
235
+ elseif (BUNDLE_TARGET_DOWNLOAD_LINUXDEPLOY)
236
+ # --- linuxdeploy download logic ---
237
+
238
+ # Downloads and extracts a linuxdeploy component.
239
+ function(download_linuxdeploy_component base_dir name executable_name)
240
+ set(executable_file "${base_dir}/${executable_name}")
241
+ if (NOT EXISTS "${executable_file}")
242
+ message(STATUS "Downloading ${executable_name}")
243
+ file(DOWNLOAD
244
+ "https://github.com/${name}/releases/download/continuous/${executable_name}"
245
+ "${executable_file}" SHOW_PROGRESS)
246
+ file(CHMOD "${executable_file}" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)
247
+
248
+ get_filename_component(executable_ext "${executable_file}" LAST_EXT)
249
+ if (executable_ext STREQUAL ".AppImage")
250
+ message(STATUS "Extracting ${executable_name}")
251
+ execute_process(
252
+ COMMAND "${executable_file}" --appimage-extract
253
+ WORKING_DIRECTORY "${base_dir}"
254
+ RESULT_VARIABLE extract_result)
255
+ if (NOT extract_result EQUAL "0")
256
+ message(FATAL_ERROR "AppImage extract failed: ${extract_result}")
257
+ endif()
258
+ else()
259
+ message(STATUS "Copying ${executable_name}")
260
+ file(COPY "${executable_file}" DESTINATION "${base_dir}/squashfs-root/usr/bin/")
261
+ endif()
262
+ endif()
263
+ endfunction()
264
+
265
+ # Download plugins first so they don't overwrite linuxdeploy's AppRun file.
266
+ download_linuxdeploy_component("${LINUXDEPLOY_PATH}" "linuxdeploy/linuxdeploy-plugin-qt" "linuxdeploy-plugin-qt-${LINUXDEPLOY_ARCH}.AppImage")
267
+ download_linuxdeploy_component("${LINUXDEPLOY_PATH}" "darealshinji/linuxdeploy-plugin-checkrt" "linuxdeploy-plugin-checkrt.sh")
268
+ download_linuxdeploy_component("${LINUXDEPLOY_PATH}" "linuxdeploy/linuxdeploy" "linuxdeploy-${LINUXDEPLOY_ARCH}.AppImage")
269
+ else()
270
+ # --- Bundling target creation logic ---
271
+
272
+ # Creates the base bundle target with common files and pre-bundle steps.
273
+ function(create_base_bundle_target)
274
+ message(STATUS "Creating base bundle target")
275
+
276
+ add_custom_target(bundle)
277
+ add_custom_command(
278
+ TARGET bundle
279
+ COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/bundle/")
280
+ add_custom_command(
281
+ TARGET bundle
282
+ COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/bundle/dist/")
283
+ add_custom_command(
284
+ TARGET bundle
285
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/dist/icon.png" "${CMAKE_BINARY_DIR}/bundle/dist/citra.png")
286
+ add_custom_command(
287
+ TARGET bundle
288
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/license.txt" "${CMAKE_BINARY_DIR}/bundle/")
289
+ add_custom_command(
290
+ TARGET bundle
291
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/README.md" "${CMAKE_BINARY_DIR}/bundle/")
292
+ add_custom_command(
293
+ TARGET bundle
294
+ COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_SOURCE_DIR}/dist/scripting" "${CMAKE_BINARY_DIR}/bundle/scripting")
295
+
296
+ # On Linux, add a command to prepare linuxdeploy and any required plugins before any bundling occurs.
297
+ if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
298
+ add_custom_command(
299
+ TARGET bundle
300
+ COMMAND ${CMAKE_COMMAND}
301
+ "-DBUNDLE_TARGET_DOWNLOAD_LINUXDEPLOY=1"
302
+ "-DLINUXDEPLOY_PATH=${CMAKE_BINARY_DIR}/externals/linuxdeploy"
303
+ "-DLINUXDEPLOY_ARCH=${CMAKE_HOST_SYSTEM_PROCESSOR}"
304
+ -P "${CMAKE_SOURCE_DIR}/CMakeModules/BundleTarget.cmake"
305
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
306
+ endif()
307
+ endfunction()
308
+
309
+ # Adds a target to the bundle target, packing in required libraries.
310
+ # If in_place is true, the bundling will be done in-place as part of the specified target.
311
+ function(bundle_target_internal target_name in_place)
312
+ # Create base bundle target if it does not exist.
313
+ if (NOT in_place AND NOT TARGET bundle)
314
+ create_base_bundle_target()
315
+ endif()
316
+
317
+ set(bundle_executable_path "$<TARGET_FILE:${target_name}>")
318
+ if (target_name MATCHES ".*qt")
319
+ set(bundle_qt ON)
320
+ if (APPLE)
321
+ # For Qt targets on Apple, expect an app bundle.
322
+ set(bundle_executable_path "$<TARGET_BUNDLE_DIR:${target_name}>")
323
+ endif()
324
+ else()
325
+ set(bundle_qt OFF)
326
+ endif()
327
+
328
+ # Build a list of library search paths from prefix paths.
329
+ foreach(prefix_path IN LISTS CMAKE_FIND_ROOT_PATH CMAKE_PREFIX_PATH CMAKE_SYSTEM_PREFIX_PATH)
330
+ if (WIN32)
331
+ list(APPEND bundle_library_paths "${prefix_path}/bin")
332
+ endif()
333
+ list(APPEND bundle_library_paths "${prefix_path}/lib")
334
+ endforeach()
335
+ foreach(library_path IN LISTS CMAKE_SYSTEM_LIBRARY_PATH)
336
+ list(APPEND bundle_library_paths "${library_path}")
337
+ endforeach()
338
+
339
+ if (in_place)
340
+ message(STATUS "Adding in-place bundling to ${target_name}")
341
+ set(dest_target ${target_name})
342
+ else()
343
+ message(STATUS "Adding ${target_name} to bundle target")
344
+ set(dest_target bundle)
345
+ add_dependencies(bundle ${target_name})
346
+ endif()
347
+
348
+ add_custom_command(TARGET ${dest_target} POST_BUILD
349
+ COMMAND ${CMAKE_COMMAND}
350
+ "-DQT_HOST_PATH=\"${QT_HOST_PATH}\""
351
+ "-DQT_TARGET_PATH=\"${QT_TARGET_PATH}\""
352
+ "-DBUNDLE_TARGET_EXECUTE=1"
353
+ "-DTARGET=${target_name}"
354
+ "-DSOURCE_PATH=${CMAKE_SOURCE_DIR}"
355
+ "-DBINARY_PATH=${CMAKE_BINARY_DIR}"
356
+ "-DEXECUTABLE_PATH=${bundle_executable_path}"
357
+ "-DBUNDLE_LIBRARY_PATHS=\"${bundle_library_paths}\""
358
+ "-DBUNDLE_QT=${bundle_qt}"
359
+ "-DIN_PLACE=${in_place}"
360
+ "-DLINUXDEPLOY=${CMAKE_BINARY_DIR}/externals/linuxdeploy/squashfs-root/AppRun"
361
+ -P "${CMAKE_SOURCE_DIR}/CMakeModules/BundleTarget.cmake"
362
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
363
+ endfunction()
364
+
365
+ # Adds a target to the bundle target, packing in required libraries.
366
+ function(bundle_target target_name)
367
+ bundle_target_internal("${target_name}" OFF)
368
+ endfunction()
369
+
370
+ # Bundles the target in-place, packing in required libraries.
371
+ function(bundle_target_in_place target_name)
372
+ bundle_target_internal("${target_name}" ON)
373
+ endfunction()
374
+ endif()
Source Code/Citra/CMakeModules/DownloadExternals.cmake ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ set(CURRENT_MODULE_DIR ${CMAKE_CURRENT_LIST_DIR})
3
+
4
+ # Determines parameters based on the host and target for downloading the right Qt binaries.
5
+ function(determine_qt_parameters target host_out type_out arch_out arch_path_out host_type_out host_arch_out host_arch_path_out)
6
+ if (target MATCHES "tools_.*")
7
+ set(tool ON)
8
+ else()
9
+ set(tool OFF)
10
+ endif()
11
+
12
+ # Determine installation parameters for OS, architecture, and compiler
13
+ if (WIN32)
14
+ set(host "windows")
15
+ set(type "desktop")
16
+
17
+ if (NOT tool)
18
+ if (MINGW)
19
+ set(arch "win64_mingw")
20
+ set(arch_path "mingw_64")
21
+ elseif (MSVC)
22
+ if ("arm64" IN_LIST ARCHITECTURE)
23
+ set(arch_path "msvc2019_arm64")
24
+ elseif ("x86_64" IN_LIST ARCHITECTURE)
25
+ set(arch_path "msvc2019_64")
26
+ else()
27
+ message(FATAL_ERROR "Unsupported bundled Qt architecture. Enable USE_SYSTEM_QT and provide your own.")
28
+ endif()
29
+ set(arch "win64_${arch_path}")
30
+
31
+ # In case we're cross-compiling, prepare to also fetch the correct host Qt tools.
32
+ if (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "AMD64")
33
+ set(host_arch_path "msvc2019_64")
34
+ elseif (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "ARM64")
35
+ # TODO: msvc2019_arm64 doesn't include some of the required tools for some reason,
36
+ # TODO: so until it does, just use msvc2019_64 under x86_64 emulation.
37
+ # set(host_arch_path "msvc2019_arm64")
38
+ set(host_arch_path "msvc2019_64")
39
+ endif()
40
+ set(host_arch "win64_${host_arch_path}")
41
+ else()
42
+ message(FATAL_ERROR "Unsupported bundled Qt toolchain. Enable USE_SYSTEM_QT and provide your own.")
43
+ endif()
44
+ endif()
45
+ elseif (APPLE)
46
+ set(host "mac")
47
+ set(type "desktop")
48
+ set(arch "clang_64")
49
+ set(arch_path "macos")
50
+
51
+ if (IOS AND NOT tool)
52
+ set(host_type "${type}")
53
+ set(host_arch "${arch}")
54
+ set(host_arch_path "${arch_path}")
55
+
56
+ set(type "ios")
57
+ set(arch "ios")
58
+ set(arch_path "ios")
59
+ endif()
60
+ else()
61
+ set(host "linux")
62
+ set(type "desktop")
63
+ set(arch "gcc_64")
64
+ set(arch_path "linux")
65
+ endif()
66
+
67
+ set(${host_out} "${host}" PARENT_SCOPE)
68
+ set(${type_out} "${type}" PARENT_SCOPE)
69
+ set(${arch_out} "${arch}" PARENT_SCOPE)
70
+ set(${arch_path_out} "${arch_path}" PARENT_SCOPE)
71
+ if (DEFINED host_type)
72
+ set(${host_type_out} "${host_type}" PARENT_SCOPE)
73
+ else()
74
+ set(${host_type_out} "${type}" PARENT_SCOPE)
75
+ endif()
76
+ if (DEFINED host_arch)
77
+ set(${host_arch_out} "${host_arch}" PARENT_SCOPE)
78
+ else()
79
+ set(${host_arch_out} "${arch}" PARENT_SCOPE)
80
+ endif()
81
+ if (DEFINED host_arch_path)
82
+ set(${host_arch_path_out} "${host_arch_path}" PARENT_SCOPE)
83
+ else()
84
+ set(${host_arch_path_out} "${arch_path}" PARENT_SCOPE)
85
+ endif()
86
+ endfunction()
87
+
88
+ # Download Qt binaries for a specifc configuration.
89
+ function(download_qt_configuration prefix_out target host type arch arch_path base_path)
90
+ if (target MATCHES "tools_.*")
91
+ set(tool ON)
92
+ else()
93
+ set(tool OFF)
94
+ endif()
95
+
96
+ set(install_args -c "${CURRENT_MODULE_DIR}/aqt_config.ini")
97
+ if (tool)
98
+ set(prefix "${base_path}/Tools")
99
+ set(install_args ${install_args} install-tool --outputdir ${base_path} ${host} desktop ${target})
100
+ else()
101
+ set(prefix "${base_path}/${target}/${arch_path}")
102
+ set(install_args ${install_args} install-qt --outputdir ${base_path} ${host} ${type} ${target} ${arch}
103
+ -m qtmultimedia --archives qttranslations qttools qtsvg qtbase)
104
+ endif()
105
+
106
+ if (NOT EXISTS "${prefix}")
107
+ message(STATUS "Downloading Qt binaries for ${target}:${host}:${type}:${arch}:${arch_path}")
108
+ set(AQT_PREBUILD_BASE_URL "https://github.com/miurahr/aqtinstall/releases/download/v3.1.9")
109
+ if (WIN32)
110
+ set(aqt_path "${base_path}/aqt.exe")
111
+ if (NOT EXISTS "${aqt_path}")
112
+ file(DOWNLOAD
113
+ ${AQT_PREBUILD_BASE_URL}/aqt.exe
114
+ ${aqt_path} SHOW_PROGRESS)
115
+ endif()
116
+ execute_process(COMMAND ${aqt_path} ${install_args}
117
+ WORKING_DIRECTORY ${base_path})
118
+ elseif (APPLE)
119
+ set(aqt_path "${base_path}/aqt-macos")
120
+ if (NOT EXISTS "${aqt_path}")
121
+ file(DOWNLOAD
122
+ ${AQT_PREBUILD_BASE_URL}/aqt-macos
123
+ ${aqt_path} SHOW_PROGRESS)
124
+ endif()
125
+ execute_process(COMMAND chmod +x ${aqt_path})
126
+ execute_process(COMMAND ${aqt_path} ${install_args}
127
+ WORKING_DIRECTORY ${base_path})
128
+ else()
129
+ # aqt does not offer binary releases for other platforms, so download and run from pip.
130
+ set(aqt_install_path "${base_path}/aqt")
131
+ file(MAKE_DIRECTORY "${aqt_install_path}")
132
+
133
+ execute_process(COMMAND python3 -m pip install --target=${aqt_install_path} aqtinstall
134
+ WORKING_DIRECTORY ${base_path})
135
+ execute_process(COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${aqt_install_path} python3 -m aqt ${install_args}
136
+ WORKING_DIRECTORY ${base_path})
137
+ endif()
138
+
139
+ message(STATUS "Downloaded Qt binaries for ${target}:${host}:${type}:${arch}:${arch_path} to ${prefix}")
140
+ endif()
141
+
142
+ set(${prefix_out} "${prefix}" PARENT_SCOPE)
143
+ endfunction()
144
+
145
+ # This function downloads Qt using aqt.
146
+ # The path of the downloaded content will be added to the CMAKE_PREFIX_PATH.
147
+ # QT_TARGET_PATH is set to the Qt for the compile target platform.
148
+ # QT_HOST_PATH is set to a host-compatible Qt, for running tools.
149
+ # Params:
150
+ # target: Qt dependency to install. Specify a version number to download Qt, or "tools_(name)" for a specific build tool.
151
+ function(download_qt target)
152
+ determine_qt_parameters("${target}" host type arch arch_path host_type host_arch host_arch_path)
153
+
154
+ get_external_prefix(qt base_path)
155
+ file(MAKE_DIRECTORY "${base_path}")
156
+
157
+ download_qt_configuration(prefix "${target}" "${host}" "${type}" "${arch}" "${arch_path}" "${base_path}")
158
+ if (DEFINED host_arch_path AND NOT "${host_arch_path}" STREQUAL "${arch_path}")
159
+ download_qt_configuration(host_prefix "${target}" "${host}" "${host_type}" "${host_arch}" "${host_arch_path}" "${base_path}")
160
+ else()
161
+ set(host_prefix "${prefix}")
162
+ endif()
163
+
164
+ set(QT_TARGET_PATH "${prefix}" CACHE STRING "")
165
+ set(QT_HOST_PATH "${host_prefix}" CACHE STRING "")
166
+
167
+ # Add the target Qt prefix path so CMake can locate it.
168
+ list(APPEND CMAKE_PREFIX_PATH "${prefix}")
169
+ set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} PARENT_SCOPE)
170
+ endfunction()
171
+
172
+ function(download_moltenvk)
173
+ if (IOS)
174
+ set(MOLTENVK_PLATFORM "iOS")
175
+ else()
176
+ set(MOLTENVK_PLATFORM "macOS")
177
+ endif()
178
+
179
+ set(MOLTENVK_DIR "${CMAKE_BINARY_DIR}/externals/MoltenVK")
180
+ set(MOLTENVK_TAR "${CMAKE_BINARY_DIR}/externals/MoltenVK.tar")
181
+ if (NOT EXISTS ${MOLTENVK_DIR})
182
+ if (NOT EXISTS ${MOLTENVK_TAR})
183
+ file(DOWNLOAD https://github.com/KhronosGroup/MoltenVK/releases/download/v1.2.7-rc2/MoltenVK-all.tar
184
+ ${MOLTENVK_TAR} SHOW_PROGRESS)
185
+ endif()
186
+
187
+ execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${MOLTENVK_TAR}"
188
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externals")
189
+ endif()
190
+
191
+ # Add the MoltenVK library path to the prefix so find_library can locate it.
192
+ list(APPEND CMAKE_PREFIX_PATH "${MOLTENVK_DIR}/MoltenVK/dylib/${MOLTENVK_PLATFORM}")
193
+ set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} PARENT_SCOPE)
194
+ endfunction()
195
+
196
+ function(get_external_prefix lib_name prefix_var)
197
+ set(${prefix_var} "${CMAKE_BINARY_DIR}/externals/${lib_name}" PARENT_SCOPE)
198
+ endfunction()
Source Code/Citra/CMakeModules/GenerateBuildInfo.cmake ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Gets a UTC timstamp and sets the provided variable to it
2
+ function(get_timestamp _var)
3
+ string(TIMESTAMP timestamp UTC)
4
+ set(${_var} "${timestamp}" PARENT_SCOPE)
5
+ endfunction()
6
+ get_timestamp(BUILD_DATE)
7
+
8
+ list(APPEND CMAKE_MODULE_PATH "${SRC_DIR}/externals/cmake-modules")
9
+
10
+ if (EXISTS "${SRC_DIR}/.git/objects")
11
+ # Find the package here with the known path so that the GetGit commands can find it as well
12
+ find_package(Git QUIET PATHS "${GIT_EXECUTABLE}")
13
+
14
+ # only use Git to check revision info when source is obtained via Git
15
+ include(GetGitRevisionDescription)
16
+ get_git_head_revision(GIT_REF_SPEC GIT_REV)
17
+ git_describe(GIT_DESC --always --long --dirty)
18
+ git_branch_name(GIT_BRANCH)
19
+ elseif (EXISTS "${SRC_DIR}/GIT-COMMIT" AND EXISTS "${SRC_DIR}/GIT-TAG")
20
+ # unified source archive
21
+ file(READ "${SRC_DIR}/GIT-COMMIT" GIT_REV_RAW LIMIT 64)
22
+ string(STRIP "${GIT_REV_RAW}" GIT_REV)
23
+ string(SUBSTRING "${GIT_REV_RAW}" 0 9 GIT_DESC)
24
+ set(GIT_BRANCH "HEAD")
25
+ else()
26
+ # self-packed archive?
27
+ set(GIT_REV "UNKNOWN")
28
+ set(GIT_DESC "UNKNOWN")
29
+ set(GIT_BRANCH "UNKNOWN")
30
+ endif()
31
+ string(SUBSTRING "${GIT_REV}" 0 7 GIT_SHORT_REV)
32
+
33
+ # Generate cpp with Git revision from template
34
+ # Also if this is a CI build, add the build name (ie: Nightly, Canary) to the scm_rev file as well
35
+ set(REPO_NAME "")
36
+ set(BUILD_VERSION "0")
37
+ set(BUILD_FULLNAME "${GIT_SHORT_REV}")
38
+ if (DEFINED ENV{CI})
39
+ if (DEFINED ENV{GITHUB_ACTIONS})
40
+ set(BUILD_REPOSITORY $ENV{GITHUB_REPOSITORY})
41
+ set(BUILD_TAG $ENV{GITHUB_REF_NAME})
42
+ endif()
43
+
44
+ # regex capture the string nightly or canary into CMAKE_MATCH_1
45
+ string(REGEX MATCH "citra-emu/citra-?(.*)" OUTVAR ${BUILD_REPOSITORY})
46
+ if ("${CMAKE_MATCH_COUNT}" GREATER 0)
47
+ # capitalize the first letter of each word in the repo name.
48
+ string(REPLACE "-" ";" REPO_NAME_LIST ${CMAKE_MATCH_1})
49
+ foreach(WORD ${REPO_NAME_LIST})
50
+ string(SUBSTRING ${WORD} 0 1 FIRST_LETTER)
51
+ string(SUBSTRING ${WORD} 1 -1 REMAINDER)
52
+ string(TOUPPER ${FIRST_LETTER} FIRST_LETTER)
53
+ set(REPO_NAME "${REPO_NAME}${FIRST_LETTER}${REMAINDER}")
54
+ endforeach()
55
+ string(REGEX MATCH "${CMAKE_MATCH_1}-([0-9]+)" OUTVAR ${BUILD_TAG})
56
+ if (${CMAKE_MATCH_COUNT} GREATER 0)
57
+ set(BUILD_VERSION ${CMAKE_MATCH_1})
58
+ endif()
59
+ if (BUILD_VERSION)
60
+ set(BUILD_FULLNAME "${REPO_NAME} ${BUILD_VERSION}")
61
+ else()
62
+ set(BUILD_FULLNAME "")
63
+ endif()
64
+ endif()
65
+ endif()
Source Code/Citra/CMakeModules/GenerateSCMRev.cmake ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ list(APPEND CMAKE_MODULE_PATH "${SRC_DIR}/CMakeModules")
2
+ include(GenerateBuildInfo)
3
+
4
+ # The variable SRC_DIR must be passed into the script (since it uses the current build directory for all values of CMAKE_*_DIR)
5
+ set(VIDEO_CORE "${SRC_DIR}/src/video_core")
6
+ set(HASH_FILES
7
+ "${VIDEO_CORE}/renderer_opengl/gl_shader_disk_cache.cpp"
8
+ "${VIDEO_CORE}/renderer_opengl/gl_shader_disk_cache.h"
9
+ "${VIDEO_CORE}/renderer_opengl/gl_shader_util.cpp"
10
+ "${VIDEO_CORE}/renderer_opengl/gl_shader_util.h"
11
+ "${VIDEO_CORE}/renderer_vulkan/vk_shader_util.cpp"
12
+ "${VIDEO_CORE}/renderer_vulkan/vk_shader_util.h"
13
+ "${VIDEO_CORE}/shader/generator/glsl_fs_shader_gen.cpp"
14
+ "${VIDEO_CORE}/shader/generator/glsl_fs_shader_gen.h"
15
+ "${VIDEO_CORE}/shader/generator/glsl_shader_decompiler.cpp"
16
+ "${VIDEO_CORE}/shader/generator/glsl_shader_decompiler.h"
17
+ "${VIDEO_CORE}/shader/generator/glsl_shader_gen.cpp"
18
+ "${VIDEO_CORE}/shader/generator/glsl_shader_gen.h"
19
+ "${VIDEO_CORE}/shader/generator/pica_fs_config.cpp"
20
+ "${VIDEO_CORE}/shader/generator/pica_fs_config.h"
21
+ "${VIDEO_CORE}/shader/generator/shader_gen.cpp"
22
+ "${VIDEO_CORE}/shader/generator/shader_gen.h"
23
+ "${VIDEO_CORE}/shader/generator/shader_uniforms.cpp"
24
+ "${VIDEO_CORE}/shader/generator/shader_uniforms.h"
25
+ "${VIDEO_CORE}/shader/generator/spv_fs_shader_gen.cpp"
26
+ "${VIDEO_CORE}/shader/generator/spv_fs_shader_gen.h"
27
+ "${VIDEO_CORE}/shader/shader.cpp"
28
+ "${VIDEO_CORE}/shader/shader.h"
29
+ "${VIDEO_CORE}/pica/regs_framebuffer.h"
30
+ "${VIDEO_CORE}/pica/regs_lighting.h"
31
+ "${VIDEO_CORE}/pica/regs_pipeline.h"
32
+ "${VIDEO_CORE}/pica/regs_rasterizer.h"
33
+ "${VIDEO_CORE}/pica/regs_shader.h"
34
+ "${VIDEO_CORE}/pica/regs_texturing.h"
35
+ "${VIDEO_CORE}/pica/regs_internal.cpp"
36
+ "${VIDEO_CORE}/pica/regs_internal.h"
37
+ )
38
+ set(COMBINED "")
39
+ foreach (F IN LISTS HASH_FILES)
40
+ file(READ ${F} TMP)
41
+ set(COMBINED "${COMBINED}${TMP}")
42
+ endforeach()
43
+ string(MD5 SHADER_CACHE_VERSION "${COMBINED}")
44
+ configure_file("${SRC_DIR}/src/common/scm_rev.cpp.in" "scm_rev.cpp" @ONLY)
Source Code/Citra/CMakeModules/aqt_config.ini ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [aqt]
2
+ concurrency: 2
3
+
4
+ [mirrors]
5
+ trusted_mirrors:
6
+ https://download.qt.io
7
+ blacklist:
8
+ https://qt.mirror.constant.com
9
+ https://mirrors.ocf.berkeley.edu
10
+ https://mirrors.ustc.edu.cn
11
+ https://mirrors.tuna.tsinghua.edu.cn
12
+ https://mirrors.geekpie.club
13
+ https://mirrors-wan.geekpie.club
14
+ https://mirrors.sjtug.sjtu.edu.cn
15
+ fallbacks:
16
+ https://qtproject.mirror.liquidtelecom.com/
17
+ https://mirrors.aliyun.com/qt/
18
+ https://ftp.jaist.ac.jp/pub/qtproject/
19
+ https://ftp.yz.yamagata-u.ac.jp/pub/qtproject/
20
+ https://qt-mirror.dannhauer.de/
21
+ https://ftp.fau.de/qtproject/
22
+ https://mirror.netcologne.de/qtproject/
23
+ https://mirrors.dotsrc.org/qtproject/
24
+ https://www.nic.funet.fi/pub/mirrors/download.qt-project.org/
25
+ https://master.qt.io/
26
+ https://mirrors.ukfast.co.uk/sites/qt.io/
27
+ https://ftp2.nluug.nl/languages/qt/
28
+ https://ftp1.nluug.nl/languages/qt/
29
+
Source Code/Citra/CONTRIBUTING.md ADDED
@@ -0,0 +1 @@
 
 
1
+ **The Contributor's Guide has moved to [the wiki](https://github.com/citra-emu/citra/wiki/Contributing).**
Source Code/Citra/Doxyfile ADDED
The diff for this file is too large to render. See raw diff
 
Source Code/Citra/README.md ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Citra for Android
2
+ An (Unofficial) Android frontend for the Citra Emulator
3
+
4
+ This is an unofficial port for the [Citra emulator](https://github.com/citra-emu) based on the [Dolphin emulator's](https://github.com/dolphin-emu) Android frontend.
5
+ So, huge props to the guys over there.
6
+
7
+ Since this code is almost entirely a copy of the Dolphin frontend,there are a lot of useless segments in here that aren't being used ... or are useless.
8
+
9
+ **Download** apk files from [here](https://github.com/SachinVin/citra_android/releases)
10
+
11
+ ### Device Requirements
12
+ * OS
13
+ * Android (5.0 Lollipop or higher).
14
+ * Processor
15
+ * A processor with support for either ARMv8 or x86-64; 32-bit processors (ARMv7, x86) are not supported by Citra.
16
+ * Graphics
17
+ * A graphics processor that supports OpenGL ES 3.2 or higher.
18
+
19
+ ### Building
20
+ You can follow [this guide](https://github.com/dolphin-emu/dolphin/blob/master/AndroidSetup.md) if haven't set up your Android environment.
21
+ Once that is done, follow [this](https://developer.android.com/studio/projects/add-native-code#vanilla_cmake) to setup and use Cmake 3.8(min. for Citra) or higher.
22
+
23
+ First, for the frontend, you can clone/download this repo.
24
+
25
+ You can find the Citra backend [here](https://github.com/SachinVin/citra) - either download a snapshot archive from GitHub or clone the repository.
26
+
27
+ Edit the CMakeLists path in the build.gradle to point to the location of the CMakeLists.txt of the Citra backend.
28
+
29
+ You're all set, now hit build.
30
+
31
+
32
+ ### Known Issues
33
+ Since this is in very early stages of development a lot of things don't quite work properly yet:
34
+ * Colors in games (since GLES doesn't support BGR color ordering, the color channels may be inverted);
35
+ * Since this is based on an older version of Citra, bugs solved on newer versions of Citra may still be present.
36
+
Source Code/Citra/dist/apple/Info.plist.in ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <!-- Templated data -->
6
+ <key>CFBundleName</key>
7
+ <string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
8
+ <key>CFBundleIdentifier</key>
9
+ <string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
10
+ <key>CFBundleVersion</key>
11
+ <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
12
+ <key>CFBundleShortVersionString</key>
13
+ <string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
14
+ <key>CFBundleLongVersionString</key>
15
+ <string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
16
+ <key>CFBundleExecutable</key>
17
+ <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
18
+ <key>CFBundleIconFile</key>
19
+ <string>${MACOSX_BUNDLE_ICON_FILE}</string>
20
+ <key>CFBundleGetInfoString</key>
21
+ <string>${MACOSX_BUNDLE_INFO_STRING}</string>
22
+ <key>NSHumanReadableCopyright</key>
23
+ <string>${MACOSX_BUNDLE_COPYRIGHT}</string>
24
+ <key>LSMinimumSystemVersion</key>
25
+ <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string>
26
+ <!-- Fixed -->
27
+ <key>LSApplicationCategoryType</key>
28
+ <string>public.app-category.games</string>
29
+ <key>CFBundleDocumentTypes</key>
30
+ <array>
31
+ <dict>
32
+ <key>CFBundleTypeExtensions</key>
33
+ <array>
34
+ <string>3ds</string>
35
+ <string>3dsx</string>
36
+ <string>cci</string>
37
+ <string>cxi</string>
38
+ <string>cia</string>
39
+ </array>
40
+ <key>CFBundleTypeName</key>
41
+ <string>Nintendo 3DS File</string>
42
+ <key>CFBundleTypeRole</key>
43
+ <string>Viewer</string>
44
+ <key>LSHandlerRank</key>
45
+ <string>Default</string>
46
+ </dict>
47
+ <dict>
48
+ <key>CFBundleTypeExtensions</key>
49
+ <array>
50
+ <string>elf</string>
51
+ <string>axf</string>
52
+ </array>
53
+ <key>CFBundleTypeName</key>
54
+ <string>Unix Executable and Linkable Format</string>
55
+ <key>CFBundleTypeRole</key>
56
+ <string>Viewer</string>
57
+ <key>LSHandlerRank</key>
58
+ <string>Alternate</string>
59
+ </dict>
60
+ </array>
61
+ <key>NSCameraUsageDescription</key>
62
+ <string>This app requires camera access to emulate the 3DS&apos;s cameras.</string>
63
+ <key>NSMicrophoneUsageDescription</key>
64
+ <string>This app requires microphone access to emulate the 3DS&apos;s microphone.</string>
65
+ <key>CFBundleInfoDictionaryVersion</key>
66
+ <string>6.0</string>
67
+ <key>CFBundlePackageType</key>
68
+ <string>APPL</string>
69
+ <key>CFBundleDevelopmentRegion</key>
70
+ <string>English</string>
71
+ <key>CFBundleSignature</key>
72
+ <string>????</string>
73
+ <key>CSResourcesFileMapped</key>
74
+ <true/>
75
+ <key>LSSupportsOpeningDocumentsInPlace</key>
76
+ <true/>
77
+ <key>NSHighResolutionCapable</key>
78
+ <string>True</string>
79
+ <key>UIFileSharingEnabled</key>
80
+ <true/>
81
+ <key>UILaunchStoryboardName</key>
82
+ <string>LaunchScreen</string>
83
+ </dict>
84
+ </plist>
Source Code/Citra/dist/apple/LaunchScreen.storyboard ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="Y6W-OH-hqX">
3
+ <dependencies>
4
+ <deployment identifier="iOS"/>
5
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
6
+ </dependencies>
7
+ <scenes>
8
+ <!--View Controller-->
9
+ <scene sceneID="s0d-6b-0kx">
10
+ <objects>
11
+ <viewController id="Y6W-OH-hqX" sceneMemberID="viewController">
12
+ <view key="view" contentMode="scaleToFill" id="5EZ-qb-Rvc">
13
+ <rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
14
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
15
+ <subviews>
16
+ <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="launch_logo.png" translatesAutoresizingMaskIntoConstraints="NO" id="yrZ-hu-Uge">
17
+ <rect key="frame" x="-59.666666666666657" y="306" width="512.33333333333337" height="240"/>
18
+ <constraints>
19
+ <constraint firstAttribute="height" constant="240" id="VhL-hA-Bwr"/>
20
+ </constraints>
21
+ </imageView>
22
+ </subviews>
23
+ <viewLayoutGuide key="safeArea" id="vDu-zF-Fre"/>
24
+ <color key="backgroundColor" systemColor="systemBackgroundColor"/>
25
+ <constraints>
26
+ <constraint firstItem="yrZ-hu-Uge" firstAttribute="centerX" secondItem="5EZ-qb-Rvc" secondAttribute="centerX" id="1y3-Mx-a65"/>
27
+ <constraint firstItem="yrZ-hu-Uge" firstAttribute="centerY" secondItem="5EZ-qb-Rvc" secondAttribute="centerY" id="vNO-xV-EPD"/>
28
+ </constraints>
29
+ </view>
30
+ </viewController>
31
+ <placeholder placeholderIdentifier="IBFirstResponder" id="Ief-a0-LHa" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
32
+ </objects>
33
+ <point key="canvasLocation" x="219" y="18"/>
34
+ </scene>
35
+ </scenes>
36
+ <resources>
37
+ <image name="launch_logo.png" width="512" height="512"/>
38
+ <systemColor name="systemBackgroundColor">
39
+ <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
40
+ </systemColor>
41
+ </resources>
42
+ </document>
Source Code/Citra/dist/apple/citra.icns ADDED
Binary file (211 kB). View file
 
Source Code/Citra/dist/apple/launch_logo.png ADDED
Source Code/Citra/dist/citra-qt.6 ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .Dd November 22 2016
2
+ .Dt citra-qt 6
3
+ .Os
4
+ .Sh NAME
5
+ .Nm Citra-Qt
6
+ .Nd Nintendo 3DS Emulator/Debugger (Qt)
7
+ .Sh SYNOPSIS
8
+ .Nm citra-qt
9
+ .Op Ar file
10
+ .Sh DESCRIPTION
11
+ Citra is an experimental open-source Nintendo 3DS emulator/debugger.
12
+ .Pp
13
+ .Nm citra-qt
14
+ is the Qt implementation.
15
+ .Sh FILES
16
+ .Bl -tag -width Ds
17
+ .It Pa $XDG_DATA_HOME/citra-emu
18
+ Emulator storage.
19
+ .It Pa $XDG_CONFIG_HOME/citra-emu
20
+ Configuration files.
21
+ .El
22
+ .Sh AUTHORS
23
+ This document is made available to you under the CC-BY license.
24
+ .Pp
25
+ Citra is made by a team of volunteers. These contributors are listed
26
+ at <\fBhttps://github.com/citra-emu/citra/contributors\fR>.
27
+ .Pp
28
+ .Sh SEE ALSO
29
+ .Bl -tag -width Ds
30
+ .It Xr citra 6
31
+ The SDL frontend of the application
32
+ .El
33
+ .Pp
34
+ Resources are available for this project:
35
+ .Bl -tag -width Ds
36
+ .It <\fBhttps://citra-emu.org\fR>
37
+ The main homepage of the project.
38
+ .It <\fBhttps://github.com/citra-emu/citra\fR>
39
+ The main source code repository for the Citra emulator.
40
+ .Pp
Source Code/Citra/dist/citra-qt.desktop ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [Desktop Entry]
2
+ Version=1.0
3
+ Type=Application
4
+ Name=Citra
5
+ GenericName=3DS Emulator
6
+ GenericName[fr]=Émulateur 3DS
7
+ Comment=Nintendo 3DS video game console emulator
8
+ Comment[fr]=Émulateur de console de jeu Nintendo 3DS
9
+ Icon=citra
10
+ TryExec=citra-qt
11
+ Exec=citra-qt %f
12
+ Categories=Game;Emulator;Qt;
13
+ MimeType=application/x-ctr-3dsx;application/x-ctr-cci;application/x-ctr-cia;application/x-ctr-cxi;
14
+ Keywords=3DS;Nintendo;
15
+ PrefersNonDefaultGPU=true
Source Code/Citra/dist/citra-room.desktop ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ [Desktop Entry]
2
+ Version=1.0
3
+ Type=Application
4
+ Name=Citra Room
5
+ Comment=Multiplayer room host for Citra
6
+ Icon=citra
7
+ TryExec=citra-room
8
+ Exec=citra-room %f
9
+ Categories=Game;Emulator;
10
+ Keywords=3DS;Nintendo
Source Code/Citra/dist/citra.6 ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .Dd November 22 2016
2
+ .Dt citra 6
3
+ .Os
4
+ .Sh NAME
5
+ .Nm Citra
6
+ .Nd Nintendo 3DS Emulator/Debugger (SDL)
7
+ .Sh SYNOPSIS
8
+ .Nm citra
9
+ .Op Ar options
10
+ .Op Ar file
11
+ .Sh OPTIONS
12
+ .Bl -tag -width Ds
13
+ .It Fl g Ar port , Fl Fl gdbport Ar port
14
+ Starts the GDB stub on the specified port
15
+ .It Fl h , Fl Fl help
16
+ Shows syntax help and exits
17
+ .It Fl v , Fl Fl version
18
+ Describes the installed version and exits
19
+ .Sh DESCRIPTION
20
+ Citra is an experimental open-source Nintendo 3DS emulator/debugger.
21
+ .Pp
22
+ .Nm citra
23
+ is the Simple DirectMedia Layer (SDL) implementation.
24
+ .Sh FILES
25
+ .Bl -tag -width Ds
26
+ .It Pa $XDG_DATA_HOME/citra-emu
27
+ Emulator storage.
28
+ .It Pa $XDG_CONFIG_HOME/citra-emu
29
+ Configuration files.
30
+ .El
31
+ .Sh AUTHORS
32
+ This document is made available to you under the CC-BY license.
33
+ .Pp
34
+ Citra is made by a team of volunteers. These contributors are listed
35
+ at <\fBhttps://github.com/citra-emu/citra/contributors\fR>.
36
+ .Pp
37
+ .Sh SEE ALSO
38
+ .Bl -tag -width Ds
39
+ .It Xr citra-qt 6
40
+ The Qt frontend of the application
41
+ .El
42
+ .Pp
43
+ Resources are available for this project:
44
+ .Bl -tag -width Ds
45
+ .It <\fBhttps://citra-emu.org\fR>
46
+ The main homepage of the project.
47
+ .It <\fBhttps://github.com/citra-emu/citra\fR>
48
+ The main source code repository for the Citra emulator.
49
+ .Pp
Source Code/Citra/dist/citra.desktop ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [Desktop Entry]
2
+ Version=1.0
3
+ Type=Application
4
+ Name=Citra
5
+ GenericName=3DS Emulator
6
+ GenericName[fr]=Émulateur 3DS
7
+ Comment=Nintendo 3DS video game console emulator
8
+ Comment[fr]=Émulateur de console de jeu Nintendo 3DS
9
+ Icon=citra
10
+ TryExec=citra
11
+ Exec=citra %f
12
+ Categories=Game;Emulator;
13
+ MimeType=application/x-ctr-3dsx;application/x-ctr-cci;application/x-ctr-cia;application/x-ctr-cxi;
14
+ Keywords=3DS;Nintendo;
15
+ PrefersNonDefaultGPU=true
Source Code/Citra/dist/citra.ico ADDED
Source Code/Citra/dist/citra.manifest ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
+ <assembly manifestVersion="1.0"
3
+ xmlns="urn:schemas-microsoft-com:asm.v1"
4
+ xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
5
+ <asmv3:application>
6
+ <asmv3:windowsSettings>
7
+ <!-- Windows 7/8/8.1/10 -->
8
+ <dpiAware
9
+ xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
10
+ true/pm
11
+ </dpiAware>
12
+ <!-- Windows 10, version 1607 or later -->
13
+ <dpiAwareness
14
+ xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
15
+ PerMonitorV2
16
+ </dpiAwareness>
17
+ <!-- Windows 10, version 1703 or later -->
18
+ <gdiScaling
19
+ xmlns="http://schemas.microsoft.com/SMI/2017/WindowsSettings">
20
+ true
21
+ </gdiScaling>
22
+ <ws2:longPathAware
23
+ xmlns:ws3="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
24
+ true
25
+ </ws2:longPathAware>
26
+ </asmv3:windowsSettings>
27
+ </asmv3:application>
28
+ <compatibility
29
+ xmlns="urn:schemas-microsoft-com:compatibility.v1">
30
+ <application>
31
+ <!-- Windows 10 -->
32
+ <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
33
+ <!-- Windows 8.1 -->
34
+ <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
35
+ <!-- Windows 8 -->
36
+ <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
37
+ <!-- Windows 7 -->
38
+ <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
39
+ </application>
40
+ </compatibility>
41
+ <trustInfo
42
+ xmlns="urn:schemas-microsoft-com:asm.v3">
43
+ <security>
44
+ <requestedPrivileges>
45
+ <!--
46
+ UAC settings:
47
+ - app should run at same integrity level as calling process
48
+ - app does not need to manipulate windows belonging to
49
+ higher-integrity-level processes
50
+ -->
51
+ <requestedExecutionLevel
52
+ level="asInvoker"
53
+ uiAccess="false"
54
+ />
55
+ </requestedPrivileges>
56
+ </security>
57
+ </trustInfo>
58
+ </assembly>
Source Code/Citra/dist/citra.svg ADDED
Source Code/Citra/dist/citra.xml ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
3
+ <mime-type type="application/x-ctr-3dsx">
4
+ <comment>Nintendo 3DS homebrew executable</comment>
5
+ <comment xml:lang="fr">Exécutable non-officiel pour Nintendo 3DS </comment>
6
+ <acronym>3DSX</acronym>
7
+ <icon name="citra"/>
8
+ <glob pattern="*.3dsx"/>
9
+ <magic><match value="3DSX" type="string" offset="0"/></magic>
10
+ </mime-type>
11
+
12
+ <mime-type type="application/x-ctr-cci">
13
+ <comment>Nintendo 3DS cartridge image</comment>
14
+ <comment xml:lang="fr">Image de cartouche Nintendo 3DS</comment>
15
+ <acronym>CCI</acronym>
16
+ <expanded-acronym>CTR Cart Image</expanded-acronym>
17
+ <icon name="citra"/>
18
+ <glob pattern="*.cci"/>
19
+ <glob pattern="*.3ds"/>
20
+ <magic><match value="NCSD" type="string" offset="256"/></magic>
21
+ </mime-type>
22
+
23
+ <mime-type type="application/x-ctr-cxi">
24
+ <comment>Nintendo 3DS executable</comment>
25
+ <comment xml:lang="fr">Exécutable Nintendo 3DS</comment>
26
+ <acronym>CXI</acronym>
27
+ <expanded-acronym>CTR eXecutable Image</expanded-acronym>
28
+ <icon name="citra"/>
29
+ <glob pattern="*.cxi"/>
30
+ <magic><match value="NCCH" type="string" offset="256"/></magic>
31
+ </mime-type>
32
+
33
+ <mime-type type="application/x-ctr-cia">
34
+ <comment>Nintendo 3DS importable archive</comment>
35
+ <comment xml:lang="fr">Archive installable Nintendo 3DS</comment>
36
+ <acronym>CIA</acronym>
37
+ <expanded-acronym>CTR Importable Archive</expanded-acronym>
38
+ <icon name="citra"/>
39
+ <glob pattern="*.cia"/>
40
+ </mime-type>
41
+
42
+ <mime-type type="application/x-ctr-smdh">
43
+ <comment>Nintendo 3DS icon and metadata</comment>
44
+ <comment xml:lang="fr">Icône et métadonnées Nintendo 3DS</comment>
45
+ <acronym>SMDH</acronym>
46
+ <expanded-acronym>System Menu Data Header</expanded-acronym>
47
+ <glob pattern="*.smdh"/>
48
+ <magic><match value="SMDH" type="string" offset="0"/></magic>
49
+ </mime-type>
50
+
51
+ <mime-type type="application/x-ctr-cbmd">
52
+ <comment>Nintendo 3DS banner</comment>
53
+ <comment xml:lang="fr">Bannière Nintendo 3DS</comment>
54
+ <acronym>CBMD</acronym>
55
+ <expanded-acronym>CTR Banner Model Data</expanded-acronym>
56
+ <glob pattern="*.cbmd"/>
57
+ <magic><match value="CBMD" type="string" offset="0"/></magic>
58
+ </mime-type>
59
+ </mime-info>
Source Code/Citra/dist/compatibility_list/compatibility_list.qrc ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ <RCC>
2
+ <qresource prefix="compatibility_list">
3
+ <file>compatibility_list.json</file>
4
+ </qresource>
5
+ </RCC>
Source Code/Citra/dist/doc-icon.png ADDED
Source Code/Citra/dist/dumpkeys/DumpKeys.gm9 ADDED
@@ -0,0 +1,299 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ set PREVIEW_MODE "Key Dumper\n \nWorking..."
2
+
3
+ # Boot9
4
+
5
+ set BOOT9_BIN "M:/boot9.bin"
6
+
7
+ fget $[BOOT9_BIN]@D9D0:10 KEYX_2C
8
+ set KEYX_2D $[KEYX_2C]
9
+ set KEYX_2E $[KEYX_2C]
10
+ set KEYX_2F $[KEYX_2C]
11
+ fget $[BOOT9_BIN]@D9E0:10 KEYX_30
12
+ set KEYX_31 $[KEYX_30]
13
+ set KEYX_32 $[KEYX_30]
14
+ set KEYX_33 $[KEYX_30]
15
+ fget $[BOOT9_BIN]@D9F0:10 KEYX_34
16
+ set KEYX_35 $[KEYX_34]
17
+ set KEYX_36 $[KEYX_34]
18
+ set KEYX_37 $[KEYX_34]
19
+ fget $[BOOT9_BIN]@DA00:10 KEYX_38
20
+ set KEYX_39 $[KEYX_38]
21
+ set KEYX_3A $[KEYX_38]
22
+ set KEYX_3B $[KEYX_38]
23
+ fget $[BOOT9_BIN]@DA10:10 KEYX_3C
24
+ fget $[BOOT9_BIN]@DA20:10 KEYX_3D
25
+ fget $[BOOT9_BIN]@DA30:10 KEYX_3E
26
+ fget $[BOOT9_BIN]@DA40:10 KEYX_3F
27
+
28
+ fget $[BOOT9_BIN]@DA50:10 KEYY_04
29
+ fget $[BOOT9_BIN]@DA60:10 KEYY_05
30
+ fget $[BOOT9_BIN]@DA70:10 KEYY_06
31
+ fget $[BOOT9_BIN]@DA80:10 KEYY_07
32
+ fget $[BOOT9_BIN]@DA90:10 KEYY_08
33
+ fget $[BOOT9_BIN]@DAA0:10 KEYY_09
34
+ fget $[BOOT9_BIN]@DAB0:10 KEYY_0A
35
+ fget $[BOOT9_BIN]@DAC0:10 KEYY_0B
36
+
37
+ fget $[BOOT9_BIN]@DAD0:10 KEYN_0D
38
+ fget $[BOOT9_BIN]@DBA0:10 KEYN_2D
39
+ fget $[BOOT9_BIN]@DBB0:10 KEYN_32
40
+ fget $[BOOT9_BIN]@DBC0:10 KEYN_36
41
+ fget $[BOOT9_BIN]@DBD0:10 KEYN_38
42
+
43
+ # NATIVE_FIRM
44
+
45
+ if chk $[ONTYPE] "N3DS"
46
+ if not find 1:/title/00040138/20000002/content/????????.app NATIVE_FIRM_APP
47
+ echo "New 3DS NATIVE_FIRM not found."
48
+ goto Exit
49
+ end
50
+ set EXPECTED_NATIVE_FIRM_VER "1F00"
51
+ set KEYY_2E_OFFSET "66504"
52
+ set KEYY_39_NFC_OFFSET "66524"
53
+ set COMMON_0_OFFSET "6CE51"
54
+ set COMMON_1_OFFSET "6CE65"
55
+ set COMMON_2_OFFSET "6CE79"
56
+ set COMMON_3_OFFSET "6CE8D"
57
+ set COMMON_4_OFFSET "6CEA1"
58
+ set COMMON_5_OFFSET "6CEB5"
59
+ else
60
+ if not find 1:/title/00040138/00000002/content/????????.app NATIVE_FIRM_APP
61
+ echo "Old 3DS NATIVE_FIRM not found."
62
+ goto Exit
63
+ end
64
+ set EXPECTED_NATIVE_FIRM_VER "1F00"
65
+ set KEYY_2E_OFFSET "66488"
66
+ set KEYY_39_NFC_OFFSET "664A8"
67
+ set COMMON_0_OFFSET "6CDC1"
68
+ set COMMON_1_OFFSET "6CDD5"
69
+ set COMMON_2_OFFSET "6CDE9"
70
+ set COMMON_3_OFFSET "6CDFD"
71
+ set COMMON_4_OFFSET "6CE11"
72
+ set COMMON_5_OFFSET "6CE25"
73
+ end
74
+ set NATIVE_FIRM_EXTHEADER "G:/extheader.bin"
75
+ set NATIVE_FIRM_ENCRYPTED "G:/exefs/.firm"
76
+ set NATIVE_FIRM_DECRYPTED "$[GM9OUT]/native.firm"
77
+ set PROCESS9_CODE "G:/0004013000003000.Process9/exefs/.code"
78
+
79
+ imgmount $[NATIVE_FIRM_APP]
80
+
81
+ fget $[NATIVE_FIRM_EXTHEADER]@E:2 NATIVE_FIRM_VER
82
+ if not chk $[NATIVE_FIRM_VER] $[EXPECTED_NATIVE_FIRM_VER]
83
+ echo "Unsupported NATIVE_FIRM version.\nThis script requires the latest 3DS firmware.\n\nExpected $[EXPECTED_NATIVE_FIRM_VER], got $[NATIVE_FIRM_VER]"
84
+ goto Exit
85
+ end
86
+
87
+ cp -w $[NATIVE_FIRM_ENCRYPTED] $[NATIVE_FIRM_DECRYPTED]
88
+ decrypt $[NATIVE_FIRM_DECRYPTED]
89
+
90
+ imgumount
91
+
92
+ imgmount $[NATIVE_FIRM_DECRYPTED]
93
+
94
+ fget $[PROCESS9_CODE]@$[KEYY_2E_OFFSET]:10 KEYY_2E
95
+ set KEYY_31 $[KEYY_2E]
96
+ set KEYY_39_DLP $[KEYY_2E]
97
+ fget $[PROCESS9_CODE]@$[KEYY_39_NFC_OFFSET]:10 KEYY_39_NFC
98
+ fget $[PROCESS9_CODE]@$[COMMON_0_OFFSET]:10 COMMON_0
99
+ fget $[PROCESS9_CODE]@$[COMMON_1_OFFSET]:10 COMMON_1
100
+ fget $[PROCESS9_CODE]@$[COMMON_2_OFFSET]:10 COMMON_2
101
+ fget $[PROCESS9_CODE]@$[COMMON_3_OFFSET]:10 COMMON_3
102
+ fget $[PROCESS9_CODE]@$[COMMON_4_OFFSET]:10 COMMON_4
103
+ fget $[PROCESS9_CODE]@$[COMMON_5_OFFSET]:10 COMMON_5
104
+
105
+ imgumount
106
+ rm -o -s $[NATIVE_FIRM_DECRYPTED]
107
+
108
+ # NFC
109
+
110
+ if chk $[ONTYPE] "N3DS"
111
+ if not find 1:/title/00040130/20004002/content/????????.app NFC_APP
112
+ echo "New 3DS NFC not found."
113
+ goto Exit
114
+ end
115
+ set EXPECTED_NFC_VER "0700"
116
+ set NFC_PHRASE_0_OFFSET "355EE"
117
+ set NFC_SEED_0_OFFSET "355FC"
118
+ set NFC_HMAC_KEY_0_OFFSET "3560A"
119
+ set NFC_PHRASE_1_OFFSET "3561A"
120
+ set NFC_SEED_1_OFFSET "35628"
121
+ set NFC_HMAC_KEY_1_OFFSET "35638"
122
+ set NFC_IV_OFFSET "35648"
123
+ else
124
+ if not find 1:/title/00040130/00004002/content/????????.app NFC_APP
125
+ echo "Old 3DS NFC not found."
126
+ goto Exit
127
+ end
128
+ set EXPECTED_NFC_VER "0800"
129
+ set NFC_PHRASE_0_OFFSET "17382"
130
+ set NFC_SEED_0_OFFSET "17390"
131
+ set NFC_HMAC_KEY_0_OFFSET "1739E"
132
+ set NFC_PHRASE_1_OFFSET "173AE"
133
+ set NFC_SEED_1_OFFSET "173BC"
134
+ set NFC_HMAC_KEY_1_OFFSET "173CC"
135
+ set NFC_IV_OFFSET "173DC"
136
+ end
137
+ set NFC_EXTHEADER "G:/extheader.bin"
138
+ set NFC_CODE "$[GM9OUT]/nfc_code.bin"
139
+
140
+ imgmount $[NFC_APP]
141
+
142
+ fget $[NFC_EXTHEADER]@E:2 NFC_VER
143
+ if not chk $[NFC_VER] $[EXPECTED_NFC_VER]
144
+ echo "Unsupported NFC module version.\nThis script requires the latest 3DS firmware.\n\nExpected $[EXPECTED_NFC_VER], got $[NFC_VER]"
145
+ goto Exit
146
+ end
147
+
148
+ imgumount
149
+
150
+ extrcode $[NFC_APP] $[NFC_CODE]
151
+
152
+ fget $[NFC_CODE]@$[NFC_PHRASE_0_OFFSET]:E NFC_PHRASE_0
153
+ fget $[NFC_CODE]@$[NFC_SEED_0_OFFSET]:E NFC_SEED_0
154
+ fget $[NFC_CODE]@$[NFC_HMAC_KEY_0_OFFSET]:10 NFC_HMAC_KEY_0
155
+
156
+ fget $[NFC_CODE]@$[NFC_PHRASE_1_OFFSET]:E NFC_PHRASE_1
157
+ fget $[NFC_CODE]@$[NFC_SEED_1_OFFSET]:10 NFC_SEED_1
158
+ fget $[NFC_CODE]@$[NFC_HMAC_KEY_1_OFFSET]:10 NFC_HMAC_KEY_1
159
+
160
+ fget $[NFC_CODE]@$[NFC_IV_OFFSET]:10 NFC_IV
161
+
162
+ rm -o -s $[NFC_CODE]
163
+
164
+ # GodMode9 Key Database
165
+
166
+ set KEY_DB "V:/aeskeydb.bin"
167
+ set KEY_DB_18X "K:/slot0x18KeyX.ret.bin"
168
+ set KEY_DB_19X "K:/slot0x19KeyX.ret.bin"
169
+ set KEY_DB_1AX "K:/slot0x1AKeyX.ret.bin"
170
+ set KEY_DB_1BX "K:/slot0x1BKeyX.ret.bin"
171
+ set KEY_DB_1CX "K:/slot0x1CKeyX.ret.bin"
172
+ set KEY_DB_1DX "K:/slot0x1DKeyX.ret.bin"
173
+ set KEY_DB_1EX "K:/slot0x1EKeyX.ret.bin"
174
+ set KEY_DB_1FX "K:/slot0x1FKeyX.ret.bin"
175
+ set KEY_DB_25X "K:/slot0x25KeyX.ret.bin"
176
+ set KEY_DB_24Y "K:/slot0x24KeyY.bin"
177
+ set KEY_DB_2FY "K:/slot0x2FKeyY.ret.bin"
178
+
179
+ imgmount $[KEY_DB]
180
+
181
+ fget $[KEY_DB_18X]@0:10 KEYX_18
182
+ fget $[KEY_DB_19X]@0:10 KEYX_19
183
+ fget $[KEY_DB_1AX]@0:10 KEYX_1A
184
+ fget $[KEY_DB_1BX]@0:10 KEYX_1B
185
+ fget $[KEY_DB_1CX]@0:10 KEYX_1C
186
+ fget $[KEY_DB_1DX]@0:10 KEYX_1D
187
+ fget $[KEY_DB_1EX]@0:10 KEYX_1E
188
+ fget $[KEY_DB_1FX]@0:10 KEYX_1F
189
+ fget $[KEY_DB_25X]@0:10 KEYX_25
190
+
191
+ fget $[KEY_DB_24Y]@0:10 KEYY_24
192
+ fget $[KEY_DB_2FY]@0:10 KEYY_2F
193
+
194
+ imgumount
195
+
196
+ # Write Keys To File
197
+
198
+ set OUT "0:/gm9/aes_keys.txt"
199
+
200
+ dumptxt $[OUT] "# KeyX"
201
+ dumptxt -p $[OUT] ""
202
+
203
+ dumptxt -p $[OUT] "slot0x18KeyX=$[KEYX_18]"
204
+ dumptxt -p $[OUT] "slot0x19KeyX=$[KEYX_19]"
205
+ dumptxt -p $[OUT] "slot0x1AKeyX=$[KEYX_1A]"
206
+ dumptxt -p $[OUT] "slot0x1BKeyX=$[KEYX_1B]"
207
+ dumptxt -p $[OUT] "slot0x1CKeyX=$[KEYX_1C]"
208
+ dumptxt -p $[OUT] "slot0x1DKeyX=$[KEYX_1D]"
209
+ dumptxt -p $[OUT] "slot0x1EKeyX=$[KEYX_1E]"
210
+ dumptxt -p $[OUT] "slot0x1FKeyX=$[KEYX_1F]"
211
+ dumptxt -p $[OUT] "slot0x25KeyX=$[KEYX_25]"
212
+ dumptxt -p $[OUT] "slot0x2CKeyX=$[KEYX_2C]"
213
+ dumptxt -p $[OUT] "slot0x2DKeyX=$[KEYX_2D]"
214
+ dumptxt -p $[OUT] "slot0x2EKeyX=$[KEYX_2E]"
215
+ dumptxt -p $[OUT] "slot0x2FKeyX=$[KEYX_2F]"
216
+ dumptxt -p $[OUT] "slot0x30KeyX=$[KEYX_30]"
217
+ dumptxt -p $[OUT] "slot0x31KeyX=$[KEYX_31]"
218
+ dumptxt -p $[OUT] "slot0x32KeyX=$[KEYX_32]"
219
+ dumptxt -p $[OUT] "slot0x33KeyX=$[KEYX_33]"
220
+ dumptxt -p $[OUT] "slot0x34KeyX=$[KEYX_34]"
221
+ dumptxt -p $[OUT] "slot0x35KeyX=$[KEYX_35]"
222
+ dumptxt -p $[OUT] "slot0x36KeyX=$[KEYX_36]"
223
+ dumptxt -p $[OUT] "slot0x37KeyX=$[KEYX_37]"
224
+ dumptxt -p $[OUT] "slot0x38KeyX=$[KEYX_38]"
225
+ dumptxt -p $[OUT] "slot0x39KeyX=$[KEYX_39]"
226
+ dumptxt -p $[OUT] "slot0x3AKeyX=$[KEYX_3A]"
227
+ dumptxt -p $[OUT] "slot0x3BKeyX=$[KEYX_3B]"
228
+ dumptxt -p $[OUT] "slot0x3CKeyX=$[KEYX_3C]"
229
+ dumptxt -p $[OUT] "slot0x3DKeyX=$[KEYX_3D]"
230
+ dumptxt -p $[OUT] "slot0x3EKeyX=$[KEYX_3E]"
231
+ dumptxt -p $[OUT] "slot0x3FKeyX=$[KEYX_3F]"
232
+
233
+ dumptxt -p $[OUT] ""
234
+ dumptxt -p $[OUT] "# KeyY"
235
+ dumptxt -p $[OUT] ""
236
+
237
+ dumptxt -p $[OUT] "slot0x04KeyY=$[KEYY_04]"
238
+ dumptxt -p $[OUT] "slot0x05KeyY=$[KEYY_05]"
239
+ dumptxt -p $[OUT] "slot0x06KeyY=$[KEYY_06]"
240
+ dumptxt -p $[OUT] "slot0x07KeyY=$[KEYY_07]"
241
+ dumptxt -p $[OUT] "slot0x08KeyY=$[KEYY_08]"
242
+ dumptxt -p $[OUT] "slot0x09KeyY=$[KEYY_09]"
243
+ dumptxt -p $[OUT] "slot0x0AKeyY=$[KEYY_0A]"
244
+ dumptxt -p $[OUT] "slot0x0BKeyY=$[KEYY_0B]"
245
+ dumptxt -p $[OUT] "slot0x24KeyY=$[KEYY_24]"
246
+ dumptxt -p $[OUT] "slot0x2EKeyY=$[KEYY_2E]"
247
+ dumptxt -p $[OUT] "slot0x2FKeyY=$[KEYY_2F]"
248
+ dumptxt -p $[OUT] "slot0x31KeyY=$[KEYY_31]"
249
+
250
+ dumptxt -p $[OUT] ""
251
+ dumptxt -p $[OUT] "# DLP/NFC KeyY (slot 0x39)"
252
+ dumptxt -p $[OUT] ""
253
+
254
+ dumptxt -p $[OUT] "dlpKeyY=$[KEYY_39_DLP]"
255
+ dumptxt -p $[OUT] "nfcKeyY=$[KEYY_39_NFC]"
256
+
257
+ dumptxt -p $[OUT] ""
258
+ dumptxt -p $[OUT] "# Ticket Common KeyY (slot 0x3D)"
259
+ dumptxt -p $[OUT] ""
260
+
261
+ dumptxt -p $[OUT] "common0=$[COMMON_0]"
262
+ dumptxt -p $[OUT] "common1=$[COMMON_1]"
263
+ dumptxt -p $[OUT] "common2=$[COMMON_2]"
264
+ dumptxt -p $[OUT] "common3=$[COMMON_3]"
265
+ dumptxt -p $[OUT] "common4=$[COMMON_4]"
266
+ dumptxt -p $[OUT] "common5=$[COMMON_5]"
267
+
268
+ dumptxt -p $[OUT] ""
269
+ dumptxt -p $[OUT] "# KeyN"
270
+ dumptxt -p $[OUT] ""
271
+
272
+ dumptxt -p $[OUT] "slot0x0DKeyN=$[KEYN_0D]"
273
+ dumptxt -p $[OUT] "slot0x2DKeyN=$[KEYN_2D]"
274
+ dumptxt -p $[OUT] "slot0x32KeyN=$[KEYN_32]"
275
+ dumptxt -p $[OUT] "slot0x36KeyN=$[KEYN_36]"
276
+ dumptxt -p $[OUT] "slot0x38KeyN=$[KEYN_38]"
277
+
278
+ dumptxt -p $[OUT] ""
279
+ dumptxt -p $[OUT] "# NFC Secrets"
280
+ dumptxt -p $[OUT] ""
281
+
282
+ dumptxt -p $[OUT] "nfcSecret0Phrase=$[NFC_PHRASE_0]"
283
+ dumptxt -p $[OUT] "nfcSecret0Seed=$[NFC_SEED_0]"
284
+ dumptxt -p $[OUT] "nfcSecret0HmacKey=$[NFC_HMAC_KEY_0]"
285
+ dumptxt -p $[OUT] "nfcSecret1Phrase=$[NFC_PHRASE_1]"
286
+ dumptxt -p $[OUT] "nfcSecret1Seed=$[NFC_SEED_1]"
287
+ dumptxt -p $[OUT] "nfcSecret1HmacKey=$[NFC_HMAC_KEY_1]"
288
+ dumptxt -p $[OUT] "nfcIv=$[NFC_IV]"
289
+
290
+ # Dump seeddb.bin as well
291
+
292
+ set SEEDDB_IN "0:/gm9/out/seeddb.bin"
293
+ set SEEDDB_OUT "0:/gm9/seeddb.bin"
294
+
295
+ sdump -w seeddb.bin
296
+ cp -w $[SEEDDB_IN] $[SEEDDB_OUT]
297
+
298
+ @Exit
299
+
Source Code/Citra/dist/dumpkeys/README.md ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ # DumpKeys
2
+
3
+ This is a GodMode9 script that dumps all the keys and other related secrets that Citra needs from a real 3DS.
4
+
5
+ Usage:
6
+ 1. Copy "DumpKeys.gm9" into the "gm9/scripts/" directory on your SD card.
7
+ 2. Launch GodMode9, press the HOME button, select Scripts, and select "DumpKeys" from the list of scripts that appears.
8
+ 3. Wait for the script to complete and return you to the GodMode9 main menu.
9
+ 4. Power off your system and copy the "gm9/aes_keys.txt" and "gm9/seeddb.bin" files off of your SD card into "(Citra directory)/sysdata/".
10
+
Source Code/Citra/dist/icon.png ADDED
Source Code/Citra/dist/installer/CMakeLists.txt ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ if(WIN32)
3
+ set(PLATFORM "windows")
4
+ elseif(APPLE)
5
+ set(PLATFORM "mac")
6
+ elseif(UNIX)
7
+ set(PLATFORM "linux")
8
+ else()
9
+ message(FATAL_ERROR "Cannot build installer for this unsupported platform")
10
+ endif()
11
+
12
+ set(BUILD_DIR "${CMAKE_BINARY_DIR}/installer")
13
+ set(DIST_DIR "${BUILD_DIR}/dist")
14
+ set(TARGET_FILE "${DIST_DIR}/citra-setup-${PLATFORM}")
15
+
16
+ file(MAKE_DIRECTORY "${BUILD_DIR}" "${DIST_DIR}")
17
+
18
+ # Adds a custom target that will run the BuildInstaller.cmake file
19
+ # CMake can't just run a cmake function as a custom command, so this is a way around it.
20
+ # Calls the cmake command and runs a cmake file in "scripting" mode passing in variables with -D
21
+ add_custom_command(OUTPUT "${TARGET_FILE}"
22
+ COMMAND ${CMAKE_COMMAND}
23
+ -DBASE_DIR=${CMAKE_SOURCE_DIR}
24
+ -DSRC_DIR=${CMAKE_CURRENT_SOURCE_DIR}
25
+ -DBUILD_DIR=${BUILD_DIR}
26
+ -DTARGET_FILE=${TARGET_FILE}
27
+ -P ${CMAKE_SOURCE_DIR}/CMakeModules/BuildInstaller.cmake
28
+ WORKING_DIRECTORY ${BUILD_DIR}
29
+ )
30
+
31
+ add_custom_target(installer DEPENDS ${TARGET_FILE})
Source Code/Citra/dist/installer/README.md ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ Citra Qt Installer
2
+ ==================
3
+
4
+ This contains the configuration files for building Citra's installer.
5
+
6
+ Installers can only be built on the platform that they are targeting.
7
+
8
+ Build the `installer` target to generate the installer, and the installer will be in
9
+ ${build_dir}/installer/dist/
Source Code/Citra/dist/installer/config/config_linux.xml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Installer>
3
+ <Name>Citra</Name>
4
+ <Version>1.0.0</Version>
5
+ <Title>Citra Updater</Title>
6
+ <Publisher>Citra Team</Publisher>
7
+ <!-- e.g. /home/<user>/.citra or /opt/citra if run as root -->
8
+ <TargetDir>@HomeDir@/.citra</TargetDir>
9
+ <AdminTargetDir>/opt/citra</AdminTargetDir>
10
+ <InstallerApplicationIcon>icon</InstallerApplicationIcon>
11
+ <InstallerWindowIcon>icon.png</InstallerWindowIcon>
12
+ <RemoteRepositories>
13
+ <Repository>
14
+ <Url>https://repo.citra-emu.org</Url>
15
+ <Enabled>1</Enabled>
16
+ <DisplayName>Official Citra Repository</DisplayName>
17
+ </Repository>
18
+ </RemoteRepositories>
19
+ </Installer>
Source Code/Citra/dist/installer/config/config_mac.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Installer>
3
+ <Name>Citra</Name>
4
+ <Version>1.0.0</Version>
5
+ <Title>Citra Updater</Title>
6
+ <Publisher>Citra Team</Publisher>
7
+ <!-- e.g. /Applications/Citra -->
8
+ <TargetDir>@ApplicationsDir@/Citra</TargetDir>
9
+ <InstallerApplicationIcon>icon</InstallerApplicationIcon>
10
+ <InstallerWindowIcon>icon.png</InstallerWindowIcon>
11
+ <RemoteRepositories>
12
+ <Repository>
13
+ <Url>https://repo.citra-emu.org</Url>
14
+ <Enabled>1</Enabled>
15
+ <DisplayName>Official Citra Repository</DisplayName>
16
+ </Repository>
17
+ </RemoteRepositories>
18
+ </Installer>
Source Code/Citra/dist/installer/config/config_windows.xml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Installer>
3
+ <Name>Citra</Name>
4
+ <Version>1.0.0</Version>
5
+ <Title>Citra Updater</Title>
6
+ <Publisher>Citra Team</Publisher>
7
+ <StartMenuDir>Citra</StartMenuDir>
8
+ <!-- e.g. C:\home\<user>\AppData\Local\Citra -->
9
+ <TargetDir>@HomeDir@/AppData/Local/Citra</TargetDir>
10
+ <InstallerApplicationIcon>icon</InstallerApplicationIcon>
11
+ <InstallerWindowIcon>icon.png</InstallerWindowIcon>
12
+ <RemoteRepositories>
13
+ <Repository>
14
+ <Url>https://repo.citra-emu.org</Url>
15
+ <Enabled>1</Enabled>
16
+ <DisplayName>Official Citra Repository</DisplayName>
17
+ </Repository>
18
+ </RemoteRepositories>
19
+ </Installer>
Source Code/Citra/dist/installer/config/icon.icns ADDED
Binary file (229 kB). View file
 
Source Code/Citra/dist/installer/config/icon.ico ADDED
Source Code/Citra/dist/installer/config/icon.png ADDED
Source Code/Citra/dist/languages/.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ # Ignore the source language file
2
+ en.ts
3
+
Source Code/Citra/dist/languages/.tx/config ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [main]
2
+ host = https://www.transifex.com
3
+
4
+ [o:citra:p:citra:r:emulator]
5
+ file_filter = <lang>.ts
6
+ source_file = en.ts
7
+ source_lang = en
8
+ type = QT
9
+
10
+ [o:citra:p:citra:r:android]
11
+ file_filter = ../../src/android/app/src/main/res/values-<lang>/strings.xml
12
+ source_file = ../../src/android/app/src/main/res/values/strings.xml
13
+ type = ANDROID
14
+ lang_map = es_ES:es, hu_HU:hu, ru_RU:ru, pt_BR:pt, zh_CN:zh
Source Code/Citra/dist/languages/README.md ADDED
@@ -0,0 +1 @@
 
 
1
+ This directory stores translation patches (TS files) for citra Qt frontend. This directory is linked with [citra project on transifex](https://www.transifex.com/citra/citra), so you can update the translation by executing `tx pull -a`. If you want to contribute to the translation, please go the transifex link and submit your translation there. This directory on the main repo will be synchronized with transifex periodically. Do not directly open PRs on github to modify the translation.
Source Code/Citra/dist/languages/da_DK.ts ADDED
The diff for this file is too large to render. See raw diff
 
Source Code/Citra/dist/languages/de.ts ADDED
The diff for this file is too large to render. See raw diff
 
Source Code/Citra/dist/languages/el.ts ADDED
The diff for this file is too large to render. See raw diff