diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index b4a571d..7194331 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -56,7 +56,7 @@ jobs: run: | git clone https://github.com/Mr-Wiseguy/N64Recomp.git --recurse-submodules N64RecompSource cd N64RecompSource - git checkout 6eb7d5bd3ee7f0b79f3fd7adbe931dccbacf7e1b + git checkout 8dfed04919b7bfdd0fd34ff049eed7020dea0d71 git submodule update --init --recursive # enable ccache @@ -130,7 +130,7 @@ jobs: run: | git clone https://github.com/Mr-Wiseguy/N64Recomp.git --recurse-submodules N64RecompSource cd N64RecompSource - git checkout 6eb7d5bd3ee7f0b79f3fd7adbe931dccbacf7e1b + git checkout 8dfed04919b7bfdd0fd34ff049eed7020dea0d71 git submodule update --init --recursive # enable ccache diff --git a/CMakeLists.txt b/CMakeLists.txt index 577781c..ae3eca6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,6 @@ target_include_directories(RecompiledFuncs PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/ultramodern/include ${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/librecomp/include - ${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/librecomp/include/librecomp # temporary while N64Recomp gets updated ) file(GLOB FUNC_C_SOURCES ${CMAKE_SOURCE_DIR}/RecompiledFuncs/*.c) @@ -68,7 +67,6 @@ target_include_directories(PatchesLib PRIVATE ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/ultramodern/include ${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/librecomp/include - ${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/librecomp/include/librecomp # temporary while N64Recomp gets updated ) target_sources(PatchesLib PRIVATE @@ -160,7 +158,6 @@ target_include_directories(Zelda64Recompiled PRIVATE ${CMAKE_SOURCE_DIR}/lib/rt64/src/contrib/nativefiledialog-extended/src/include ${CMAKE_BINARY_DIR}/shaders ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_SOURCE_DIR}/lib/N64ModernRuntime/librecomp/include/librecomp # temporary while N64Recomp gets updated ) if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64|AMD64") diff --git a/lib/N64ModernRuntime b/lib/N64ModernRuntime index 53072cb..ec7e81b 160000 --- a/lib/N64ModernRuntime +++ b/lib/N64ModernRuntime @@ -1 +1 @@ -Subproject commit 53072cb289b4cb02a823ebe5952762f8e50d0faa +Subproject commit ec7e81b45d9a622cb3e45865ce5d7d3536b26534 diff --git a/patches/patch_helpers.h b/patches/patch_helpers.h index f6b88d3..371e8b4 100644 --- a/patches/patch_helpers.h +++ b/patches/patch_helpers.h @@ -4,7 +4,7 @@ #ifdef MIPS #include "ultra64.h" #else -#include "recomp.h" +#include "librecomp/recomp.h" #endif #ifdef __cplusplus diff --git a/src/game/config.cpp b/src/game/config.cpp index 34f1037..f6029de 100644 --- a/src/game/config.cpp +++ b/src/game/config.cpp @@ -2,7 +2,7 @@ #include "zelda_input.h" #include "zelda_sound.h" #include "ultramodern/config.hpp" -#include "librecomp/recomp_files.h" +#include "librecomp/files.hpp" #include #include #include diff --git a/src/game/controls.cpp b/src/game/controls.cpp index f2a16a8..ac6f4ca 100644 --- a/src/game/controls.cpp +++ b/src/game/controls.cpp @@ -1,6 +1,6 @@ #include -#include "librecomp/recomp_helpers.h" +#include "librecomp/helpers.hpp" #include "zelda_input.h" #include "ultramodern/ultramodern.hpp" diff --git a/src/game/debug.cpp b/src/game/debug.cpp index 282b926..03e2d5f 100644 --- a/src/game/debug.cpp +++ b/src/game/debug.cpp @@ -1,6 +1,6 @@ #include #include "zelda_debug.h" -#include "recomp_helpers.h" +#include "librecomp/helpers.hpp" #include "../patches/input.h" std::atomic pending_warp = 0xFFFF; diff --git a/src/game/quicksaving.cpp b/src/game/quicksaving.cpp index 5d854d3..05c36a5 100644 --- a/src/game/quicksaving.cpp +++ b/src/game/quicksaving.cpp @@ -2,8 +2,8 @@ #if 0 -#include "recomp_helpers.h" -#include "recomp_input.h" +#include "librecomp/helpers.hpp" +#include "librecomp/input.hpp" #include "ultramodern/ultramodern.hpp" enum class QuicksaveAction { diff --git a/src/game/recomp_api.cpp b/src/game/recomp_api.cpp index df72ad7..e0b9e9a 100644 --- a/src/game/recomp_api.cpp +++ b/src/game/recomp_api.cpp @@ -1,18 +1,18 @@ #include -#include "recomp.h" -#include "recomp_overlays.h" +#include "librecomp/recomp.h" +#include "librecomp/overlays.hpp" #include "zelda_config.h" #include "zelda_input.h" #include "zelda_ui.h" #include "zelda_sound.h" -#include "recomp_helpers.h" +#include "librecomp/helpers.hpp" #include "../patches/input.h" #include "../patches/graphics.h" #include "../patches/sound.h" #include "ultramodern/ultramodern.hpp" #include "ultramodern/config.hpp" -#include "ultramodern/rt64_layer.h" +#include "ultramodern/rt64_layer.hpp" extern "C" void recomp_update_inputs(uint8_t* rdram, recomp_context* ctx) { zelda64::poll_inputs(); diff --git a/src/main/main.cpp b/src/main/main.cpp index 544b3b8..9450e47 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -25,7 +25,7 @@ #include "zelda_config.h" #include "zelda_sound.h" #include "ovl_patches.hpp" -#include "librecomp/recomp_game.h" +#include "librecomp/game.hpp" #ifdef HAS_MM_SHADER_CACHE #include "mm_shader_cache.h" diff --git a/src/main/register_overlays.cpp b/src/main/register_overlays.cpp index e88c0be..aac60a8 100644 --- a/src/main/register_overlays.cpp +++ b/src/main/register_overlays.cpp @@ -1,7 +1,7 @@ #include "ovl_patches.hpp" #include "../../RecompiledFuncs/recomp_overlays.inl" -#include "recomp_overlays.h" +#include "librecomp/overlays.hpp" void zelda64::register_overlays() { const static recomp::overlay_section_table_data_t sections { diff --git a/src/main/register_patches.cpp b/src/main/register_patches.cpp index 84ecc87..5076868 100644 --- a/src/main/register_patches.cpp +++ b/src/main/register_patches.cpp @@ -2,8 +2,8 @@ #include "../../RecompiledPatches/patches_bin.h" #include "../../RecompiledPatches/recomp_overlays.inl" -#include "recomp_overlays.h" -#include "recomp_game.h" +#include "librecomp/overlays.hpp" +#include "librecomp/game.hpp" void zelda64::register_patches() { // TODO: This is a bit awful, maybe provide only one functions that does both in librecomp? diff --git a/src/recomp/files.cpp b/src/recomp/files.cpp deleted file mode 100644 index fa4ed70..0000000 --- a/src/recomp/files.cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include "recomp_files.h" - -constexpr std::u8string_view backup_suffix = u8".bak"; -constexpr std::u8string_view temp_suffix = u8".temp"; - -std::ifstream recomp::open_input_backup_file(const std::filesystem::path& filepath, std::ios_base::openmode mode) { - std::filesystem::path backup_path{filepath}; - backup_path += backup_suffix; - return std::ifstream{backup_path, mode}; -} - -std::ifstream recomp::open_input_file_with_backup(const std::filesystem::path& filepath, std::ios_base::openmode mode) { - std::ifstream ret{filepath, mode}; - - // Check if the file failed to open and open the corresponding backup file instead if so. - if (!ret.good()) { - return open_input_backup_file(filepath, mode); - } - - return ret; -} - -std::ofstream recomp::open_output_file_with_backup(const std::filesystem::path& filepath, std::ios_base::openmode mode) { - std::filesystem::path temp_path{filepath}; - temp_path += temp_suffix; - std::ofstream temp_file_out{ temp_path, mode }; - - return temp_file_out; -} - -bool recomp::finalize_output_file_with_backup(const std::filesystem::path& filepath) { - std::filesystem::path backup_path{filepath}; - backup_path += backup_suffix; - - std::filesystem::path temp_path{filepath}; - temp_path += temp_suffix; - - std::error_code ec; - if (std::filesystem::exists(filepath, ec)) { - std::filesystem::copy_file(filepath, backup_path, std::filesystem::copy_options::overwrite_existing, ec); - if (ec) { - return false; - } - } - std::filesystem::copy_file(temp_path, filepath, std::filesystem::copy_options::overwrite_existing, ec); - if (ec) { - return false; - } - std::filesystem::remove(temp_path, ec); - return true; -} diff --git a/src/ui/ui_config.cpp b/src/ui/ui_config.cpp index 4c701b4..e6f0fa7 100644 --- a/src/ui/ui_config.cpp +++ b/src/ui/ui_config.cpp @@ -7,7 +7,7 @@ #include "ultramodern/config.hpp" #include "ultramodern/ultramodern.hpp" #include "RmlUi/Core.h" -#include "ultramodern/rt64_layer.h" +#include "ultramodern/rt64_layer.hpp" ultramodern::GraphicsConfig new_options; Rml::DataModelHandle nav_help_model_handle; diff --git a/src/ui/ui_launcher.cpp b/src/ui/ui_launcher.cpp index e948821..a56a48d 100644 --- a/src/ui/ui_launcher.cpp +++ b/src/ui/ui_launcher.cpp @@ -1,6 +1,6 @@ #include "zelda_ui.h" #include "zelda_config.h" -#include "recomp_game.h" +#include "librecomp/game.hpp" #include "ultramodern/ultramodern.hpp" #include "RmlUi/Core.h" #include "nfd.h" diff --git a/src/ui/ui_renderer.cpp b/src/ui/ui_renderer.cpp index b2c79fb..26ef498 100644 --- a/src/ui/ui_renderer.cpp +++ b/src/ui/ui_renderer.cpp @@ -13,13 +13,13 @@ #include "zelda_ui.h" #include "zelda_input.h" -#include "recomp_game.h" +#include "librecomp/game.hpp" #include "zelda_config.h" #include "ui_rml_hacks.hpp" #include "concurrentqueue.h" -#include "ultramodern/rt64_layer.h" +#include "ultramodern/rt64_layer.hpp" #include "rt64_render_hooks.h" #include "rt64_render_interface_builders.h"