mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-09 15:45:40 +12:00
Merge remote-tracking branch 'upstream/master' into stencil-logicop-clear
This commit is contained in:
commit
71898895af
8 changed files with 89 additions and 60 deletions
8
.gitignore
vendored
8
.gitignore
vendored
|
@ -55,6 +55,12 @@ fb.bat
|
|||
*.idb
|
||||
|
||||
# 3DS files
|
||||
*.3ds
|
||||
*.3dsx
|
||||
*.app
|
||||
*.cci
|
||||
*.cxi
|
||||
*.elf
|
||||
*.smdh
|
||||
*.smdh
|
||||
|
||||
config.toml
|
|
@ -155,7 +155,7 @@ set(HEADER_FILES include/emulator.hpp include/helpers.hpp include/termcolor.hpp
|
|||
include/result/result_gsp.hpp include/result/result_kernel.hpp include/result/result_os.hpp
|
||||
include/crypto/aes_engine.hpp include/metaprogramming.hpp include/PICA/pica_vertex.hpp
|
||||
include/config.hpp include/services/ir_user.hpp include/httpserver.hpp include/cheats.hpp
|
||||
include/action_replay.hpp include/renderer_sw/renderer_sw.hpp
|
||||
include/action_replay.hpp include/renderer_sw/renderer_sw.hpp include/compiler_builtins.hpp
|
||||
)
|
||||
|
||||
set(THIRD_PARTY_SOURCE_FILES third_party/imgui/imgui.cpp
|
||||
|
|
7
include/compiler_builtins.hpp
Normal file
7
include/compiler_builtins.hpp
Normal file
|
@ -0,0 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define ALWAYS_INLINE __forceinline
|
||||
#else
|
||||
#define ALWAYS_INLINE __attribute__((always_inline))
|
||||
#endif
|
|
@ -108,7 +108,7 @@ public:
|
|||
return getCyclesForInstruction(isThumb, instruction);
|
||||
}
|
||||
|
||||
MyEnvironment(Memory& mem, Kernel& kernel, CPU& cpu) : mem(mem), kernel(kernel) {}
|
||||
MyEnvironment(Memory& mem, Kernel& kernel) : mem(mem), kernel(kernel) {}
|
||||
};
|
||||
|
||||
class CPU {
|
||||
|
|
|
@ -154,5 +154,4 @@ namespace Helpers {
|
|||
// UDLs for memory size values
|
||||
constexpr size_t operator""_KB(unsigned long long int x) { return 1024ULL * x; }
|
||||
constexpr size_t operator""_MB(unsigned long long int x) { return 1024_KB * x; }
|
||||
constexpr size_t operator""_GB(unsigned long long int x) { return 1024_MB * x; }
|
||||
|
||||
constexpr size_t operator""_GB(unsigned long long int x) { return 1024_MB * x; }
|
|
@ -107,9 +107,9 @@ private:
|
|||
MAKE_LOG_FUNCTION(log, kernelLogger)
|
||||
MAKE_LOG_FUNCTION(logSVC, svcLogger)
|
||||
MAKE_LOG_FUNCTION(logThread, threadLogger)
|
||||
MAKE_LOG_FUNCTION(logDebugString, debugStringLogger)
|
||||
MAKE_LOG_FUNCTION(logError, errorLogger)
|
||||
MAKE_LOG_FUNCTION(logFileIO, fileIOLogger)
|
||||
MAKE_LOG_FUNCTION_USER(logDebugString, debugStringLogger)
|
||||
|
||||
// SVC implementations
|
||||
void arbitrateAddress();
|
||||
|
|
|
@ -2,61 +2,78 @@
|
|||
#include <cstdarg>
|
||||
#include <fstream>
|
||||
|
||||
#include "compiler_builtins.hpp"
|
||||
|
||||
namespace Log {
|
||||
// Our logger class
|
||||
template <bool enabled>
|
||||
class Logger {
|
||||
public:
|
||||
void log(const char* fmt, ...) {
|
||||
if constexpr (!enabled) return;
|
||||
|
||||
std::va_list args;
|
||||
va_start(args, fmt);
|
||||
std::vprintf(fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
};
|
||||
// Our logger class
|
||||
template <bool enabled>
|
||||
class Logger {
|
||||
public:
|
||||
ALWAYS_INLINE void log(const char* fmt, ...) {
|
||||
if constexpr (!enabled) return;
|
||||
|
||||
// Our loggers here. Enable/disable by toggling the template param
|
||||
static Logger<false> kernelLogger;
|
||||
static Logger<true> debugStringLogger; // Enables output for the outputDebugString SVC
|
||||
static Logger<false> errorLogger;
|
||||
static Logger<false> fileIOLogger;
|
||||
static Logger<false> svcLogger;
|
||||
static Logger<false> threadLogger;
|
||||
static Logger<false> gpuLogger;
|
||||
static Logger<false> rendererLogger;
|
||||
static Logger<false> shaderJITLogger;
|
||||
std::va_list args;
|
||||
va_start(args, fmt);
|
||||
std::vprintf(fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
};
|
||||
|
||||
// Service loggers
|
||||
static Logger<false> acLogger;
|
||||
static Logger<false> actLogger;
|
||||
static Logger<false> amLogger;
|
||||
static Logger<false> aptLogger;
|
||||
static Logger<false> bossLogger;
|
||||
static Logger<false> camLogger;
|
||||
static Logger<false> cecdLogger;
|
||||
static Logger<false> cfgLogger;
|
||||
static Logger<false> dspServiceLogger;
|
||||
static Logger<false> dlpSrvrLogger;
|
||||
static Logger<false> frdLogger;
|
||||
static Logger<false> fsLogger;
|
||||
static Logger<false> hidLogger;
|
||||
// Our loggers here. Enable/disable by toggling the template param
|
||||
static Logger<false> kernelLogger;
|
||||
// Enables output for the outputDebugString SVC
|
||||
static Logger<true> debugStringLogger;
|
||||
static Logger<false> errorLogger;
|
||||
static Logger<false> fileIOLogger;
|
||||
static Logger<false> svcLogger;
|
||||
static Logger<false> threadLogger;
|
||||
static Logger<false> gpuLogger;
|
||||
static Logger<false> rendererLogger;
|
||||
static Logger<false> shaderJITLogger;
|
||||
|
||||
// Service loggers
|
||||
static Logger<false> acLogger;
|
||||
static Logger<false> actLogger;
|
||||
static Logger<false> amLogger;
|
||||
static Logger<false> aptLogger;
|
||||
static Logger<false> bossLogger;
|
||||
static Logger<false> camLogger;
|
||||
static Logger<false> cecdLogger;
|
||||
static Logger<false> cfgLogger;
|
||||
static Logger<false> dspServiceLogger;
|
||||
static Logger<false> dlpSrvrLogger;
|
||||
static Logger<false> frdLogger;
|
||||
static Logger<false> fsLogger;
|
||||
static Logger<false> hidLogger;
|
||||
static Logger<false> irUserLogger;
|
||||
static Logger<false> gspGPULogger;
|
||||
static Logger<false> gspLCDLogger;
|
||||
static Logger<false> ldrLogger;
|
||||
static Logger<false> micLogger;
|
||||
static Logger<false> nfcLogger;
|
||||
static Logger<false> nimLogger;
|
||||
static Logger<false> ndmLogger;
|
||||
static Logger<false> ptmLogger;
|
||||
static Logger<false> y2rLogger;
|
||||
static Logger<false> srvLogger;
|
||||
static Logger<false> gspGPULogger;
|
||||
static Logger<false> gspLCDLogger;
|
||||
static Logger<false> ldrLogger;
|
||||
static Logger<false> micLogger;
|
||||
static Logger<false> nfcLogger;
|
||||
static Logger<false> nimLogger;
|
||||
static Logger<false> ndmLogger;
|
||||
static Logger<false> ptmLogger;
|
||||
static Logger<false> y2rLogger;
|
||||
static Logger<false> srvLogger;
|
||||
|
||||
#define MAKE_LOG_FUNCTION(functionName, logger) \
|
||||
template <typename... Args> \
|
||||
void functionName(const char* fmt, Args... args) { \
|
||||
Log::logger.log(fmt, args...); \
|
||||
}
|
||||
}
|
||||
// We have 2 ways to create a log function
|
||||
// MAKE_LOG_FUNCTION: Creates a log function which is toggleable but always killed for user-facing builds
|
||||
// MAKE_LOG_FUNCTION_USER: Creates a log function which is toggleable, may be on for user builds as well
|
||||
// We need this because sadly due to the loggers taking variadic arguments, compilers will not properly
|
||||
// Kill them fully even when they're disabled. The only way they will is if the function with varargs is totally empty
|
||||
|
||||
#define MAKE_LOG_FUNCTION_USER(functionName, logger) \
|
||||
template <typename... Args> \
|
||||
ALWAYS_INLINE void functionName(const char* fmt, Args&&... args) { \
|
||||
Log::logger.log(fmt, args...); \
|
||||
}
|
||||
|
||||
#ifdef PANDA3DS_USER_BUILD
|
||||
#define MAKE_LOG_FUNCTION(functionName, logger) \
|
||||
template <typename... Args> \
|
||||
ALWAYS_INLINE void functionName(const char* fmt, Args&&... args) {}
|
||||
#else
|
||||
#define MAKE_LOG_FUNCTION(functionName, logger) MAKE_LOG_FUNCTION_USER(functionName, logger)
|
||||
#endif
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
#include "cpu_dynarmic.hpp"
|
||||
#include "arm_defs.hpp"
|
||||
|
||||
CPU::CPU(Memory& mem, Kernel& kernel) : mem(mem), env(mem, kernel, *this) {
|
||||
CPU::CPU(Memory& mem, Kernel& kernel) : mem(mem), env(mem, kernel) {
|
||||
cp15 = std::make_shared<CP15>();
|
||||
|
||||
Dynarmic::A32::UserConfig config;
|
||||
|
|
Loading…
Add table
Reference in a new issue