summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt3
-rw-r--r--src/citra/CMakeLists.txt2
-rw-r--r--src/citra_qt/CMakeLists.txt24
-rw-r--r--src/common/file_util.cpp2
-rw-r--r--src/common/swap.h26
-rw-r--r--src/core/arm/interpreter/armdefs.h2
-rw-r--r--src/core/file_sys/meta_file_system.cpp42
-rw-r--r--src/core/file_sys/meta_file_system.h2
8 files changed, 53 insertions, 50 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0816147b8..e0227dc53 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,7 +1,8 @@
1add_subdirectory(common) 1add_subdirectory(common)
2add_subdirectory(core) 2add_subdirectory(core)
3add_subdirectory(citra)
4add_subdirectory(video_core) 3add_subdirectory(video_core)
4add_subdirectory(citra)
5add_subdirectory(citra_qt)
5 6
6if(QT4_FOUND AND QT_QTCORE_FOUND AND QT_QTGUI_FOUND AND QT_QTOPENGL_FOUND AND NOT DISABLE_QT4) 7if(QT4_FOUND AND QT_QTCORE_FOUND AND QT_QTGUI_FOUND AND QT_QTOPENGL_FOUND AND NOT DISABLE_QT4)
7 #add_subdirectory(citra_qt) 8 #add_subdirectory(citra_qt)
diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt
index c6913df57..9b8c3936a 100644
--- a/src/citra/CMakeLists.txt
+++ b/src/citra/CMakeLists.txt
@@ -7,6 +7,6 @@ if (NOT X11_xf86vmode_LIB)
7endif() 7endif()
8 8
9add_executable(citra ${SRCS}) 9add_executable(citra ${SRCS})
10target_link_libraries(citra core common ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES} GLEW rt ${X11_Xrandr_LIB} ${X11_xv86vmode_LIB}) 10target_link_libraries(citra core common video_core GLEW glfw3 pthread X11 Xxf86vm Xi ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES} rt ${X11_Xrandr_LIB} ${X11_xv86vmode_LIB})
11 11
12#install(TARGETS citra RUNTIME DESTINATION ${bindir}) 12#install(TARGETS citra RUNTIME DESTINATION ${bindir})
diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt
index 2b9d4b93c..594460a71 100644
--- a/src/citra_qt/CMakeLists.txt
+++ b/src/citra_qt/CMakeLists.txt
@@ -1,30 +1,30 @@
1set(SRCS 1set(SRCS
2 bootmanager.cpp 2 bootmanager.cpp
3 callstack.cpp 3 debugger/callstack.cpp
4 disassembler.cpp 4 debugger/disassembler.cpp
5 registers.cpp 5 debugger/ramview.cpp
6 debugger/registers.cpp
6 hotkeys.cpp 7 hotkeys.cpp
7 main.cpp 8 main.cpp
8 ramview.cpp
9 config/controller_config.cpp 9 config/controller_config.cpp
10 config/controller_config_util.cpp) 10 config/controller_config_util.cpp)
11 11
12qt4_wrap_ui(UI_HDRS 12qt4_wrap_ui(UI_HDRS
13 callstack.ui 13 debugger/callstack.ui
14 disassembler.ui 14 debugger/disassembler.ui
15 registers.ui 15 debugger/registers.ui
16 hotkeys.ui 16 hotkeys.ui
17 main.ui 17 main.ui
18 config/controller_config.ui) 18 config/controller_config.ui)
19 19
20qt4_wrap_cpp(MOC_SRCS 20qt4_wrap_cpp(MOC_SRCS
21 bootmanager.hxx 21 bootmanager.hxx
22 callstack.hxx 22 debugger/callstack.hxx
23 disassembler.hxx 23 debugger/disassembler.hxx
24 registers.hxx 24 debugger/registers.hxx
25 debugger/ramview.hxx
25 hotkeys.hxx 26 hotkeys.hxx
26 main.hxx 27 main.hxx
27 ramview.hxx
28 config/controller_config.hxx 28 config/controller_config.hxx
29 config/controller_config_util.hxx) 29 config/controller_config_util.hxx)
30 30
@@ -33,6 +33,6 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
33include_directories(./) 33include_directories(./)
34 34
35add_executable(citra-qt ${SRCS} ${MOC_SRCS} ${UI_HDRS}) 35add_executable(citra-qt ${SRCS} ${MOC_SRCS} ${UI_HDRS})
36target_link_libraries(citra-qt core common qhexedit ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${SDL2_LIBRARY} rt GLEW ${GLFW_LIBRARIES}) 36target_link_libraries(citra-qt core common video_core qhexedit ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${SDL2_LIBRARY} rt GLEW ${GLFW_LIBRARIES})
37 37
38#install(TARGETS citra-qt RUNTIME DESTINATION ${bindir}) 38#install(TARGETS citra-qt RUNTIME DESTINATION ${bindir})
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index d36304d91..47ad964db 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -672,7 +672,7 @@ const std::string& GetUserPath(const unsigned int DirIDX, const std::string &new
672 else 672 else
673 paths[D_USER_IDX] = std::string(getenv("HOME") ? 673 paths[D_USER_IDX] = std::string(getenv("HOME") ?
674 getenv("HOME") : getenv("PWD") ? 674 getenv("HOME") : getenv("PWD") ?
675 getenv("PWD") : "") + DIR_SEP DOLPHIN_DATA_DIR DIR_SEP; 675 getenv("PWD") : "") + DIR_SEP EMU_DATA_DIR DIR_SEP;
676#endif 676#endif
677 677
678 paths[D_CONFIG_IDX] = paths[D_USER_IDX] + CONFIG_DIR DIR_SEP; 678 paths[D_CONFIG_IDX] = paths[D_USER_IDX] + CONFIG_DIR DIR_SEP;
diff --git a/src/common/swap.h b/src/common/swap.h
index d07d9fcc5..123019fd1 100644
--- a/src/common/swap.h
+++ b/src/common/swap.h
@@ -497,27 +497,27 @@ typedef s64 s64_le;
497typedef float float_le; 497typedef float float_le;
498typedef double double_le; 498typedef double double_le;
499 499
500typedef swap_struct_t<u64, swap_64_t<u64>> u64_be; 500typedef swap_struct_t<u64, swap_64_t<u64> > u64_be;
501typedef swap_struct_t<s64, swap_64_t<s64>> s64_be; 501typedef swap_struct_t<s64, swap_64_t<s64> > s64_be;
502 502
503typedef swap_struct_t<u32, swap_32_t<u32>> u32_be; 503typedef swap_struct_t<u32, swap_32_t<u32> > u32_be;
504typedef swap_struct_t<s32, swap_32_t<s32>> s32_be; 504typedef swap_struct_t<s32, swap_32_t<s32> > s32_be;
505 505
506typedef swap_struct_t<u16, swap_16_t<u16>> u16_be; 506typedef swap_struct_t<u16, swap_16_t<u16> > u16_be;
507typedef swap_struct_t<s16, swap_16_t<s16>> s16_be; 507typedef swap_struct_t<s16, swap_16_t<s16> > s16_be;
508 508
509typedef swap_struct_t<float, swap_float_t<float> > float_be; 509typedef swap_struct_t<float, swap_float_t<float> > float_be;
510typedef swap_struct_t<double, swap_double_t<double> > double_be; 510typedef swap_struct_t<double, swap_double_t<double> > double_be;
511#else 511#else
512 512
513typedef swap_struct_t<u64, swap_64_t<u64>> u64_le; 513typedef swap_struct_t<u64, swap_64_t<u64> > u64_le;
514typedef swap_struct_t<s64, swap_64_t<s64>> s64_le; 514typedef swap_struct_t<s64, swap_64_t<s64> > s64_le;
515 515
516typedef swap_struct_t<u32, swap_32_t<u32>> u32_le; 516typedef swap_struct_t<u32, swap_32_t<u32> > u32_le;
517typedef swap_struct_t<s32, swap_32_t<s32>> s32_le; 517typedef swap_struct_t<s32, swap_32_t<s32> > s32_le;
518 518
519typedef swap_struct_t<u16, swap_16_t<u16>> u16_le; 519typedef swap_struct_t<u16, swap_16_t<u16> > u16_le;
520typedef swap_struct_t<s16, swap_16_t<s16>> s16_le; 520typedef swap_struct_t< s16, swap_16_t<s16> > s16_le;
521 521
522typedef swap_struct_t<float, swap_float_t<float> > float_le; 522typedef swap_struct_t<float, swap_float_t<float> > float_le;
523typedef swap_struct_t<double, swap_double_t<double> > double_le; 523typedef swap_struct_t<double, swap_double_t<double> > double_le;
@@ -532,4 +532,4 @@ typedef s64 s64_be;
532 532
533typedef float float_be; 533typedef float float_be;
534typedef double double_be; 534typedef double double_be;
535#endif \ No newline at end of file 535#endif
diff --git a/src/core/arm/interpreter/armdefs.h b/src/core/arm/interpreter/armdefs.h
index 30b5b689c..821825ae6 100644
--- a/src/core/arm/interpreter/armdefs.h
+++ b/src/core/arm/interpreter/armdefs.h
@@ -22,6 +22,8 @@
22#include <stdlib.h> 22#include <stdlib.h>
23#include <errno.h> 23#include <errno.h>
24 24
25#include "common/platform.h"
26
25#if EMU_PLATFORM == PLATFORM_WINDOWS 27#if EMU_PLATFORM == PLATFORM_WINDOWS
26#include <windows.h> 28#include <windows.h>
27#endif 29#endif
diff --git a/src/core/file_sys/meta_file_system.cpp b/src/core/file_sys/meta_file_system.cpp
index 01048e498..4347ff451 100644
--- a/src/core/file_sys/meta_file_system.cpp
+++ b/src/core/file_sys/meta_file_system.cpp
@@ -161,7 +161,7 @@ static bool RealPath(const std::string &currentDirectory, const std::string &inP
161 161
162IFileSystem *MetaFileSystem::GetHandleOwner(u32 handle) 162IFileSystem *MetaFileSystem::GetHandleOwner(u32 handle)
163{ 163{
164 std::lock_guard<std::mutex> guard(lock); 164 std::lock_guard<std::recursive_mutex> guard(lock);
165 for (size_t i = 0; i < fileSystems.size(); i++) 165 for (size_t i = 0; i < fileSystems.size(); i++)
166 { 166 {
167 if (fileSystems[i].system->OwnsHandle(handle)) 167 if (fileSystems[i].system->OwnsHandle(handle))
@@ -173,7 +173,7 @@ IFileSystem *MetaFileSystem::GetHandleOwner(u32 handle)
173 173
174bool MetaFileSystem::MapFilePath(const std::string &_inpath, std::string &outpath, MountPoint **system) 174bool MetaFileSystem::MapFilePath(const std::string &_inpath, std::string &outpath, MountPoint **system)
175{ 175{
176 std::lock_guard<std::mutex> guard(lock); 176 std::lock_guard<std::recursive_mutex> guard(lock);
177 std::string realpath; 177 std::string realpath;
178 178
179 // Special handling: host0:command.txt (as seen in Super Monkey Ball Adventures, for example) 179 // Special handling: host0:command.txt (as seen in Super Monkey Ball Adventures, for example)
@@ -227,7 +227,7 @@ bool MetaFileSystem::MapFilePath(const std::string &_inpath, std::string &outpat
227 227
228void MetaFileSystem::Mount(std::string prefix, IFileSystem *system) 228void MetaFileSystem::Mount(std::string prefix, IFileSystem *system)
229{ 229{
230 std::lock_guard<std::mutex> guard(lock); 230 std::lock_guard<std::recursive_mutex> guard(lock);
231 MountPoint x; 231 MountPoint x;
232 x.prefix = prefix; 232 x.prefix = prefix;
233 x.system = system; 233 x.system = system;
@@ -236,7 +236,7 @@ void MetaFileSystem::Mount(std::string prefix, IFileSystem *system)
236 236
237void MetaFileSystem::Unmount(std::string prefix, IFileSystem *system) 237void MetaFileSystem::Unmount(std::string prefix, IFileSystem *system)
238{ 238{
239 std::lock_guard<std::mutex> guard(lock); 239 std::lock_guard<std::recursive_mutex> guard(lock);
240 MountPoint x; 240 MountPoint x;
241 x.prefix = prefix; 241 x.prefix = prefix;
242 x.system = system; 242 x.system = system;
@@ -245,7 +245,7 @@ void MetaFileSystem::Unmount(std::string prefix, IFileSystem *system)
245 245
246void MetaFileSystem::Shutdown() 246void MetaFileSystem::Shutdown()
247{ 247{
248 std::lock_guard<std::mutex> guard(lock); 248 std::lock_guard<std::recursive_mutex> guard(lock);
249 current = 6; 249 current = 6;
250 250
251 // Ownership is a bit convoluted. Let's just delete everything once. 251 // Ownership is a bit convoluted. Let's just delete everything once.
@@ -267,7 +267,7 @@ void MetaFileSystem::Shutdown()
267 267
268u32 MetaFileSystem::OpenWithError(int &error, std::string filename, FileAccess access, const char *devicename) 268u32 MetaFileSystem::OpenWithError(int &error, std::string filename, FileAccess access, const char *devicename)
269{ 269{
270 std::lock_guard<std::mutex> guard(lock); 270 std::lock_guard<std::recursive_mutex> guard(lock);
271 u32 h = OpenFile(filename, access, devicename); 271 u32 h = OpenFile(filename, access, devicename);
272 error = lastOpenError; 272 error = lastOpenError;
273 return h; 273 return h;
@@ -275,7 +275,7 @@ u32 MetaFileSystem::OpenWithError(int &error, std::string filename, FileAccess a
275 275
276u32 MetaFileSystem::OpenFile(std::string filename, FileAccess access, const char *devicename) 276u32 MetaFileSystem::OpenFile(std::string filename, FileAccess access, const char *devicename)
277{ 277{
278 std::lock_guard<std::mutex> guard(lock); 278 std::lock_guard<std::recursive_mutex> guard(lock);
279 lastOpenError = 0; 279 lastOpenError = 0;
280 std::string of; 280 std::string of;
281 MountPoint *mount; 281 MountPoint *mount;
@@ -291,7 +291,7 @@ u32 MetaFileSystem::OpenFile(std::string filename, FileAccess access, const char
291 291
292FileInfo MetaFileSystem::GetFileInfo(std::string filename) 292FileInfo MetaFileSystem::GetFileInfo(std::string filename)
293{ 293{
294 std::lock_guard<std::mutex> guard(lock); 294 std::lock_guard<std::recursive_mutex> guard(lock);
295 std::string of; 295 std::string of;
296 IFileSystem *system; 296 IFileSystem *system;
297 if (MapFilePath(filename, of, &system)) 297 if (MapFilePath(filename, of, &system))
@@ -307,7 +307,7 @@ FileInfo MetaFileSystem::GetFileInfo(std::string filename)
307 307
308bool MetaFileSystem::GetHostPath(const std::string &inpath, std::string &outpath) 308bool MetaFileSystem::GetHostPath(const std::string &inpath, std::string &outpath)
309{ 309{
310 std::lock_guard<std::mutex> guard(lock); 310 std::lock_guard<std::recursive_mutex> guard(lock);
311 std::string of; 311 std::string of;
312 IFileSystem *system; 312 IFileSystem *system;
313 if (MapFilePath(inpath, of, &system)) { 313 if (MapFilePath(inpath, of, &system)) {
@@ -319,7 +319,7 @@ bool MetaFileSystem::GetHostPath(const std::string &inpath, std::string &outpath
319 319
320std::vector<FileInfo> MetaFileSystem::GetDirListing(std::string path) 320std::vector<FileInfo> MetaFileSystem::GetDirListing(std::string path)
321{ 321{
322 std::lock_guard<std::mutex> guard(lock); 322 std::lock_guard<std::recursive_mutex> guard(lock);
323 std::string of; 323 std::string of;
324 IFileSystem *system; 324 IFileSystem *system;
325 if (MapFilePath(path, of, &system)) 325 if (MapFilePath(path, of, &system))
@@ -335,13 +335,13 @@ std::vector<FileInfo> MetaFileSystem::GetDirListing(std::string path)
335 335
336void MetaFileSystem::ThreadEnded(int threadID) 336void MetaFileSystem::ThreadEnded(int threadID)
337{ 337{
338 std::lock_guard<std::mutex> guard(lock); 338 std::lock_guard<std::recursive_mutex> guard(lock);
339 currentDir.erase(threadID); 339 currentDir.erase(threadID);
340} 340}
341 341
342int MetaFileSystem::ChDir(const std::string &dir) 342int MetaFileSystem::ChDir(const std::string &dir)
343{ 343{
344 std::lock_guard<std::mutex> guard(lock); 344 std::lock_guard<std::recursive_mutex> guard(lock);
345 // Retain the old path and fail if the arg is 1023 bytes or longer. 345 // Retain the old path and fail if the arg is 1023 bytes or longer.
346 if (dir.size() >= 1023) 346 if (dir.size() >= 1023)
347 return -1;//SCE_KERNEL_ERROR_NAMETOOLONG; 347 return -1;//SCE_KERNEL_ERROR_NAMETOOLONG;
@@ -378,7 +378,7 @@ int MetaFileSystem::ChDir(const std::string &dir)
378 378
379bool MetaFileSystem::MkDir(const std::string &dirname) 379bool MetaFileSystem::MkDir(const std::string &dirname)
380{ 380{
381 std::lock_guard<std::mutex> guard(lock); 381 std::lock_guard<std::recursive_mutex> guard(lock);
382 std::string of; 382 std::string of;
383 IFileSystem *system; 383 IFileSystem *system;
384 if (MapFilePath(dirname, of, &system)) 384 if (MapFilePath(dirname, of, &system))
@@ -393,7 +393,7 @@ bool MetaFileSystem::MkDir(const std::string &dirname)
393 393
394bool MetaFileSystem::RmDir(const std::string &dirname) 394bool MetaFileSystem::RmDir(const std::string &dirname)
395{ 395{
396 std::lock_guard<std::mutex> guard(lock); 396 std::lock_guard<std::recursive_mutex> guard(lock);
397 std::string of; 397 std::string of;
398 IFileSystem *system; 398 IFileSystem *system;
399 if (MapFilePath(dirname, of, &system)) 399 if (MapFilePath(dirname, of, &system))
@@ -408,7 +408,7 @@ bool MetaFileSystem::RmDir(const std::string &dirname)
408 408
409int MetaFileSystem::RenameFile(const std::string &from, const std::string &to) 409int MetaFileSystem::RenameFile(const std::string &from, const std::string &to)
410{ 410{
411 std::lock_guard<std::mutex> guard(lock); 411 std::lock_guard<std::recursive_mutex> guard(lock);
412 std::string of; 412 std::string of;
413 std::string rf; 413 std::string rf;
414 IFileSystem *osystem; 414 IFileSystem *osystem;
@@ -440,7 +440,7 @@ int MetaFileSystem::RenameFile(const std::string &from, const std::string &to)
440 440
441bool MetaFileSystem::RemoveFile(const std::string &filename) 441bool MetaFileSystem::RemoveFile(const std::string &filename)
442{ 442{
443 std::lock_guard<std::mutex> guard(lock); 443 std::lock_guard<std::recursive_mutex> guard(lock);
444 std::string of; 444 std::string of;
445 IFileSystem *system; 445 IFileSystem *system;
446 if (MapFilePath(filename, of, &system)) 446 if (MapFilePath(filename, of, &system))
@@ -455,7 +455,7 @@ bool MetaFileSystem::RemoveFile(const std::string &filename)
455 455
456void MetaFileSystem::CloseFile(u32 handle) 456void MetaFileSystem::CloseFile(u32 handle)
457{ 457{
458 std::lock_guard<std::mutex> guard(lock); 458 std::lock_guard<std::recursive_mutex> guard(lock);
459 IFileSystem *sys = GetHandleOwner(handle); 459 IFileSystem *sys = GetHandleOwner(handle);
460 if (sys) 460 if (sys)
461 sys->CloseFile(handle); 461 sys->CloseFile(handle);
@@ -463,7 +463,7 @@ void MetaFileSystem::CloseFile(u32 handle)
463 463
464size_t MetaFileSystem::ReadFile(u32 handle, u8 *pointer, s64 size) 464size_t MetaFileSystem::ReadFile(u32 handle, u8 *pointer, s64 size)
465{ 465{
466 std::lock_guard<std::mutex> guard(lock); 466 std::lock_guard<std::recursive_mutex> guard(lock);
467 IFileSystem *sys = GetHandleOwner(handle); 467 IFileSystem *sys = GetHandleOwner(handle);
468 if (sys) 468 if (sys)
469 return sys->ReadFile(handle,pointer,size); 469 return sys->ReadFile(handle,pointer,size);
@@ -473,7 +473,7 @@ size_t MetaFileSystem::ReadFile(u32 handle, u8 *pointer, s64 size)
473 473
474size_t MetaFileSystem::WriteFile(u32 handle, const u8 *pointer, s64 size) 474size_t MetaFileSystem::WriteFile(u32 handle, const u8 *pointer, s64 size)
475{ 475{
476 std::lock_guard<std::mutex> guard(lock); 476 std::lock_guard<std::recursive_mutex> guard(lock);
477 IFileSystem *sys = GetHandleOwner(handle); 477 IFileSystem *sys = GetHandleOwner(handle);
478 if (sys) 478 if (sys)
479 return sys->WriteFile(handle,pointer,size); 479 return sys->WriteFile(handle,pointer,size);
@@ -483,7 +483,7 @@ size_t MetaFileSystem::WriteFile(u32 handle, const u8 *pointer, s64 size)
483 483
484size_t MetaFileSystem::SeekFile(u32 handle, s32 position, FileMove type) 484size_t MetaFileSystem::SeekFile(u32 handle, s32 position, FileMove type)
485{ 485{
486 std::lock_guard<std::mutex> guard(lock); 486 std::lock_guard<std::recursive_mutex> guard(lock);
487 IFileSystem *sys = GetHandleOwner(handle); 487 IFileSystem *sys = GetHandleOwner(handle);
488 if (sys) 488 if (sys)
489 return sys->SeekFile(handle,position,type); 489 return sys->SeekFile(handle,position,type);
@@ -493,7 +493,7 @@ size_t MetaFileSystem::SeekFile(u32 handle, s32 position, FileMove type)
493 493
494void MetaFileSystem::DoState(PointerWrap &p) 494void MetaFileSystem::DoState(PointerWrap &p)
495{ 495{
496 std::lock_guard<std::mutex> guard(lock); 496 std::lock_guard<std::recursive_mutex> guard(lock);
497 497
498 auto s = p.Section("MetaFileSystem", 1); 498 auto s = p.Section("MetaFileSystem", 1);
499 if (!s) 499 if (!s)
diff --git a/src/core/file_sys/meta_file_system.h b/src/core/file_sys/meta_file_system.h
index 961f75cda..f358d8d5c 100644
--- a/src/core/file_sys/meta_file_system.h
+++ b/src/core/file_sys/meta_file_system.h
@@ -104,7 +104,7 @@ public:
104 // TODO: void IoCtl(...) 104 // TODO: void IoCtl(...)
105 105
106 void SetStartingDirectory(const std::string &dir) { 106 void SetStartingDirectory(const std::string &dir) {
107 std::lock_guard<std::mutex> guard(lock); 107 std::lock_guard<std::recursive_mutex> guard(lock);
108 startingDirectory = dir; 108 startingDirectory = dir;
109 } 109 }
110}; 110};