AMMediaboard: derive TestHardware phase2 delay from tick rate

Use the existing system reference instead of Core::System::GetInstance(),
and calculate the phase 2 scheduling delay from GetTicksPerSecond()
instead of hardcoding 50000 ticks.
This commit is contained in:
naari3
2026-02-24 10:33:08 +09:00
parent ab0d300041
commit 65f8c8f6cc

View File

@@ -1616,9 +1616,9 @@ u32 ExecuteCommand(std::array<u32, 3>& dicmd_buf, u32* diimm_buf, u32 address, u
// Schedule phase 2 result after a short delay.
{
auto& core_timing = Core::System::GetInstance().GetCoreTiming();
auto& core_timing = system.GetCoreTiming();
core_timing.RemoveEvent(s_et_test_hw_phase2);
constexpr s64 phase2_delay = 50000; // ~1ms at 486MHz
const s64 phase2_delay = system.GetSystemTimers().GetTicksPerSecond() / 10000; // ~100us
core_timing.ScheduleEvent(phase2_delay, s_et_test_hw_phase2, 1); // 1 = Execute2
}
@@ -1978,9 +1978,10 @@ u32 ExecuteCommand(std::array<u32, 3>& dicmd_buf, u32* diimm_buf, u32 address, u
// Schedule phase 2 via CoreTiming.
{
auto& core_timing = Core::System::GetInstance().GetCoreTiming();
auto& core_timing = system.GetCoreTiming();
core_timing.RemoveEvent(s_et_test_hw_phase2);
constexpr s64 phase2_delay = 50000; // ~1ms at 486MHz
const s64 phase2_delay =
system.GetSystemTimers().GetTicksPerSecond() / 10000; // ~100us
core_timing.ScheduleEvent(phase2_delay, s_et_test_hw_phase2, 0); // 0 = Execute1
}
break;