diff --git a/ps2xRuntime/src/lib/Kernel/EeScheduler.cpp b/ps2xRuntime/src/lib/Kernel/EeScheduler.cpp index 3a6ec7d94..b15251c82 100644 --- a/ps2xRuntime/src/lib/Kernel/EeScheduler.cpp +++ b/ps2xRuntime/src/lib/Kernel/EeScheduler.cpp @@ -1251,6 +1251,10 @@ int EeScheduler::setIrqCauseEnabled(bool dmac, uint32_t cause, bool enabled) void EeScheduler::dispatchIrq(bool dmac, uint32_t cause) { + if (m_executorThread == std::thread::id{}) + { + m_executorThread = std::this_thread::get_id(); + } assertExecutor(); const uint32_t mask = dmac ? m_enabledDmacMask : m_enabledIntcMask; if (cause < 32u && (mask & (1u << cause)) == 0u) diff --git a/ps2xTest/CMakeLists.txt b/ps2xTest/CMakeLists.txt index 39dbc65ef..5b611486e 100644 --- a/ps2xTest/CMakeLists.txt +++ b/ps2xTest/CMakeLists.txt @@ -69,6 +69,11 @@ target_include_directories(ps2_test_lib PRIVATE ${CMAKE_SOURCE_DIR}/ps2xRuntime/src/lib ) +# Test reads ps2recomp/instructions.h by absolute path so it works from any working directory. +target_compile_definitions(ps2_test_lib PRIVATE + PS2X_RECOMP_INCLUDE_DIR="${CMAKE_SOURCE_DIR}/ps2xRecomp/include" +) + target_link_libraries(ps2_test_lib PRIVATE ps2_recomp_lib ps2_analyzer_lib diff --git a/ps2xTest/src/code_generator_tests.cpp b/ps2xTest/src/code_generator_tests.cpp index 1a1f37025..8d4622512 100644 --- a/ps2xTest/src/code_generator_tests.cpp +++ b/ps2xTest/src/code_generator_tests.cpp @@ -1140,6 +1140,9 @@ void register_code_generator_tests() tc.Run("VU0 macro mappings cover all S1/S2 enums", [](TestCase &t) { const std::vector candidates = { +#ifdef PS2X_RECOMP_INCLUDE_DIR + std::string(PS2X_RECOMP_INCLUDE_DIR) + "/ps2recomp/instructions.h", +#endif "ps2xRecomp/include/ps2recomp/instructions.h", "../ps2xRecomp/include/ps2recomp/instructions.h", "../../ps2xRecomp/include/ps2recomp/instructions.h"