Skip to content

Commit

Permalink
Manual header grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
AngheloAlf committed May 23, 2024
1 parent deab190 commit 6f92e64
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 19 deletions.
6 changes: 3 additions & 3 deletions librecomp/include/recomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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))

Expand Down Expand Up @@ -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
}
Expand Down
1 change: 1 addition & 0 deletions librecomp/include/recomp_game.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <vector>

#include "recomp.h"

#include <ultramodern/ultramodern.hpp>

namespace recomp {
Expand Down
1 change: 1 addition & 0 deletions librecomp/include/recomp_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define __RECOMP_HELPERS__

#include "recomp.h"

#include <ultramodern/ultra64.h>

template<int index, typename T>
Expand Down
4 changes: 3 additions & 1 deletion librecomp/src/ai.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "recomp.h"
#include <cstdio>
#include <string>

#include "recomp.h"

#include <ultramodern/ultra64.h>
#include <ultramodern/ultramodern.hpp>

Expand Down
1 change: 1 addition & 0 deletions librecomp/src/eep.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "recomp.h"

#include <ultramodern/ultra64.h>

void save_write(RDRAM_ARG PTR(void) rdram_address, uint32_t offset, uint32_t count);
Expand Down
1 change: 1 addition & 0 deletions librecomp/src/math_routines.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "recomp.h"

#include <ultramodern/ultramodern.hpp>

// TODO remove these by implementing the necessary instructions and control flow handling in the recompiler.
Expand Down
1 change: 1 addition & 0 deletions librecomp/src/pak.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "recomp.h"

#include <ultramodern/ultra64.h>
#include <ultramodern/ultramodern.hpp>

Expand Down
8 changes: 4 additions & 4 deletions librecomp/src/recomp.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#ifdef _WIN32
# include <Windows.h>
#endif

#include <cmath>
#include <cstdio>
#include <cstdlib>
Expand All @@ -12,6 +8,10 @@
#include <unordered_map>
#include <unordered_set>

#ifdef _WIN32
# include <Windows.h>
#endif

#include "recomp.h"
#include "recomp_game.h"
#include "recomp_overlays.h"
Expand Down
4 changes: 2 additions & 2 deletions ultramodern/include/ultramodern/ultramodern.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#define MOODYCAMEL_DELETE_FUNCTION = delete
#include "lightweightsemaphore.h"

#include "ultra64.h"

#if defined(_WIN32)
# define WIN32_LEAN_AND_MEAN
# include <Windows.h>
Expand All @@ -26,6 +24,8 @@
# undef Success
#endif

#include "ultra64.h"

struct UltraThreadContext {
std::thread host_thread;
moodycamel::LightweightSemaphore running;
Expand Down
3 changes: 2 additions & 1 deletion ultramodern/src/audio.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <cassert>

#include "ultra64.h"
#include "ultramodern.hpp"
#include <cassert>

static uint32_t sample_rate = 48000;

Expand Down
6 changes: 3 additions & 3 deletions ultramodern/src/threads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Windows.h>
#endif

#include "ultra64.h"
#include "ultramodern.hpp"

extern "C" void bootproc();

thread_local bool is_main_thread = false;
Expand Down
10 changes: 5 additions & 5 deletions ultramodern/src/timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
#include <thread>
#include <variant>

#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)
Expand Down

0 comments on commit 6f92e64

Please sign in to comment.