From 0447abef365491bd200cc792f5112b75f5986f21 Mon Sep 17 00:00:00 2001 From: skidau Date: Fri, 10 Dec 2010 21:24:25 +0000 Subject: [PATCH] Changed the GC controller timer from a host based one to one based on the emulated hardware. This helps the emulator become more deterministic. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6552 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/HW/SI_DeviceGCController.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp b/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp index 3cb3b83ac9..df836011af 100644 --- a/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp +++ b/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp @@ -29,7 +29,8 @@ #include "../OnFrame.h" -#include "Timer.h" +#include "../CoreTiming.h" +#include "SystemTimers.h" #include "ProcessorInterface.h" @@ -205,7 +206,6 @@ bool CSIDevice_GCController::GetData(u32& _Hi, u32& _Low) } // Keep track of the special button combos (embedded in controller hardware... :( ) - // Should technically be in "gc time", but we just use host system time :) EButtonCombo tempCombo; if ((PadStatus.button & 0xff00) == (PAD_BUTTON_Y|PAD_BUTTON_X|PAD_BUTTON_START)) tempCombo = COMBO_ORIGIN; @@ -217,12 +217,12 @@ bool CSIDevice_GCController::GetData(u32& _Hi, u32& _Low) { m_LastButtonCombo = tempCombo; if (m_LastButtonCombo != COMBO_NONE) - m_TButtonComboStart = Common::Timer::GetTimeMs(); + m_TButtonComboStart = CoreTiming::GetTicks(); } if (m_LastButtonCombo != COMBO_NONE) { - m_TButtonCombo = Common::Timer::GetTimeMs(); - if ((m_TButtonCombo - m_TButtonComboStart) > 3000) + m_TButtonCombo = CoreTiming::GetTicks(); + if ((m_TButtonCombo - m_TButtonComboStart) > SystemTimers::GetTicksPerSecond() * 3) { if (m_LastButtonCombo == COMBO_RESET) ProcessorInterface::ResetButton_Tap();