FrameRateManager.h 893 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include "EmulatorComponent.h"
  3. #include <vector>
  4. namespace TLAC::Components
  5. {
  6. class FrameRateManager : public EmulatorComponent
  7. {
  8. public:
  9. FrameRateManager();
  10. ~FrameRateManager();
  11. virtual const char* GetDisplayName() override;
  12. virtual void Initialize(ComponentsManager*) override;
  13. virtual void Update() override;
  14. virtual void UpdateDraw2D() override;
  15. static float fspeed_error; // compensation value for use in this frame
  16. static float fspeed_error_next; // save a compensation value to be used in the next frame
  17. static float fspeedhook_lastresult; // used by the ageage hair patch to be lazy and avoid setting up for a proper call
  18. private:
  19. float *pvFrameRate;
  20. float *frameSpeed;
  21. float *aetFrameDuration;
  22. float defaultAetFrameDuration;
  23. float motionSpeedMultiplier = 5.0;
  24. void InjectCode(void* address, const std::vector<uint8_t> data);
  25. };
  26. }