diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e85476753..133e689613 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -413,6 +413,12 @@ include_directories("${PROJECT_BINARY_DIR}/Source/Core/Common/Src") add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE) +######################################## +# Optional Targets +# TODO: Add DSPSpy and TestSuite. +option(DSPTOOL "Build dsptool" OFF) +option(UNITTESTS "Build unitests" OFF) + ######################################## # Start compiling our code # diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index a70e15211f..97f8642fe1 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -1,3 +1,12 @@ add_subdirectory(Core) add_subdirectory(Plugins) -# TODO: Add DSPSpy, DSPTool, TestSuite and UnitTests. Preferrably make them option()s and cpack components + +if (DSPTOOL) + add_subdirectory(DSPTool) +endif() + +if (UNITTESTS) + add_subdirectory(UnitTests) +endif() + +# TODO: Add DSPSpy and TestSuite. Preferrably make them option()s and cpack components diff --git a/Source/Core/DiscIO/Src/NANDContentLoader.cpp b/Source/Core/DiscIO/Src/NANDContentLoader.cpp index ff8be03f89..c8e409636b 100644 --- a/Source/Core/DiscIO/Src/NANDContentLoader.cpp +++ b/Source/Core/DiscIO/Src/NANDContentLoader.cpp @@ -212,14 +212,12 @@ bool CNANDContentLoader::Initialize(const std::string& _rName) else { std::string TMDFileName(m_Path); + if (File::IsDirectory(TMDFileName)) - { TMDFileName += "title.tmd"; - } else - { m_Path = TMDFileName.substr(0, TMDFileName.find("title.tmd")); - } + File::IOFile pTMDFile(TMDFileName, "rb"); if (!pTMDFile) { @@ -282,9 +280,7 @@ bool CNANDContentLoader::Initialize(const std::string& _rName) strcpy(szFilename, Filename.c_str()); } else - { sprintf(szFilename, "%s/%08x.app", m_Path.c_str(), rContent.m_ContentID); - } INFO_LOG(DISCIO, "NANDContentLoader: load %s", szFilename); @@ -294,7 +290,7 @@ bool CNANDContentLoader::Initialize(const std::string& _rName) const u64 ContentSize = File::GetSize(szFilename); rContent.m_pData = new u8[(u32)ContentSize]; - _dbg_assert_msg_(BOOT, rContent.m_Size==ContentSize, "TMDLoader: Filesize doesnt fit (%s %i)... prolly you have a bad dump", szFilename, i); + _dbg_assert_msg_(BOOT, rContent.m_Size==ContentSize, "TMDLoader: Incorrect filesize (%s %i). Your NAND dump may be corrupt.", szFilename, i); pFile.ReadBytes(rContent.m_pData, (size_t)ContentSize); } diff --git a/Source/Core/DiscIO/Src/WiiWad.cpp b/Source/Core/DiscIO/Src/WiiWad.cpp index 64d8f5eced..24e091f9f4 100644 --- a/Source/Core/DiscIO/Src/WiiWad.cpp +++ b/Source/Core/DiscIO/Src/WiiWad.cpp @@ -46,7 +46,7 @@ private: WiiWAD::WiiWAD(const std::string& _rName) { DiscIO::IBlobReader* pReader = DiscIO::CreateBlobReader(_rName.c_str()); - if (pReader == NULL) + if (pReader == NULL || File::IsDirectory(_rName)) { m_Valid = false; return; diff --git a/Source/DSPTool/CMakeLists.txt b/Source/DSPTool/CMakeLists.txt new file mode 100644 index 0000000000..2e26125fbc --- /dev/null +++ b/Source/DSPTool/CMakeLists.txt @@ -0,0 +1,3 @@ +add_executable(dsptool Src/DSPTool.cpp) +target_link_libraries(dsptool core) +install(TARGETS dsptool RUNTIME DESTINATION ${bindir}) diff --git a/Source/UnitTests/CMakeLists.txt b/Source/UnitTests/CMakeLists.txt index 172cca378e..323c4f65c7 100644 --- a/Source/UnitTests/CMakeLists.txt +++ b/Source/UnitTests/CMakeLists.txt @@ -1,10 +1,7 @@ -set(LIBS core - common) - set(SRCS AudioJitTests.cpp - DSPJitTester.cpp - UnitTests.cpp) + DSPJitTester.cpp + UnitTests.cpp) add_executable(tester ${SRCS}) -target_link_libraries(tester ${LIBS}) -#install(TARGETS ${EXEGUI} RUNTIME DESTINATION ${bindir}) +target_link_libraries(tester core) +install(TARGETS tester RUNTIME DESTINATION ${bindir})