decoupled timers from interpreter tick rate
This commit is contained in:
17
CountdownTimerSDL.hpp
Normal file
17
CountdownTimerSDL.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <SDL2/SDL_timer.h>
|
||||
|
||||
#include "Peripherals.hpp"
|
||||
|
||||
class CountdownTimerSDL : public chocochip8::CountdownTimer {
|
||||
public:
|
||||
CountdownTimerSDL(unsigned frequency);
|
||||
void set(unsigned value) override;
|
||||
unsigned get() const override;
|
||||
private:
|
||||
const Uint64 mDesiredFrequency;
|
||||
const Uint64 mSDLFrequency;
|
||||
Uint64 mStartTime;
|
||||
Uint64 mStartValue;
|
||||
};
|
||||
Reference in New Issue
Block a user