Skip to content

Commit

Permalink
Merge pull request #7123 from lioncash/enum
Browse files Browse the repository at this point in the history
 DSPCore: Convert core type enum into an enum class
  • Loading branch information
leoetlino committed Jun 15, 2018
2 parents 2b6d6c1 + 161dffe commit 0ee9b88
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Source/Core/Core/DSP/DSPCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ bool DSPCore_Init(const DSPInitOptions& opts)
Common::WriteProtectMemory(g_dsp.iram, DSP_IRAM_BYTE_SIZE, false);

// Initialize JIT, if necessary
if (opts.core_type == DSPInitOptions::CORE_JIT)
if (opts.core_type == DSPInitOptions::CoreType::JIT64)
g_dsp_jit = std::make_unique<JIT::x64::DSPEmitter>();

g_dsp_cap.reset(opts.capture_logger);
Expand Down
12 changes: 6 additions & 6 deletions Source/Core/Core/DSP/DSPCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,19 +329,19 @@ struct DSPInitOptions
std::array<u16, DSP_COEF_SIZE> coef_contents;

// Core used to emulate the DSP.
// Default: CORE_JIT.
enum CoreType
// Default: JIT64.
enum class CoreType
{
CORE_INTERPRETER,
CORE_JIT,
Interpreter,
JIT64,
};
CoreType core_type;
CoreType core_type = CoreType::JIT64;

// Optional capture logger used to log internal DSP data transfers.
// Default: dummy implementation, does nothing.
DSPCaptureLogger* capture_logger;

DSPInitOptions() : core_type(CORE_JIT), capture_logger(new DefaultDSPCaptureLogger()) {}
DSPInitOptions() : capture_logger(new DefaultDSPCaptureLogger()) {}
};

// Initializes the DSP emulator using the provided options. Takes ownership of
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/HW/DSPLLE/DSPLLE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ static bool FillDSPInitOptions(DSPInitOptions* opts)
if (!LoadDSPRom(opts->coef_contents.data(), coef_file, DSP_COEF_BYTE_SIZE))
return false;

opts->core_type = DSPInitOptions::CORE_INTERPRETER;
opts->core_type = DSPInitOptions::CoreType::Interpreter;
#ifdef _M_X86
if (SConfig::GetInstance().m_DSPEnableJIT)
opts->core_type = DSPInitOptions::CORE_JIT;
opts->core_type = DSPInitOptions::CoreType::JIT64;
#endif

if (SConfig::GetInstance().m_DSPCaptureLog)
Expand Down

0 comments on commit 0ee9b88

Please sign in to comment.