diff --git a/librecomp/include/recomp.h b/librecomp/include/recomp.h index 649217d..28d1454 100644 --- a/librecomp/include/recomp.h +++ b/librecomp/include/recomp.h @@ -73,7 +73,7 @@ static inline gpr do_lwl(uint8_t* rdram, gpr initial_value, gpr offset, gpr reg) static inline gpr do_lwr(uint8_t* rdram, gpr initial_value, gpr offset, gpr reg) { // Calculate the overall address gpr address = (offset + reg); - + // Load the aligned word gpr word_address = address & ~0x3; uint32_t loaded_value = MEM_W(0, word_address); @@ -119,7 +119,7 @@ static inline void do_swr(uint8_t* rdram, gpr offset, gpr reg, gpr val) { #define S32(val) \ ((int32_t)(val)) - + #define U32(val) \ ((uint32_t)(val)) @@ -272,7 +272,7 @@ extern int32_t section_addresses[]; void recomp_syscall_handler(uint8_t* rdram, recomp_context* ctx, int32_t instruction_vram); -void pause_self(uint8_t *rdram); +void pause_self(uint8_t* rdram); #ifdef __cplusplus } diff --git a/librecomp/include/recomp_game.h b/librecomp/include/recomp_game.h index 82039b4..30a7a34 100644 --- a/librecomp/include/recomp_game.h +++ b/librecomp/include/recomp_game.h @@ -5,6 +5,7 @@ #include #include "recomp.h" + #include namespace recomp { diff --git a/librecomp/include/recomp_helpers.h b/librecomp/include/recomp_helpers.h index 38f6534..7e6ed30 100644 --- a/librecomp/include/recomp_helpers.h +++ b/librecomp/include/recomp_helpers.h @@ -2,6 +2,7 @@ #define __RECOMP_HELPERS__ #include "recomp.h" + #include template diff --git a/librecomp/src/ai.cpp b/librecomp/src/ai.cpp index 38e658b..430c4fd 100644 --- a/librecomp/src/ai.cpp +++ b/librecomp/src/ai.cpp @@ -1,6 +1,8 @@ -#include "recomp.h" #include #include + +#include "recomp.h" + #include #include diff --git a/librecomp/src/eep.cpp b/librecomp/src/eep.cpp index 55c4d8a..4733845 100644 --- a/librecomp/src/eep.cpp +++ b/librecomp/src/eep.cpp @@ -1,4 +1,5 @@ #include "recomp.h" + #include void save_write(RDRAM_ARG PTR(void) rdram_address, uint32_t offset, uint32_t count); diff --git a/librecomp/src/math_routines.cpp b/librecomp/src/math_routines.cpp index 173d9cb..f32f92c 100644 --- a/librecomp/src/math_routines.cpp +++ b/librecomp/src/math_routines.cpp @@ -1,4 +1,5 @@ #include "recomp.h" + #include // TODO remove these by implementing the necessary instructions and control flow handling in the recompiler. diff --git a/librecomp/src/pak.cpp b/librecomp/src/pak.cpp index 834e8e7..28fcf1b 100644 --- a/librecomp/src/pak.cpp +++ b/librecomp/src/pak.cpp @@ -1,4 +1,5 @@ #include "recomp.h" + #include #include diff --git a/librecomp/src/recomp.cpp b/librecomp/src/recomp.cpp index 8f89472..c646924 100644 --- a/librecomp/src/recomp.cpp +++ b/librecomp/src/recomp.cpp @@ -1,7 +1,3 @@ -#ifdef _WIN32 -# include -#endif - #include #include #include @@ -12,6 +8,10 @@ #include #include +#ifdef _WIN32 +# include +#endif + #include "recomp.h" #include "recomp_game.h" #include "recomp_overlays.h" diff --git a/ultramodern/include/ultramodern/ultramodern.hpp b/ultramodern/include/ultramodern/ultramodern.hpp index d4ef21c..83a4786 100644 --- a/ultramodern/include/ultramodern/ultramodern.hpp +++ b/ultramodern/include/ultramodern/ultramodern.hpp @@ -10,8 +10,6 @@ #define MOODYCAMEL_DELETE_FUNCTION = delete #include "lightweightsemaphore.h" -#include "ultra64.h" - #if defined(_WIN32) # define WIN32_LEAN_AND_MEAN # include @@ -26,6 +24,8 @@ # undef Success #endif +#include "ultra64.h" + struct UltraThreadContext { std::thread host_thread; moodycamel::LightweightSemaphore running; diff --git a/ultramodern/src/audio.cpp b/ultramodern/src/audio.cpp index 2926892..9940471 100644 --- a/ultramodern/src/audio.cpp +++ b/ultramodern/src/audio.cpp @@ -1,6 +1,7 @@ +#include + #include "ultra64.h" #include "ultramodern.hpp" -#include static uint32_t sample_rate = 48000; diff --git a/ultramodern/src/threads.cpp b/ultramodern/src/threads.cpp index 4a11867..749497f 100644 --- a/ultramodern/src/threads.cpp +++ b/ultramodern/src/threads.cpp @@ -5,14 +5,14 @@ #include "blockingconcurrentqueue.h" -#include "ultra64.h" -#include "ultramodern.hpp" - // Native APIs only used to set thread names for easier debugging #ifdef _WIN32 # include #endif +#include "ultra64.h" +#include "ultramodern.hpp" + extern "C" void bootproc(); thread_local bool is_main_thread = false; diff --git a/ultramodern/src/timer.cpp b/ultramodern/src/timer.cpp index b5ee92c..99e283e 100644 --- a/ultramodern/src/timer.cpp +++ b/ultramodern/src/timer.cpp @@ -2,16 +2,16 @@ #include #include -#include "blockingconcurrentqueue.h" - -#include "ultra64.h" -#include "ultramodern.hpp" - #ifdef _WIN32 # define WIN32_LEAN_AND_MEAN # include "Windows.h" #endif +#include "blockingconcurrentqueue.h" + +#include "ultra64.h" +#include "ultramodern.hpp" + // Start time for the program static std::chrono::high_resolution_clock::time_point start_time = std::chrono::high_resolution_clock::now(); // Game speed multiplier (1 means no speedup)