From 562649c7c03a25fc2ea64cb9d1aa4e3f4938d9ea Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Tue, 16 Feb 2016 03:18:10 +0100 Subject: AGI: Change how VM timer vars are handled Instead of directly converting play time to VM timer vars, we only adjust VM timer vars according to play time seconds delta. This is needed for at least Mixed Up Mother Goose. The game sets the VM "second" variable to 0 and then uses it for syncing the text to the songs. We even adjust second calculation, so that the timing should always be the same and not depend on basically luck (seconds may wrap right after setting it, because internal cycles counter is not changed). --- engines/agi/agi.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/agi/agi.h') diff --git a/engines/agi/agi.h b/engines/agi/agi.h index fe70c4ebc2..c5db1dfc1d 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -870,6 +870,10 @@ private: uint32 _getVarSecondsHeuristicLastInstructionCounter; /**< last time VM_VAR_SECONDS were read */ uint16 _getVarSecondsHeuristicCounter; /**< how many times heuristic was triggered */ + uint32 _playTimeInSecondsAdjust; /**< milliseconds to adjust for calculating current play time in seconds, see setVarSecondsTrigger() */ + + void setVarSecondsTrigger(byte newSeconds); + public: // Some submethods of testIfCode void skipInstruction(byte op); -- cgit v1.2.3