diff --git a/CMakeLists.txt b/CMakeLists.txt index bf3ec01..508ccff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,22 +5,27 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) +set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) add_subdirectory("${PROJECT_SOURCE_DIR}/cpu/ppc/") add_subdirectory("${PROJECT_SOURCE_DIR}/devices/") +add_subdirectory("${PROJECT_SOURCE_DIR}/thirdparty/") include_directories("${PROJECT_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}/devices" "${PROJECT_SOURCE_DIR}/cpu/ppc" - "${PROJECT_SOURCE_DIR}/debugger") + "${PROJECT_SOURCE_DIR}/debugger" + "${PROJECT_SOURCE_DIR}/thirdparty") file(GLOB SOURCES "${PROJECT_SOURCE_DIR}/*.cpp" "${PROJECT_SOURCE_DIR}/debugger/*.cpp") file(GLOB TEST_SOURCES "${PROJECT_SOURCE_DIR}/cpu/ppc/test/*.cpp") -add_executable(dingusppc ${SOURCES} $ $) +add_executable(dingusppc ${SOURCES} $ $ + $) -add_executable(testppc ${TEST_SOURCES} $ $) +add_executable(testppc ${TEST_SOURCES} $ $ + $) add_custom_command( TARGET testppc POST_BUILD diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 66eac16..1ac7edb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,7 +10,18 @@ Code * Make sure the code can compile for all target systems - Windows, Linux, and macOS/Mac OS X. * All code must be compatible with at least C++11. -* Minimize the amount of redundant code +* Minimize the amount of redundant code. +* Avoid using absolute paths for the headers. +* Code should maintain vertical alignment. An example of this is provided below: + +> one_hundred = 100; +> one_thousand = 1000; + +** The following should be avoided: + +> one_hundred = 100; +> one_thousand = 1000; +* CamelCase for class names, lowercase for variables, UPPERCASE for enumerations Issues ======= diff --git a/cpu/ppc/ppcexec.cpp b/cpu/ppc/ppcexec.cpp index 881601b..8e04005 100644 --- a/cpu/ppc/ppcexec.cpp +++ b/cpu/ppc/ppcexec.cpp @@ -5,7 +5,7 @@ //if you want to distribute this. //(divingkatae#1017 or powermax#2286 on Discord) -#include +#include #include #include #include diff --git a/main.cpp b/main.cpp index fbd3c5a..0591dcf 100644 --- a/main.cpp +++ b/main.cpp @@ -131,7 +131,7 @@ int main(int argc, char **argv) configInfoOffset = (uint32_t)(configGrab & 0xff); uint32_t configInfoAddr = 0x300000 + (configInfoOffset << 8) + 0x69; //address to check the identifier string - char memPPCBlock[5]; //First four chars are enough to distinguish between codenames + char memPPCBlock[5] = { 0 }; //First four chars are enough to distinguish between codenames romFile.seekg (configInfoAddr, ios::beg); romFile.read(memPPCBlock, 4); memPPCBlock[4] = 0; diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt new file mode 100644 index 0000000..230488b --- /dev/null +++ b/thirdparty/CMakeLists.txt @@ -0,0 +1,6 @@ +include_directories("${PROJECT_SOURCE_DIR}") + +file(GLOB SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/loguru.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/loguru.hpp") + +add_library(loguru OBJECT ${SOURCES}) \ No newline at end of file