Skip to content

Commit

Permalink
RegTest: Fix build on Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Nov 21, 2023
1 parent e6d29a0 commit 20de40a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion scripts/run_regression_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def run_regression_tests(runner, gamedir, destdir, dump_interval, frames, parall

if parallel <= 1:
for game in gamepaths:
run_regression_test(runner, destdir, dump_interval, frames, game)
run_regression_test(runner, destdir, dump_interval, frames, renderer, game)
else:
print("Processing %u games on %u processors" % (len(gamepaths), parallel))
func = partial(run_regression_test, runner, destdir, dump_interval, frames, renderer)
Expand Down
1 change: 1 addition & 0 deletions src/core/cpu_newrec_compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,7 @@ bool CPU::NewRec::Compiler::TryRenameMIPSReg(Reg to, Reg from, u32 fromhost, Reg

// remove all references to renamed-to register
DeleteMIPSReg(to, false);
CancelLoadDelaysToReg(to);

// and do the actual rename, new register has been modified.
m_host_regs[fromhost].reg = to;
Expand Down
11 changes: 6 additions & 5 deletions src/core/cpu_recompiler_code_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,10 @@ void CodeGenerator::GenerateExceptionExit(Instruction instruction, const CodeCac

void CodeGenerator::BlockPrologue()
{
#if 0
EmitFunctionCall(nullptr, &CodeCache::LogCurrentState);
#endif

InitSpeculativeRegs();

if (m_block->protection == CodeCache::PageProtectionMode::ManualCheck)
Expand All @@ -992,10 +996,6 @@ void CodeGenerator::BlockPrologue()
EmitFunctionCall(nullptr, &CPU::HandleB0Syscall);
}

#if 0
EmitFunctionCall(nullptr, &CodeCache::LogCurrentState);
#endif

if (m_block->uncached_fetch_ticks > 0 || m_block->icache_line_count > 0)
EmitICacheCheckAndUpdate();

Expand Down Expand Up @@ -2745,7 +2745,8 @@ bool CodeGenerator::Compile_cop0(Instruction instruction, const CodeCache::Instr
EmitBranch(GetCurrentFarCodePointer());
SwitchToFarCode();
m_register_cache.PushState();
WriteNewPC(CalculatePC(), false);
if (!info.is_last_instruction)
WriteNewPC(CalculatePC(), false);
EmitStoreCPUStructField(offsetof(State, downcount), Value::FromConstantU32(0));
EmitExceptionExit();
m_register_cache.PopState();
Expand Down
2 changes: 1 addition & 1 deletion src/core/pgxp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ ALWAYS_INLINE_RELEASE void MaskValidate(PGXP_value* pV, u32 psxV, u32 mask, u32

ALWAYS_INLINE_RELEASE double f16Sign(double in)
{
const s32 s = static_cast<s32>(static_cast<u64>(in * (USHRT_MAX + 1)));
const s32 s = static_cast<s32>(static_cast<s64>(in * (USHRT_MAX + 1)));
return static_cast<double>(s) / static_cast<double>(USHRT_MAX + 1);
}
ALWAYS_INLINE_RELEASE double f16Unsign(double in)
Expand Down
2 changes: 2 additions & 0 deletions src/duckstation-nogui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ add_executable(duckstation-nogui
target_precompile_headers(duckstation-nogui PRIVATE "pch.h")
target_link_libraries(duckstation-nogui PRIVATE core util common imgui scmversion)

add_core_resources(duckstation-nogui)

if(WIN32)
message(STATUS "Building Win32 NoGUI Platform.")
target_sources(duckstation-nogui PRIVATE
Expand Down
2 changes: 2 additions & 0 deletions src/duckstation-regtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ add_executable(duckstation-regtest
)

target_link_libraries(duckstation-regtest PRIVATE core common scmversion)

add_core_resources(duckstation-regtest)
14 changes: 8 additions & 6 deletions src/duckstation-regtest/regtest_host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ bool RegTestHost::SetFolders()
EmuFolders::AppRoot = Path::Canonicalize(Path::GetDirectory(program_path));
EmuFolders::DataRoot = EmuFolders::AppRoot;

#ifndef __APPLE__
#ifdef __APPLE__
static constexpr char MAC_DATA_DIR[] = "Library/Application Support/DuckStation";
const char* home_dir = getenv("HOME");
if (home_dir)
EmuFolders::DataRoot = Path::Combine(home_dir, MAC_DATA_DIR);
#endif

// On Windows/Linux, these are in the binary directory.
EmuFolders::Resources = Path::Combine(EmuFolders::AppRoot, "resources");
#else
// On macOS, this is in the bundle resources directory.
EmuFolders::Resources = Path::Canonicalize(Path::Combine(EmuFolders::AppRoot, "../Resources"));
#endif

Log_DevPrintf("AppRoot Directory: %s", EmuFolders::AppRoot.c_str());
Log_DevPrintf("DataRoot Directory: %s", EmuFolders::DataRoot.c_str());
Expand All @@ -71,7 +73,7 @@ bool RegTestHost::SetFolders()
// the resources directory should exist, bail out if not
if (!FileSystem::DirectoryExists(EmuFolders::Resources.c_str()))
{
Log_ErrorPrintf("Error", "Resources directory is missing, your installation is incomplete.");
Log_ErrorPrint("Resources directory is missing, your installation is incomplete.");
return false;
}

Expand Down

0 comments on commit 20de40a

Please sign in to comment.