RegTest: Fix build on Mac

This commit is contained in:
Stenzek 2023-11-20 20:56:21 +10:00
parent e6d29a0028
commit 20de40a597
No known key found for this signature in database
7 changed files with 21 additions and 13 deletions

View file

@ -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)

View file

@ -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;

View file

@ -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)
@ -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();
@ -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();

View file

@ -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)

View file

@ -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

View file

@ -3,3 +3,5 @@ add_executable(duckstation-regtest
)
target_link_libraries(duckstation-regtest PRIVATE core common scmversion)
add_core_resources(duckstation-regtest)

View file

@ -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());
@ -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;
}