namespace XFEEDToolBox.Core.Galaxy; /// /// Original normal frame event value, recovered from7F8CC0 ->7F3430 -> ///1EB9C0/8494 ->1EB050 ->global5F007A0. The ordinary source is a seconds/ /// nanoseconds timestamp difference converted to float seconds by52C3F0. /// The host owns its clock epoch and scheduling; it need not share the /// original wall-clock timestamp or another camera's transition history. /// public static class GalaxyOriginalFrameFadeClock { public const float MinimumFrameValue=.000009999999747378752f; public const float MaximumFrameValue=.5f; public const float LongFrameThreshold=4f; public const float LongFrameValue=.03333333507180214f; /// /// Bind host elapsed seconds to the original event policy. A frame over /// four seconds uses the original1/30 cap; exactly four uses the normal /// .5 cap. fixedFramesPerSecond explicitly selects the original app9B4 /// branch (1/app9B0), independently of elapsed time. Null elapsed remains /// unavailable in ordinary mode; no assumed timer period is supplied. /// public static bool TryFromElapsedSeconds(double? elapsedSeconds,out float frameValue,float? fixedFramesPerSecond=null) { frameValue=default;float raw; if(fixedFramesPerSecond is {} rate) { if(!float.IsFinite(rate)||rate<=0)return false; raw=1f/rate; } else { if(elapsedSeconds is not {} seconds||!double.IsFinite(seconds))return false; raw=(float)seconds; } if(!float.IsFinite(raw))return false; raw=Math.Max(MinimumFrameValue,raw); frameValue=Math.Min(raw,raw>LongFrameThreshold?LongFrameValue:MaximumFrameValue); return true; } }