From 2644be3ca65e3582d75eb4ae061368b268ade559 Mon Sep 17 00:00:00 2001 From: Joshua Peisach Date: Wed, 21 Jun 2023 03:37:46 -0400 Subject: [PATCH] MxTimer matching (#29) * MxTimer::Start - swap instruction order Technically, isRunning is set after getting the real time according to the pseudo code, which i guess is fine, you dont know it started until it really started * MxTimer - finish tweaking to match assembly --- LEGO1/mxtimer.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/LEGO1/mxtimer.cpp b/LEGO1/mxtimer.cpp index 8be837d4..782ccd70 100644 --- a/LEGO1/mxtimer.cpp +++ b/LEGO1/mxtimer.cpp @@ -10,17 +10,18 @@ long MxTimer::s_LastTimeTimerStarted = 0; // OFFSET: LEGO1 0x100ae060 MxTimer::MxTimer() -{ - this->m_isRunning = MX_FALSE; - MxTimer::s_LastTimeCalculated = timeGetTime(); - this->m_startTime = MxTimer::s_LastTimeCalculated; +{ + this->m_isRunning = MX_FALSE; + m_startTime = timeGetTime(); + // yeah this is somehow what the asm is + s_LastTimeCalculated = m_startTime; } // OFFSET: LEGO1 0x100ae160 void MxTimer::Start() { + s_LastTimeTimerStarted = this->GetRealTime(); this->m_isRunning = MX_TRUE; - MxTimer::s_LastTimeTimerStarted = timeGetTime(); } // OFFSET: LEGO1 0x100ae180