CMake: Swap USE_ and WITH_ for ENABLE_

Consistency.
This commit is contained in:
Stenzek
2023-09-17 12:28:11 +10:00
parent 57cdb180c6
commit 68b59ee748
39 changed files with 187 additions and 187 deletions

View File

@ -128,23 +128,23 @@ target_link_libraries(core PRIVATE stb xxhash imgui rapidjson rcheevos)
if(${CPU_ARCH} STREQUAL "x64")
target_include_directories(core PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../../dep/xbyak/xbyak")
target_compile_definitions(core PUBLIC "XBYAK_NO_EXCEPTION=1" "WITH_RECOMPILER=1" "WITH_MMAP_FASTMEM=1")
target_compile_definitions(core PUBLIC "XBYAK_NO_EXCEPTION=1" "ENABLE_RECOMPILER=1" "ENABLE_MMAP_FASTMEM=1")
target_sources(core PRIVATE ${RECOMPILER_SRCS}
cpu_recompiler_code_generator_x64.cpp
)
message("Building x64 recompiler")
elseif(${CPU_ARCH} STREQUAL "aarch32")
target_compile_definitions(core PUBLIC "WITH_RECOMPILER=1")
target_compile_definitions(core PUBLIC "ENABLE_RECOMPILER=1")
target_sources(core PRIVATE ${RECOMPILER_SRCS}
cpu_recompiler_code_generator_aarch32.cpp
)
target_link_libraries(core PUBLIC vixl)
message("Building AArch32 recompiler")
elseif(${CPU_ARCH} STREQUAL "aarch64")
target_compile_definitions(core PUBLIC "WITH_RECOMPILER=1")
target_compile_definitions(core PUBLIC "ENABLE_RECOMPILER=1")
if (NOT APPLE)
# Disabled until we support 16K pages.
target_compile_definitions(core PUBLIC "WITH_MMAP_FASTMEM=1")
target_compile_definitions(core PUBLIC "ENABLE_MMAP_FASTMEM=1")
endif()
target_sources(core PRIVATE ${RECOMPILER_SRCS}
cpu_recompiler_code_generator_aarch64.cpp
@ -156,7 +156,7 @@ else()
endif()
if(ENABLE_DISCORD_PRESENCE)
target_compile_definitions(core PUBLIC -DWITH_DISCORD_PRESENCE=1)
target_compile_definitions(core PUBLIC -DENABLE_DISCORD_PRESENCE=1)
target_link_libraries(core PRIVATE discord-rpc)
endif()

View File

@ -52,7 +52,7 @@
Log_SetChannel(Achievements);
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
// RA_Interface ends up including windows.h, with its silly macros.
#ifdef _WIN32
#include "common/windows_headers.h"
@ -184,7 +184,7 @@ static void CloseLeaderboard();
static bool s_hardcore_mode = false;
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
static bool s_using_raintegration = false;
#endif
@ -317,7 +317,7 @@ void Achievements::DownloadImage(std::string url, std::string cache_filename)
bool Achievements::IsActive()
{
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
return (s_client != nullptr) || s_using_raintegration;
#else
return (s_client != nullptr);
@ -326,7 +326,7 @@ bool Achievements::IsActive()
bool Achievements::IsHardcoreModeActive()
{
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration())
return RA_HardcoreModeIsActive() != 0;
#endif
@ -500,7 +500,7 @@ void Achievements::UpdateSettings(const Settings& old_config)
bool Achievements::Shutdown(bool allow_cancel)
{
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration())
{
if (System::IsValid() && allow_cancel && !RA_ConfirmLoadNewRom(true))
@ -612,7 +612,7 @@ void Achievements::IdleUpdate()
if (!IsActive())
return;
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration())
return;
#endif
@ -628,7 +628,7 @@ void Achievements::FrameUpdate()
if (!IsActive())
return;
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration())
{
RA_DoAchievementsFrame();
@ -748,7 +748,7 @@ void Achievements::UpdateRichPresence(std::unique_lock<std::recursive_mutex>& lo
Log_InfoPrintf("Rich presence updated: %s", s_rich_presence_string.c_str());
Host::OnAchievementsRefreshed();
#ifdef WITH_DISCORD_PRESCENCE
#ifdef ENABLE_DISCORD_PRESENCE
lock.unlock();
System::UpdateDiscordPresence();
lock.lock();
@ -780,7 +780,7 @@ void Achievements::CancelGameLoad()
DisableHardcoreMode();
Host::OnAchievementsRefreshed();
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration())
{
RAIntegration::GameChanged();
@ -828,7 +828,7 @@ void Achievements::IdentifyGame(const std::string& path, CDImage* image)
s_game_path = path;
s_game_hash = std::move(game_hash);
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration())
{
RAIntegration::GameChanged();
@ -1280,7 +1280,7 @@ void Achievements::HandleServerReconnectedEvent(const rc_client_event_t* event)
void Achievements::ResetClient()
{
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration())
{
RA_OnReset();
@ -1297,7 +1297,7 @@ void Achievements::ResetClient()
void Achievements::OnSystemPaused(bool paused)
{
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration())
RA_SetPaused(paused);
#endif
@ -1308,7 +1308,7 @@ void Achievements::DisableHardcoreMode()
if (!IsActive())
return;
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration())
{
if (RA_HardcoreModeIsActive())
@ -1397,7 +1397,7 @@ bool Achievements::DoState(StateWrapper& sw)
{
// reset runtime, no data (state might've been created without cheevos)
Log_DevPrintf("State is missing cheevos data, resetting runtime");
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration())
RA_OnReset();
else
@ -1414,7 +1414,7 @@ bool Achievements::DoState(StateWrapper& sw)
if (sw.HasError())
return false;
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration())
{
RA_RestoreState(reinterpret_cast<const char*>(data.get()));
@ -1437,7 +1437,7 @@ bool Achievements::DoState(StateWrapper& sw)
u32 data_size;
std::unique_ptr<u8[]> data;
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration())
{
const int size = RA_CaptureState(nullptr, 0);
@ -1712,7 +1712,7 @@ void Achievements::Logout()
bool Achievements::ConfirmSystemReset()
{
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration())
return RA_ConfirmLoadNewRom(false);
#endif
@ -1722,7 +1722,7 @@ bool Achievements::ConfirmSystemReset()
bool Achievements::ConfirmHardcoreModeDisable(const char* trigger)
{
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration())
return (RA_WarnDisableHardcore(trigger) != 0);
#endif
@ -2829,7 +2829,7 @@ void Achievements::CloseLeaderboard()
s_open_leaderboard = nullptr;
}
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
#include "RA_Consoles.h"

View File

@ -126,7 +126,7 @@ bool PrepareLeaderboardsWindow();
/// Renders the leaderboard list.
void DrawLeaderboardsWindow();
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
/// Prevents the internal implementation from being used. Instead, RAIntegration will be
/// called into when achievement-related events occur.
void SwitchToRAIntegration();

View File

@ -116,7 +116,7 @@ static Common::MemoryArena m_memory_arena;
static CPUFastmemMode m_fastmem_mode = CPUFastmemMode::Disabled;
#ifdef WITH_MMAP_FASTMEM
#ifdef ENABLE_MMAP_FASTMEM
static u8* m_fastmem_base = nullptr;
static std::vector<Common::MemoryArena::View> m_fastmem_ram_views;
static std::vector<Common::MemoryArena::View> m_fastmem_reserved_views;
@ -164,7 +164,7 @@ void Shutdown()
std::free(m_fastmem_lut);
m_fastmem_lut = nullptr;
#ifdef WITH_MMAP_FASTMEM
#ifdef ENABLE_MMAP_FASTMEM
m_fastmem_base = nullptr;
m_fastmem_ram_views.clear();
#endif
@ -381,7 +381,7 @@ CPUFastmemMode GetFastmemMode()
u8* GetFastmemBase()
{
#ifdef WITH_MMAP_FASTMEM
#ifdef ENABLE_MMAP_FASTMEM
if (m_fastmem_mode == CPUFastmemMode::MMap)
return m_fastmem_base;
#endif
@ -393,7 +393,7 @@ u8* GetFastmemBase()
void UpdateFastmemViews(CPUFastmemMode mode)
{
#ifndef WITH_MMAP_FASTMEM
#ifndef ENABLE_MMAP_FASTMEM
Assert(mode != CPUFastmemMode::MMap);
#else
m_fastmem_ram_views.clear();
@ -403,7 +403,7 @@ void UpdateFastmemViews(CPUFastmemMode mode)
m_fastmem_mode = mode;
if (mode == CPUFastmemMode::Disabled)
{
#ifdef WITH_MMAP_FASTMEM
#ifdef ENABLE_MMAP_FASTMEM
m_fastmem_base = nullptr;
#endif
std::free(m_fastmem_lut);
@ -411,7 +411,7 @@ void UpdateFastmemViews(CPUFastmemMode mode)
return;
}
#ifdef WITH_MMAP_FASTMEM
#ifdef ENABLE_MMAP_FASTMEM
if (mode == CPUFastmemMode::MMap)
{
std::free(m_fastmem_lut);
@ -488,7 +488,7 @@ void UpdateFastmemViews(CPUFastmemMode mode)
}
#endif
#ifdef WITH_MMAP_FASTMEM
#ifdef ENABLE_MMAP_FASTMEM
m_fastmem_base = nullptr;
#endif
@ -533,7 +533,7 @@ bool CanUseFastmemForAddress(VirtualMemoryAddress address)
switch (m_fastmem_mode)
{
#ifdef WITH_MMAP_FASTMEM
#ifdef ENABLE_MMAP_FASTMEM
case CPUFastmemMode::MMap:
{
// Currently since we don't map the mirrors, don't use fastmem for them.
@ -578,7 +578,7 @@ void ClearRAMCodePage(u32 index)
void SetCodePageFastmemProtection(u32 page_index, bool writable)
{
#ifdef WITH_MMAP_FASTMEM
#ifdef ENABLE_MMAP_FASTMEM
if (m_fastmem_mode == CPUFastmemMode::MMap)
{
// unprotect fastmem pages
@ -609,7 +609,7 @@ void ClearRAMCodePageFlags()
{
m_ram_code_bits.reset();
#ifdef WITH_MMAP_FASTMEM
#ifdef ENABLE_MMAP_FASTMEM
if (m_fastmem_mode == CPUFastmemMode::MMap)
{
// unprotect fastmem pages

View File

@ -89,7 +89,7 @@ enum : size_t
// Offsets within the memory arena.
MEMORY_ARENA_RAM_OFFSET = 0,
#ifdef WITH_MMAP_FASTMEM
#ifdef ENABLE_MMAP_FASTMEM
// Fastmem region size is 4GB to cover the entire 32-bit address space.
FASTMEM_REGION_SIZE = UINT64_C(0x100000000),
#endif

View File

@ -4,10 +4,10 @@
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>WITH_DISCORD_PRESENCE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="('$(Platform)'!='ARM64')">WITH_RAINTEGRATION=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="('$(Platform)'=='x64' Or '$(Platform)'=='ARM' Or '$(Platform)'=='ARM64')">WITH_RECOMPILER=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="('$(Platform)'=='x64' Or '$(Platform)'=='ARM64')">WITH_MMAP_FASTMEM=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>ENABLE_DISCORD_PRESENCE=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="('$(Platform)'!='ARM64')">ENABLE_RAINTEGRATION=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="('$(Platform)'=='x64' Or '$(Platform)'=='ARM' Or '$(Platform)'=='ARM64')">ENABLE_RECOMPILER=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="('$(Platform)'=='x64' Or '$(Platform)'=='ARM64')">ENABLE_MMAP_FASTMEM=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(SolutionDir)dep\xxhash\include;$(SolutionDir)dep\zlib\include;$(SolutionDir)dep\rcheevos\include;$(SolutionDir)dep\rapidjson\include;$(SolutionDir)dep\discord-rpc\include</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Platform)'!='ARM64'">%(AdditionalIncludeDirectories);$(SolutionDir)dep\rainterface</AdditionalIncludeDirectories>

View File

@ -14,7 +14,7 @@
#include "timing_event.h"
Log_SetChannel(CPU::CodeCache);
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
#include "cpu_recompiler_code_generator.h"
#endif
@ -29,7 +29,7 @@ static constexpr u32 RECOMPILE_FRAMES_TO_FALL_BACK_TO_INTERPRETER = 100;
static constexpr u32 RECOMPILE_COUNT_TO_FALL_BACK_TO_INTERPRETER = 20;
static constexpr u32 INVALIDATE_THRESHOLD_TO_DISABLE_LINKING = 10;
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
// Currently remapping the code buffer doesn't work in macOS or Haiku.
#if !defined(__HAIKU__) && !defined(__APPLE__)
@ -56,7 +56,7 @@ static JitCodeBuffer s_code_buffer;
#endif
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
static FastMapTable s_fast_map[FAST_MAP_TABLE_COUNT];
static std::unique_ptr<CodeBlock::HostCodePointer[]> s_fast_map_pointers;
@ -227,7 +227,7 @@ static void ClearState();
static BlockMap s_blocks;
static std::array<std::vector<CodeBlock*>, Bus::RAM_8MB_CODE_PAGE_COUNT> m_ram_block_map;
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
static HostCodeMap s_host_code_map;
static void AddBlockToHostCodeMap(CodeBlock* block);
@ -237,17 +237,17 @@ static bool InitializeFastmem();
static void ShutdownFastmem();
static Common::PageFaultHandler::HandlerResult LUTPageFaultHandler(void* exception_pc, void* fault_address,
bool is_write);
#ifdef WITH_MMAP_FASTMEM
#ifdef ENABLE_MMAP_FASTMEM
static Common::PageFaultHandler::HandlerResult MMapPageFaultHandler(void* exception_pc, void* fault_address,
bool is_write);
#endif
#endif // WITH_RECOMPILER
#endif // ENABLE_RECOMPILER
void Initialize()
{
Assert(s_blocks.empty());
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
if (g_settings.IsUsingRecompiler())
{
#ifdef USE_STATIC_CODE_BUFFER
@ -266,7 +266,7 @@ void Initialize()
AllocateFastMap();
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
if (g_settings.IsUsingRecompiler())
{
if (g_settings.IsUsingFastmem() && !InitializeFastmem())
@ -289,7 +289,7 @@ void ClearState()
delete it.second;
s_blocks.clear();
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
s_host_code_map.clear();
s_code_buffer.Reset();
ResetFastMap();
@ -299,7 +299,7 @@ void ClearState()
void Shutdown()
{
ClearState();
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
ShutdownFastmem();
FreeFastMap();
s_code_buffer.Destroy();
@ -395,7 +395,7 @@ template<PGXPMode pgxp_mode>
g_state.npc = g_state.pc;
}
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
void CompileDispatcher()
{
@ -449,7 +449,7 @@ FastMapTable* GetFastMapPointer()
{
switch (g_settings.cpu_execution_mode)
{
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
case CPUExecutionMode::Recompiler:
ExecuteRecompiler();
break;
@ -473,7 +473,7 @@ FastMapTable* GetFastMapPointer()
}
}
#if defined(WITH_RECOMPILER)
#if defined(ENABLE_RECOMPILER)
JitCodeBuffer& GetCodeBuffer()
{
@ -486,11 +486,11 @@ void Reinitialize()
{
ClearState();
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
ShutdownFastmem();
#endif
#if defined(WITH_RECOMPILER)
#if defined(ENABLE_RECOMPILER)
s_code_buffer.Destroy();
if (g_settings.IsUsingRecompiler())
@ -507,7 +507,7 @@ void Reinitialize()
}
#endif
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
if (g_settings.IsUsingRecompiler())
{
if (g_settings.IsUsingFastmem() && !InitializeFastmem())
@ -523,7 +523,7 @@ void Reinitialize()
void Flush()
{
ClearState();
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
if (g_settings.IsUsingRecompiler())
CompileDispatcher();
#endif
@ -601,7 +601,7 @@ CodeBlock* LookupBlock(CodeBlockKey key, bool allow_flush)
// add it to the page map if it's in ram
AddBlockToPageMap(block);
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
SetFastMap(block->GetPC(), block->host_code);
AddBlockToHostCodeMap(block);
#endif
@ -636,7 +636,7 @@ bool RevalidateBlock(CodeBlock* block, bool allow_flush)
// re-add it to the page map since it's still up-to-date
block->invalidated = false;
AddBlockToPageMap(block);
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
SetFastMap(block->GetPC(), block->host_code);
#endif
return true;
@ -647,7 +647,7 @@ recompile:
// and we don't want to nuke the block we're compiling...
RemoveReferencesToBlock(block);
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
RemoveBlockFromHostCodeMap(block);
#endif
@ -684,7 +684,7 @@ recompile:
AddBlockToPageMap(block);
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
// re-add to page map again
SetFastMap(block->GetPC(), block->host_code);
AddBlockToHostCodeMap(block);
@ -809,7 +809,7 @@ bool CompileBlock(CodeBlock* block, bool allow_flush)
return false;
}
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
if (g_settings.IsUsingRecompiler())
{
// Ensure we're not going to run out of space while compiling this block.
@ -846,7 +846,7 @@ bool CompileBlock(CodeBlock* block, bool allow_flush)
return true;
}
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
void FastCompileBlockFunction()
{
@ -920,7 +920,7 @@ static void InvalidateBlock(CodeBlock* block, bool allow_frame_invalidation)
UnlinkBlock(block);
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
SetFastMap(block->GetPC(), FastCompileBlockFunction);
#endif
}
@ -956,7 +956,7 @@ void RemoveReferencesToBlock(CodeBlock* block)
BlockMap::iterator iter = s_blocks.find(block->key.GetPC());
Assert(iter != s_blocks.end() && iter->second == block);
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
SetFastMap(block->GetPC(), FastCompileBlockFunction);
#endif
@ -965,7 +965,7 @@ void RemoveReferencesToBlock(CodeBlock* block)
RemoveBlockFromPageMap(block);
UnlinkBlock(block);
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
if (!block->invalidated)
RemoveBlockFromHostCodeMap(block);
#endif
@ -1017,7 +1017,7 @@ void LinkBlock(CodeBlock* from, CodeBlock* to, void* host_pc, void* host_resolve
li.block = from;
to->link_predecessors.push_back(li);
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
// apply in code
if (host_pc)
{
@ -1034,7 +1034,7 @@ void UnlinkBlock(CodeBlock* block)
if (block->link_predecessors.empty() && block->link_successors.empty())
return;
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
if (g_settings.IsUsingRecompiler() && g_settings.cpu_recompiler_block_linking)
s_code_buffer.WriteProtect(false);
#endif
@ -1045,7 +1045,7 @@ void UnlinkBlock(CodeBlock* block)
[block](const CodeBlock::LinkInfo& li) { return li.block == block; });
Assert(iter != li.block->link_successors.end());
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
// Restore blocks linked to this block back to the resolver
if (li.host_pc)
{
@ -1064,7 +1064,7 @@ void UnlinkBlock(CodeBlock* block)
[block](const CodeBlock::LinkInfo& li) { return li.block == block; });
Assert(iter != li.block->link_predecessors.end());
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
// Restore blocks we're linking to back to the resolver, since the successor won't be linked to us to backpatch if
// it changes.
if (li.host_pc)
@ -1079,13 +1079,13 @@ void UnlinkBlock(CodeBlock* block)
}
block->link_successors.clear();
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
if (g_settings.IsUsingRecompiler() && g_settings.cpu_recompiler_block_linking)
s_code_buffer.WriteProtect(true);
#endif
}
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
void AddBlockToHostCodeMap(CodeBlock* block)
{
@ -1111,7 +1111,7 @@ bool InitializeFastmem()
const CPUFastmemMode mode = g_settings.cpu_fastmem_mode;
Assert(mode != CPUFastmemMode::Disabled);
#ifdef WITH_MMAP_FASTMEM
#ifdef ENABLE_MMAP_FASTMEM
const auto handler = (mode == CPUFastmemMode::MMap) ? MMapPageFaultHandler : LUTPageFaultHandler;
#else
const auto handler = LUTPageFaultHandler;
@ -1137,7 +1137,7 @@ void ShutdownFastmem()
CPU::UpdateFastmemBase();
}
#ifdef WITH_MMAP_FASTMEM
#ifdef ENABLE_MMAP_FASTMEM
Common::PageFaultHandler::HandlerResult MMapPageFaultHandler(void* exception_pc, void* fault_address, bool is_write)
{
@ -1256,11 +1256,11 @@ Common::PageFaultHandler::HandlerResult LUTPageFaultHandler(void* exception_pc,
return Common::PageFaultHandler::HandlerResult::ExecuteNextHandler;
}
#endif // WITH_RECOMPILER
#endif // ENABLE_RECOMPILER
} // namespace CPU::CodeCache
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
void CPU::Recompiler::Thunks::ResolveBranch(CodeBlock* block, void* host_pc, void* host_resolve_pc, u32 host_pc_size)
{
@ -1294,4 +1294,4 @@ void CPU::Recompiler::Thunks::LogPC(u32 pc)
#endif
}
#endif // WITH_RECOMPILER
#endif // ENABLE_RECOMPILER

View File

@ -13,7 +13,7 @@
#include <unordered_map>
#include <vector>
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
#include "cpu_recompiler_types.h"
#endif
@ -88,7 +88,7 @@ struct CodeBlock
TickCount uncached_fetch_ticks = 0;
u32 icache_line_count = 0;
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
std::vector<Recompiler::LoadStoreBackpatchInfo> loadstore_backpatch_info;
#endif
@ -127,14 +127,14 @@ void Initialize();
void Shutdown();
[[noreturn]] void Execute();
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
using DispatcherFunction = void (*)();
using SingleBlockDispatcherFunction = void (*)(const CodeBlock::HostCodePointer);
FastMapTable* GetFastMapPointer();
#endif
#if defined(WITH_RECOMPILER)
#if defined(ENABLE_RECOMPILER)
JitCodeBuffer& GetCodeBuffer();
#endif

View File

@ -2746,7 +2746,7 @@ void FullscreenUI::DrawInterfaceSettingsPage()
ImGuiFullscreen::SetTheme(bsi->GetBoolValue("Main", "UseLightFullscreenUITheme", false));
}
#ifdef WITH_DISCORD_PRESENCE
#ifdef ENABLE_DISCORD_PRESENCE
MenuHeading(FSUI_CSTR("Integration"));
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_CHARGING_STATION, "Enable Discord Presence"),
"Shows the game you are currently playing as part of your profile on Discord.", "Main",
@ -3220,7 +3220,7 @@ void FullscreenUI::DrawControllerSettingsPage()
MenuHeading(FSUI_CSTR("Input Sources"));
#ifdef USE_SDL2
#ifdef ENABLE_SDL2
DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_COG, "Enable SDL Input Source"),
FSUI_CSTR("The SDL input source supports most controllers."), "InputSources", "SDL", true, true,
false);
@ -3781,7 +3781,7 @@ void FullscreenUI::DrawDisplaySettingsPage()
break;
#endif
#ifdef WITH_VULKAN
#ifdef ENABLE_VULKAN
case GPURenderer::HardwareVulkan:
{
DrawToggleSetting(bsi, FSUI_CSTR("Threaded Presentation"),
@ -4416,7 +4416,7 @@ void FullscreenUI::DrawAudioSettingsPage()
void FullscreenUI::DrawAchievementsSettingsPage()
{
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
if (Achievements::IsUsingRAIntegration())
{
BeginMenuButtons();

View File

@ -319,7 +319,7 @@ std::unique_ptr<AudioStream> Host::CreateAudioStream(AudioBackend backend, u32 s
{
switch (backend)
{
#ifdef USE_CUBEB
#ifdef ENABLE_CUBEB
case AudioBackend::Cubeb:
return AudioStream::CreateCubebAudioStream(sample_rate, channels, buffer_ms, latency_ms, stretch);
#endif

View File

@ -659,7 +659,7 @@ void Settings::FixIncompatibleSettings(bool display_osd_messages)
}
}
#ifndef WITH_MMAP_FASTMEM
#ifndef ENABLE_MMAP_FASTMEM
if (g_settings.cpu_fastmem_mode == CPUFastmemMode::MMap)
{
Log_WarningPrintf("mmap fastmem is not available on this platform, using LUT instead.");
@ -929,10 +929,10 @@ static constexpr auto s_gpu_renderer_names = make_array(
#ifdef __APPLE__
"Metal",
#endif
#ifdef WITH_VULKAN
#ifdef ENABLE_VULKAN
"Vulkan",
#endif
#ifdef WITH_OPENGL
#ifdef ENABLE_OPENGL
"OpenGL",
#endif
"Software");
@ -943,10 +943,10 @@ static constexpr auto s_gpu_renderer_display_names = make_array(
#ifdef __APPLE__
TRANSLATE_NOOP("GPURenderer", "Hardware (Metal)"),
#endif
#ifdef WITH_VULKAN
#ifdef ENABLE_VULKAN
TRANSLATE_NOOP("GPURenderer", "Hardware (Vulkan)"),
#endif
#ifdef WITH_OPENGL
#ifdef ENABLE_OPENGL
TRANSLATE_NOOP("GPURenderer", "Hardware (OpenGL)"),
#endif
TRANSLATE_NOOP("GPURenderer", "Software"));
@ -988,11 +988,11 @@ RenderAPI Settings::GetRenderAPIForRenderer(GPURenderer renderer)
#ifdef __APPLE__
return RenderAPI::Metal;
#endif
#ifdef WITH_VULKAN
#ifdef ENABLE_VULKAN
case GPURenderer::HardwareVulkan:
return RenderAPI::Vulkan;
#endif
#ifdef WITH_OPENGL
#ifdef ENABLE_OPENGL
case GPURenderer::HardwareOpenGL:
return RenderAPI::OpenGL;
#endif
@ -1247,7 +1247,7 @@ const char* Settings::GetDisplayScalingDisplayName(DisplayScalingMode mode)
static constexpr const char* s_audio_backend_names[] = {
"Null",
#ifdef USE_CUBEB
#ifdef ENABLE_CUBEB
"Cubeb",
#endif
#ifdef _WIN32
@ -1259,7 +1259,7 @@ static constexpr const char* s_audio_backend_names[] = {
};
static constexpr const char* s_audio_backend_display_names[] = {
TRANSLATE_NOOP("AudioBackend", "Null (No Output)"),
#ifdef USE_CUBEB
#ifdef ENABLE_CUBEB
TRANSLATE_NOOP("AudioBackend", "Cubeb"),
#endif
#ifdef _WIN32

View File

@ -420,9 +420,9 @@ struct Settings
static constexpr GPURenderer DEFAULT_GPU_RENDERER = GPURenderer::HardwareD3D11;
#elif defined(__APPLE__)
static constexpr GPURenderer DEFAULT_GPU_RENDERER = GPURenderer::HardwareMetal;
#elif defined(WITH_OPENGL)
#elif defined(ENABLE_OPENGL)
static constexpr GPURenderer DEFAULT_GPU_RENDERER = GPURenderer::HardwareOpenGL;
#elif defined(WITH_VULKAN)
#elif defined(ENABLE_VULKAN)
static constexpr GPURenderer DEFAULT_GPU_RENDERER = GPURenderer::HardwareVulkan;
#else
static constexpr GPURenderer DEFAULT_GPU_RENDERER = GPURenderer::Software;
@ -434,9 +434,9 @@ struct Settings
static constexpr float DEFAULT_GPU_PGXP_DEPTH_THRESHOLD = 300.0f;
static constexpr float GPU_PGXP_DEPTH_THRESHOLD_SCALE = 4096.0f;
#ifdef WITH_RECOMPILER
#ifdef ENABLE_RECOMPILER
static constexpr CPUExecutionMode DEFAULT_CPU_EXECUTION_MODE = CPUExecutionMode::Recompiler;
#ifdef WITH_MMAP_FASTMEM
#ifdef ENABLE_MMAP_FASTMEM
static constexpr CPUFastmemMode DEFAULT_CPU_FASTMEM_MODE = CPUFastmemMode::MMap;
#else
static constexpr CPUFastmemMode DEFAULT_CPU_FASTMEM_MODE = CPUFastmemMode::LUT;
@ -446,7 +446,7 @@ struct Settings
static constexpr CPUFastmemMode DEFAULT_CPU_FASTMEM_MODE = CPUFastmemMode::Disabled;
#endif
#if defined(USE_CUBEB)
#if defined(ENABLE_CUBEB)
static constexpr AudioBackend DEFAULT_AUDIO_BACKEND = AudioBackend::Cubeb;
#elif defined(_WIN32)
static constexpr AudioBackend DEFAULT_AUDIO_BACKEND = AudioBackend::XAudio2;

View File

@ -74,7 +74,7 @@ Log_SetChannel(System);
#include <mmsystem.h>
#endif
#ifdef WITH_DISCORD_PRESENCE
#ifdef ENABLE_DISCORD_PRESENCE
#include "discord_rpc.h"
#endif
@ -132,7 +132,7 @@ static void UpdateSessionTime(const std::string& prev_serial);
static void SetTimerResolutionIncreased(bool enabled);
#ifdef WITH_DISCORD_PRESENCE
#ifdef ENABLE_DISCORD_PRESENCE
static void InitializeDiscordPresence();
static void ShutdownDiscordPresence();
static void PollDiscordPresence();
@ -231,7 +231,7 @@ static u32 s_runahead_replay_frames = 0;
// Used to track play time. We use a monotonic timer here, in case of clock changes.
static u64 s_session_start_time = 0;
#ifdef WITH_DISCORD_PRESENCE
#ifdef ENABLE_DISCORD_PRESENCE
static bool s_discord_presence_active = false;
#endif
@ -245,7 +245,7 @@ void System::Internal::ProcessStartup()
// This will call back to Host::LoadSettings() -> ReloadSources().
LoadSettings(false);
#ifdef WITH_RAINTEGRATION
#ifdef ENABLE_RAINTEGRATION
if (Host::GetBaseBoolSettingValue("Cheevos", "UseRAIntegration", false))
Achievements::SwitchToRAIntegration();
#endif
@ -255,7 +255,7 @@ void System::Internal::ProcessStartup()
void System::Internal::ProcessShutdown()
{
#ifdef WITH_DISCORD_PRESENCE
#ifdef ENABLE_DISCORD_PRESENCE
ShutdownDiscordPresence();
#endif
@ -268,7 +268,7 @@ void System::Internal::IdlePollUpdate()
{
InputManager::PollSources();
#ifdef WITH_DISCORD_PRESENCE
#ifdef ENABLE_DISCORD_PRESENCE
PollDiscordPresence();
#endif
@ -1664,7 +1664,7 @@ void System::ClearRunningGame()
Achievements::GameChanged(s_running_game_path, nullptr);
#ifdef WITH_DISCORD_PRESENCE
#ifdef ENABLE_DISCORD_PRESENCE
UpdateDiscordPresence();
#endif
}
@ -1740,7 +1740,7 @@ void System::FrameDone()
if (Achievements::IsActive())
Achievements::FrameUpdate();
#ifdef WITH_DISCORD_PRESENCE
#ifdef ENABLE_DISCORD_PRESENCE
PollDiscordPresence();
#endif
@ -3316,7 +3316,7 @@ void System::UpdateRunningGame(const char* path, CDImage* image, bool booting)
SaveStateSelectorUI::RefreshList();
#ifdef WITH_DISCORD_PRESENCE
#ifdef ENABLE_DISCORD_PRESENCE
UpdateDiscordPresence();
#endif
@ -4718,7 +4718,7 @@ u64 System::GetSessionPlayedTime()
return static_cast<u64>(std::round(Common::Timer::ConvertValueToSeconds(ctime - s_session_start_time)));
}
#ifdef WITH_DISCORD_PRESENCE
#ifdef ENABLE_DISCORD_PRESENCE
void System::InitializeDiscordPresence()
{

View File

@ -479,7 +479,7 @@ void UpdateMemorySaveStateSettings();
bool LoadRewindState(u32 skip_saves = 0, bool consume_state = true);
void SetRunaheadReplayFlag();
#ifdef WITH_DISCORD_PRESENCE
#ifdef ENABLE_DISCORD_PRESENCE
/// Called when rich presence changes.
void UpdateDiscordPresence();
#endif

View File

@ -65,10 +65,10 @@ enum class GPURenderer : u8
#ifdef __APPLE__
HardwareMetal,
#endif
#ifdef WITH_VULKAN
#ifdef ENABLE_VULKAN
HardwareVulkan,
#endif
#ifdef WITH_OPENGL
#ifdef ENABLE_OPENGL
HardwareOpenGL,
#endif
Software,
@ -144,7 +144,7 @@ enum class DisplayScalingMode : u8
enum class AudioBackend : u8
{
Null,
#ifdef USE_CUBEB
#ifdef ENABLE_CUBEB
Cubeb,
#endif
#ifdef _WIN32